-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (59 loc) · 1.99 KB
/
Copy pathci.yml
File metadata and controls
74 lines (59 loc) · 1.99 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
name: CI
on:
push:
branches: [master]
pull_request:
workflow_dispatch:
jobs:
# Typecheck, unit tests and a production build on both Linux and Windows —
# the project is developed on Windows and deployed from Linux, so the
# contrast is worth proving rather than assuming.
build:
name: build & test (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: npm
# Printed before the install so an `npm ci` failure is diagnosable from
# the log alone: the npm major that consumes the lockfile is decided by
# the Node version, and is routinely a major behind a developer's global
# npm. See tools/verify-install.mjs.
- name: Toolchain versions
run: node --version && npm --version
- run: npm ci
- name: Typecheck
run: npm run typecheck
- name: Unit tests
run: npm test
- name: Production build
run: npm run build
# Boots the built page in a real browser and drives it: places bodies, pans,
# zooms, switches field modes, pauses. Fails on any console error, any failed
# request, or any of the rendering regressions the unit tests cannot see —
# colours are checked by sampling canvas pixels. "It works" as a checkmark
# rather than a claim.
smoketest:
name: smoke test (headless chromium)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: npm
- name: Toolchain versions
run: node --version && npm --version
- run: npm ci
- name: Install Chromium
run: npx playwright install --with-deps chromium
- name: Build
run: npm run build
- name: Drive the app
run: npm run smoketest