From e4fb43ee631c1e0a1e9c68356cc19be0a08005b6 Mon Sep 17 00:00:00 2001 From: Mahmoud Mabrouk Date: Wed, 17 Jun 2026 20:25:02 +0200 Subject: [PATCH] fix playwright browser cache fallback --- .github/workflows/12-check-unit-tests.yml | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/.github/workflows/12-check-unit-tests.yml b/.github/workflows/12-check-unit-tests.yml index 157d81e470..a2a5f3e103 100644 --- a/.github/workflows/12-check-unit-tests.yml +++ b/.github/workflows/12-check-unit-tests.yml @@ -88,7 +88,9 @@ jobs: uses: actions/cache@v4 with: path: ~/.cache/ms-playwright - key: ${{ runner.os }}-playwright-browsers + key: ${{ runner.os }}-playwright-browsers-${{ hashFiles('web/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-playwright-browsers- # System deps for chromium only (not the full webkit/firefox apt set, # which pulls in the gstreamer/audio/video stack and takes ~14m). Runs @@ -98,10 +100,23 @@ jobs: working-directory: web/tests run: pnpm exec playwright install-deps chromium - - name: Install Playwright if not cached - if: (github.event_name != 'workflow_dispatch' || contains(fromJSON('["all","web-only"]'), inputs.packages)) && steps.restore-playwright-cache.outputs.cache-hit != 'true' + - name: Install Playwright browser + if: github.event_name != 'workflow_dispatch' || contains(fromJSON('["all","web-only"]'), inputs.packages) working-directory: web/tests - run: pnpm exec playwright install chromium + run: | + for attempt in 1 2 3; do + echo "::group::playwright install chromium (attempt ${attempt}/3)" + if timeout 180 pnpm exec playwright install chromium; then + echo "::endgroup::" + echo "browser install succeeded on attempt ${attempt}" + exit 0 + fi + echo "::endgroup::" + echo "attempt ${attempt} stalled or failed; retrying after 5s..." + sleep 5 + done + echo "playwright browser install failed after 3 attempts" >&2 + exit 1 - name: Run web unit tests if: github.event_name != 'workflow_dispatch' || contains(fromJSON('["all","web-only"]'), inputs.packages)