From ba6ac9c705acb55b5e0e65781ef200eb9441dc80 Mon Sep 17 00:00:00 2001 From: Alquen Sarmiento Date: Tue, 7 Jul 2026 09:50:38 +0800 Subject: [PATCH] fix: cache downloaded playwright browsers with re-attempt --- .github/workflows/playwright.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 4b0f8f195..845aa5cad 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -64,8 +64,22 @@ jobs: run: | npm ci --legacy-peer-deps npm run build:no-translate + - name: Cache Playwright Browsers + uses: actions/cache@v4 + with: + path: ~/.cache/ms-playwright + key: ${{ runner.os }}-playwright-${{ hashFiles('package-lock.json') }} + restore-keys: | + ${{ runner.os }}-playwright- - name: Install Playwright Browsers - run: npx playwright install chromium --with-deps + timeout-minutes: 15 + run: | + for attempt in 1 2 3; do + npx playwright install chromium --with-deps && exit 0 + echo "Playwright install failed on attempt $attempt" + sleep $((attempt * 30)) + done + exit 1 - name: Install wp-env run: | npm install -g @wordpress/env