Skip to content

Commit 04c3cd7

Browse files
authored
feat: caches playwright installation
1 parent 05cc9eb commit 04c3cd7

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

.github/workflows/tests.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,24 @@ jobs:
4343
- name: Build Assets
4444
run: npm run build
4545

46+
- name: Get Playwright version
47+
id: playwright-version
48+
run: echo "version=$(npm list @playwright/test --depth=0 --json | jq -r '.dependencies["@playwright/test"].version')" >> $GITHUB_OUTPUT
49+
50+
- name: Cache Playwright Browsers
51+
uses: actions/cache@v4
52+
id: playwright-cache
53+
with:
54+
path: ~/.cache/ms-playwright
55+
key: ${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.version }}
56+
4657
- name: Install Playwright Browsers
58+
if: steps.playwright-cache.outputs.cache-hit != 'true'
4759
run: npx playwright install --with-deps
4860

61+
- name: Install Playwright System Dependencies
62+
if: steps.playwright-cache.outputs.cache-hit == 'true'
63+
run: npx playwright install-deps
4964
- name: Rector Cache
5065
uses: actions/cache@v4
5166
with:

0 commit comments

Comments
 (0)