|
8 | 8 | jobs: |
9 | 9 | test: |
10 | 10 | runs-on: ubuntu-latest |
11 | | - timeout-minutes: 15 # never let a hung Playwright job eat our runners |
| 11 | + timeout-minutes: 15 |
12 | 12 |
|
13 | 13 | steps: |
14 | | - # 1 > checkout code |
| 14 | + # 1 ▸ code |
15 | 15 | - uses: actions/checkout@v4 |
16 | 16 |
|
17 | | - # 2 > install pnpm 10.12.1 (same as packageManager field) |
| 17 | + # 2 ▸ pnpm |
18 | 18 | - uses: pnpm/action-setup@v3 |
19 | 19 | with: |
20 | 20 | version: 10.12.1 |
21 | | - run_install: false # we'll call pnpm install ourselves |
| 21 | + run_install: false |
22 | 22 |
|
23 | | - # 3 > set up Node 20 + cache the global pnpm store |
| 23 | + # 3 ▸ Node + pnpm-store cache |
24 | 24 | - uses: actions/setup-node@v4 |
25 | 25 | with: |
26 | 26 | node-version: 20 |
27 | 27 | cache: pnpm |
28 | 28 |
|
29 | | - # 4 > install all workspace deps deterministically |
| 29 | + # 4 ▸ deps |
30 | 30 | - name: Install dependencies |
31 | 31 | run: pnpm install --frozen-lockfile |
32 | 32 |
|
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 |
48 | 58 | - name: Upload Playwright traces on failure |
49 | 59 | if: failure() |
50 | 60 | uses: actions/upload-artifact@v4 |
|
0 commit comments