Skip to content

Commit b3d5189

Browse files
Cache Playwright browsers in CI
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent cbb2afe commit b3d5189

1 file changed

Lines changed: 22 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,27 @@ jobs:
8181
working-directory: website
8282
run: npm ci
8383

84+
- name: Get Playwright version
85+
id: playwright-version
86+
working-directory: website
87+
run: echo "version=$(npm ls @playwright/test --json | jq -r '.dependencies["@playwright/test"].version')" >> $GITHUB_OUTPUT
88+
89+
- name: Cache Playwright browsers
90+
uses: actions/cache@v4
91+
id: playwright-cache
92+
with:
93+
path: ~/.cache/ms-playwright
94+
key: playwright-${{ runner.os }}-${{ steps.playwright-version.outputs.version }}
95+
96+
- name: Install Playwright browsers
97+
if: steps.playwright-cache.outputs.cache-hit != 'true'
98+
working-directory: website
99+
run: npx playwright install --with-deps chromium
100+
101+
- name: Install Playwright deps only (cached)
102+
if: steps.playwright-cache.outputs.cache-hit == 'true'
103+
run: npx playwright install-deps chromium
104+
84105
- name: Run website tests
85106
working-directory: website
86-
run: bash scripts/test.sh
107+
run: npm test

0 commit comments

Comments
 (0)