Skip to content

Commit 9cfc28b

Browse files
committed
fix: install and cache playwright browsers
1 parent 2cd8d7c commit 9cfc28b

File tree

1 file changed

+31
-21
lines changed

1 file changed

+31
-21
lines changed

.github/workflows/ci.yml

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,43 +8,53 @@ on:
88
jobs:
99
test:
1010
runs-on: ubuntu-latest
11-
timeout-minutes: 15 # never let a hung Playwright job eat our runners
11+
timeout-minutes: 15
1212

1313
steps:
14-
# 1 > checkout code
14+
# 1 code
1515
- uses: actions/checkout@v4
1616

17-
# 2 > install pnpm 10.12.1 (same as packageManager field)
17+
# 2 pnpm
1818
- uses: pnpm/action-setup@v3
1919
with:
2020
version: 10.12.1
21-
run_install: false # we'll call pnpm install ourselves
21+
run_install: false
2222

23-
# 3 > set up Node 20 + cache the global pnpm store
23+
# 3 Node + pnpm-store cache
2424
- uses: actions/setup-node@v4
2525
with:
2626
node-version: 20
2727
cache: pnpm
2828

29-
# 4 > install all workspace deps deterministically
29+
# 4 deps
3030
- name: Install dependencies
3131
run: pnpm install --frozen-lockfile
3232

33-
# 5 > lint
34-
- name: Lint
35-
run: pnpm lint
36-
37-
# 6 > pack core and inject tarball into demo fixtures
38-
- name: Pack core tarball
39-
run: pnpm run prepack:core # builds .tgz in ./dist
40-
- name: Inject tarball into fixtures
41-
run: node scripts/install-local-tarball.js # script injects .tgz into demo fixtures
42-
43-
# 7 > run full unit + Playwright suite
44-
- name: Run tests
45-
run: pnpm test # resolves to core's "test" → test:all
46-
47-
# 8 > upload Playwright traces on failure
33+
# 5 ▸ **cache Playwright browsers**
34+
- name: Cache Playwright browsers
35+
uses: actions/cache@v4
36+
with:
37+
path: ~/.cache/ms-playwright # default download dir
38+
key: ${{ runner.os }}-playwright-${{ hashFiles('pnpm-lock.yaml') }}
39+
restore-keys: ${{ runner.os }}-playwright-
40+
41+
# 6 ▸ download browsers if cache miss
42+
- name: Install Playwright browsers
43+
run: pnpm exec playwright install --with-deps
44+
45+
# 7 ▸ lint
46+
- run: pnpm lint
47+
name: Lint
48+
49+
# 8 ▸ pack, inject tarball, run tests
50+
- run: pnpm run prepack:core
51+
name: Pack core tarball
52+
- run: node scripts/install-local-tarball.js
53+
name: Inject tarball into fixtures
54+
- run: pnpm test
55+
name: Run tests
56+
57+
# 9 ▸ traces on failure
4858
- name: Upload Playwright traces on failure
4959
if: failure()
5060
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)