Skip to content

Commit 370b587

Browse files
committed
matrix
1 parent 6da2df0 commit 370b587

File tree

2 files changed

+26
-6
lines changed

2 files changed

+26
-6
lines changed

.github/workflows/playwright.yml

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,33 @@ on:
66
pull_request:
77

88
jobs:
9+
get-apps:
10+
runs-on: ubuntu-latest
11+
outputs:
12+
apps: ${{ steps.output-apps.outputs.apps }}
13+
steps:
14+
- name: Check out code
15+
uses: actions/checkout@v4
16+
17+
- name: Output apps
18+
id: output-apps
19+
uses: actions/github-script@v7
20+
with:
21+
script: |
22+
const { apps } = await import('${{ github.workspace }}/examples/common/apps');
23+
24+
core.setOutput("apps", JSON.stringify(apps));
25+
926
test:
1027
timeout-minutes: 30
28+
needs: [get-apps]
1129
strategy:
12-
fail-fast: true
30+
fail-fast: false
1331
matrix:
32+
app: ${{ needs.get-apps.outputs.apps }}
1433
os: [ubuntu-latest, windows-latest]
1534
runs-on: ${{ matrix.os }}
35+
name: ${{ matrix.app }} (${{ matrix.os }})
1636
steps:
1737
- name: Check out code
1838
uses: actions/checkout@v4
@@ -27,17 +47,17 @@ jobs:
2747
run: pnpm build
2848

2949
- name: Build all workers
30-
run: pnpm -r build:worker
50+
run: pnpm --filter ${{ matrix.app }} build:worker
3151

3252
- name: Run playwright tests
33-
run: pnpm e2e
53+
run: pnpm --filter ${{ matrix.app }} e2e
3454

3555
- name: Run playwright dev tests
36-
run: pnpm e2e:dev
56+
run: pnpm --filter ${{ matrix.app }} e2e:dev
3757

3858
- uses: actions/upload-artifact@v4
3959
if: always()
4060
with:
4161
name: playwright-report
42-
path: ./**/playwright-report
62+
path: ./**/playwright-report-${{ matrix.app }}-${{ matrix.os }}
4363
retention-days: 1

examples/common/apps.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// List of all e2e tested apps
2-
const apps = [
2+
export const apps = [
33
// examples
44
"create-next-app",
55
"middleware",

0 commit comments

Comments
 (0)