Repository navigation
70 lines (57 loc) · 1.89 KB
/
Copy pathe2e.yml
File metadata and controls
70 lines (57 loc) · 1.89 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
65
66
67
68
69
70
name: E2E
on:
push:
branches: [main]
pull_request:
jobs:
e2e:
runs-on: ubuntu-latest
timeout-minutes: 20
services:
postgres:
image: postgres:16
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: nextbeats
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
# Throwaway Postgres created by the service container above. `sslmode=disable`
# is honored by normalizeDatabaseUrl (lib/database-url.ts) so this connects
# without TLS; remote URLs like Neon are still forced to verify-full.
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/nextbeats?sslmode=disable
steps:
- uses: actions/checkout@v4
# Reads the pnpm version from package.json's `packageManager` field.
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Generate Prisma client
run: pnpm exec prisma generate
- name: Push schema and seed test data (tracks, playlists, e2e user)
run: |
pnpm exec prisma db push
pnpm prisma.seed
- name: Install Playwright browser
run: pnpm exec playwright install --with-deps chromium
# playwright.config.ts starts the app (`pnpm dev --port 3002`) itself.
# GitHub sets CI=true, so the config uses retries and a single worker.
- name: Run e2e tests
run: pnpm test:e2e
- name: Upload Playwright report
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: playwright-report/
retention-days: 7