-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (74 loc) · 2.3 KB
/
Copy pathci.yml
File metadata and controls
78 lines (74 loc) · 2.3 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
71
72
73
74
75
76
77
78
name: CI
# Lint, typecheck, vitest, and the chromium Playwright suite on every
# push to `main` and every PR. Walkthrough is opt-in via a separate
# project (`pnpm test:walk`) — heavier, slower, generates 56 PNGs;
# we don't run it on every CI tick.
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
lint-and-test:
name: lint · typecheck · vitest · build
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
version: 10
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- name: Install
run: pnpm install --frozen-lockfile
- name: Lint
run: pnpm lint
- name: Typecheck
run: pnpm typecheck
- name: Vitest
run: pnpm test
- name: Build
# Build under empty Upstash creds so the production secrets
# never need to be wired into CI just to compile. The dev
# in-memory fallback keeps every page renderable.
env:
UPSTASH_REDIS_REST_URL: ""
UPSTASH_REDIS_REST_TOKEN: ""
SESSION_SECRET: "ci-build-session-secret-32char"
run: pnpm build
e2e:
name: playwright (chromium)
runs-on: ubuntu-latest
timeout-minutes: 25
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
version: 10
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- name: Install
run: pnpm install --frozen-lockfile
- name: Install Playwright Chromium
run: pnpm exec playwright install --with-deps chromium
- name: Generate API inventory
# `e2e/api-contracts.spec.ts` reads `tmp/api-inventory.json`;
# `tmp/` is gitignored so the file doesn't survive checkout.
# Regenerate it from the live route tree before running e2e.
run: node scripts/audit-api-contracts.mjs
- name: Run chromium project
env:
CI: "1"
run: pnpm exec playwright test --project=chromium
- name: Upload report on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: playwright-report/
retention-days: 7