Skip to content

Commit 30735a6

Browse files
ci: shard over browser, cache. (#44)
1 parent 1623e6d commit 30735a6

File tree

2 files changed

+21
-8
lines changed

2 files changed

+21
-8
lines changed

.github/workflows/playwright.yml

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,15 @@ on:
1414

1515
jobs:
1616
e2e:
17-
name: E2E (Playwright)
17+
name: E2E (Playwright, ${{ matrix.browser }})
1818
runs-on: ubuntu-latest
19-
timeout-minutes: 25
19+
timeout-minutes: 35
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
browser:
24+
- chromium
25+
- webkit
2026

2127
steps:
2228
- name: Checkout
@@ -26,36 +32,42 @@ jobs:
2632
uses: actions/setup-node@v6.2.0
2733
with:
2834
node-version: '24.14.0'
35+
cache: npm
2936

3037
- name: Install Dependencies
3138
run: npm ci
3239

3340
- name: Check Types
3441
run: npm run check-types
3542

36-
- name: Lint Playwright Files
37-
run: npm run lint:playwright
43+
- name: Cache Playwright Browsers
44+
uses: actions/cache@v5
45+
with:
46+
path: ~/.cache/ms-playwright
47+
key: ${{ runner.os }}-playwright-${{ matrix.browser }}-${{ hashFiles('package-lock.json') }}
48+
restore-keys: |
49+
${{ runner.os }}-playwright-${{ matrix.browser }}-
3850
3951
- name: Install Browsers
40-
run: npx playwright install --with-deps chromium webkit
52+
run: npx playwright install --with-deps ${{ matrix.browser }}
4153

4254
- name: Run Playwright Tests
4355
env:
4456
CI: 'true'
45-
run: npm run test:e2e
57+
run: npm run test:e2e -- --project=${{ matrix.browser }}
4658

4759
- name: Upload Playwright report
4860
uses: actions/upload-artifact@v6.0.0
4961
if: ${{ failure() }}
5062
with:
51-
name: playwright-report
63+
name: playwright-report-${{ matrix.browser }}
5264
path: playwright-report
5365
if-no-files-found: ignore
5466

5567
- name: Upload Playwright test results
5668
uses: actions/upload-artifact@v6.0.0
5769
if: ${{ failure() }}
5870
with:
59-
name: test-results
71+
name: test-results-${{ matrix.browser }}
6072
path: test-results
6173
if-no-files-found: ignore

playwright.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export default defineConfig({
3131
testDir: 'playwright',
3232
timeout: isCI ? 120_000 : 20_000,
3333
retries: isCI ? 1 : 0,
34+
workers: isCI ? 2 : undefined,
3435
expect: {
3536
timeout: isCI ? 90_000 : 15_000,
3637
},

0 commit comments

Comments
 (0)