@@ -34,21 +34,25 @@ jobs:
3434 - name : Install dependencies
3535 run : pnpm install --frozen-lockfile
3636
37+ - name : Resolve Playwright version
38+ id : playwright-version
39+ run : echo "version=$(pnpm exec playwright --version | awk '{print $2}')" >> "$GITHUB_OUTPUT"
40+
3741 - name : Cache Playwright browsers
3842 uses : actions/cache@v4
39- id : playwright-cache
4043 with :
4144 path : ~/.cache/ms-playwright
42- key : playwright-chromium-webkit-${{ runner.os }}-${{ hashFiles('widget/pnpm-lock.yaml') }}
45+ # Key on the resolved Playwright version: each version pins specific
46+ # browser builds (e.g. webkit-2272), so a bump auto-invalidates the cache.
47+ key : playwright-${{ runner.os }}-${{ steps.playwright-version.outputs.version }}
4348
44- - name : Install Playwright browsers
45- if : steps.playwright-cache.outputs.cache-hit != 'true'
49+ # Run unconditionally. `playwright install` is idempotent: it only downloads
50+ # browsers missing from the (possibly cached) ms-playwright dir, so a partial
51+ # or stale cache self-heals here instead of permanently skipping the binary
52+ # install. --with-deps re-applies system libraries, which are not cached.
53+ - name : Install Playwright browsers and system dependencies
4654 run : pnpm exec playwright install --with-deps chromium webkit
4755
48- - name : Install Playwright system deps
49- if : steps.playwright-cache.outputs.cache-hit == 'true'
50- run : pnpm exec playwright install-deps chromium webkit
51-
5256 - name : Run E2E tests
5357 run : pnpm e2e
5458
0 commit comments