Repository navigation
55 lines (44 loc) · 1.43 KB
/
Copy pathci.yml
File metadata and controls
55 lines (44 loc) · 1.43 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
name: CI
on:
pull_request:
push:
branches: [main]
# A superseded run tells you nothing useful; don't pay for it.
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
# react-simple-maps declares a React <19 peer, so a plain `npm ci` fails.
# deploy.yml installs the same way.
- name: Install
run: npm install --legacy-peer-deps
- name: Typecheck
run: npx tsc --noEmit
- name: Unit tests
run: npm test -- --run
# Deliberately no Substack fetch: CI must not depend on the network or on
# dommangonon.substack.com being up. deploy.yml runs
# scripts/fetch-substack.js as its own step before building.
- name: Build
run: npm run build
- name: Install Playwright browser
run: npx playwright install --with-deps chromium
# playwright.config.ts starts its own dev server; reuseExistingServer is
# off when CI is set, so this can't silently test a stale server.
- name: E2E tests
run: npx playwright test
- name: Upload Playwright report
if: failure()
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: playwright-report/
retention-days: 7