Repository navigation
64 lines (56 loc) · 1.93 KB
/
Copy pathe2e.yml
File metadata and controls
64 lines (56 loc) · 1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: e2e
on:
push:
branches: [main]
pull_request:
branches: [main]
# Each run owns its outside world: Postgres and every emulator start with it
# and die with it, so runs of different branches overlap freely. A new push on
# a pull request cancels its previous run. Pushes on main never cancel each
# other: each one gates its own production deployment.
concurrency:
group: e2e-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
# Each shard is a whole e2e world of its own: its build, its Postgres, its
# emulators, its seed. Playwright runs the setup and the global cap teardown
# in every shard, and splits the scenarios between them.
e2e-shard:
name: e2e shard ${{ matrix.shard }}/${{ strategy.job-total }}
runs-on: ubuntu-latest
timeout-minutes: 20
container:
image: mcr.microsoft.com/playwright:v1.64.1-noble
options: --user 1001
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3, 4]
steps:
- uses: actions/checkout@v5
- uses: pnpm/setup@v3
with:
runtime: node@24
cache: true
- run: pnpm run build:e2e
- run: pnpm run test:e2e --shard=${{ matrix.shard }}/${{ strategy.job-total }}
# The repository is public: traces carry session cookies, so they only
# leave the runner when something failed, and not for long.
- uses: actions/upload-artifact@v4
if: failure()
with:
name: playwright-report-${{ matrix.shard }}
path: |
playwright-report/
e2e/.logs/
include-hidden-files: true
retention-days: 3
# The one check branch protection and Vercel wait for, whatever the number
# of shards.
e2e:
if: always()
needs: e2e-shard
runs-on: ubuntu-latest
steps:
- if: needs.e2e-shard.result != 'success'
run: exit 1