@@ -28,31 +28,25 @@ jobs:
2828 path : |
2929 ~/.cache/ms-playwright
3030 key : ${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.PLAYWRIGHT_VERSION }}
31- - name : Create system deps marker
32- id : system-deps-marker
33- run : |
34- echo "DEPS_KEY=${{ runner.os }}-system-deps-${{ steps.playwright-version.outputs.PLAYWRIGHT_VERSION }}" >> $GITHUB_OUTPUT
35- mkdir -p ~/.playwright-system-deps
36- - name : Cache system dependencies marker
31+ - name : Cache system dependencies
3732 uses : actions/cache@v4
3833 id : system-deps-cache
3934 with :
40- path : ~/.playwright-system-deps
41- key : ${{ steps.system-deps-marker.outputs.DEPS_KEY }}
42- - name : Install Playwright Browsers with system deps (no cache)
43- run : |
44- npx playwright install --with-deps
45- touch ~/.playwright-system-deps/installed
35+ path : |
36+ /var/cache/apt
37+ /var/lib/apt/lists
38+ key : ${{ runner.os }}-system-deps-${{ hashFiles('.github/workflows/playwright.yml') }}
39+ restore-keys : |
40+ ${{ runner.os }}-system-deps-
41+ - name : Install Playwright Browsers
42+ run : npx playwright install --with-deps
4643 if : steps.playwright-cache.outputs.cache-hit != 'true'
47- - name : Install Playwright Browsers only (browsers cached, need system deps)
48- run : |
49- npx playwright install
50- npx playwright install-deps
51- touch ~/.playwright-system-deps/installed
52- if : steps.playwright-cache.outputs.cache-hit == 'true' && steps.system-deps-cache.outputs.cache-hit != 'true'
53- - name : Install Playwright Browsers only (both cached)
44+ - name : Install Playwright Browsers (cache hit)
5445 run : npx playwright install
5546 if : steps.playwright-cache.outputs.cache-hit == 'true' && steps.system-deps-cache.outputs.cache-hit == 'true'
47+ - name : Install Playwright system dependencies
48+ run : npx playwright install-deps
49+ if : steps.playwright-cache.outputs.cache-hit == 'true' && steps.system-deps-cache.outputs.cache-hit != 'true'
5650
5751 - name : Run Playwright tests
5852 run : npx playwright test
0 commit comments