Skip to content

Commit f918256

Browse files
Copilotgkorland
andcommitted
ci: cache Playwright browsers in workflow
Co-authored-by: gkorland <753206+gkorland@users.noreply.github.com>
1 parent 78f3ce2 commit f918256

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

.github/workflows/playwright.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,21 @@ jobs:
4747
- name: Install Playwright
4848
run: |
4949
npm ci
50-
npx playwright install --with-deps
50+
51+
- name: Cache Playwright browsers
52+
id: playwright-cache
53+
uses: actions/cache@v4
54+
with:
55+
path: ~/.cache/ms-playwright
56+
key: playwright-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
57+
58+
- name: Install Playwright browsers
59+
if: steps.playwright-cache.outputs.cache-hit != 'true'
60+
run: npx playwright install --with-deps chromium firefox
61+
62+
- name: Install Playwright system deps
63+
if: steps.playwright-cache.outputs.cache-hit == 'true'
64+
run: npx playwright install-deps chromium firefox
5165

5266
- name: Run Playwright tests
5367
env:

0 commit comments

Comments
 (0)