Repository navigation
64 lines (54 loc) · 1.92 KB
/
Copy pathweb-ci.yml
File metadata and controls
64 lines (54 loc) · 1.92 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
name: Web CI
# Lint + build the Next.js site so broken code can't reach main.
# Only runs when something under web/ (or this workflow) changes — and on
# hardware/case/, because the Build panel's case cards link into it and
# build-cases-data.test.ts checks those paths and the remix READMEs.
on:
pull_request:
paths:
- "web/**"
- "hardware/case/**"
- ".github/workflows/web-ci.yml"
push:
branches: [main]
paths:
- "web/**"
- "hardware/case/**"
- ".github/workflows/web-ci.yml"
# Cancel an in-progress run if newer commits are pushed to the same ref.
concurrency:
group: web-ci-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: web
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: web/package-lock.json
- name: Install dependencies
run: npm ci
# Lint is a hard gate, and a warning fails it like an error. The cleanup's
# step 3 took the site from twelve warnings to none; one more fails here.
- name: Lint
run: npm run lint -- --max-warnings=0
# `next build` type-checks only what it bundles; scripts/ and the smoke
# suites are outside that, and a type error there used to surface as a
# crash the first time somebody ran the script.
- name: Typecheck
run: npm run typecheck
# Build is the hard gate: broken code can't reach main.
- name: Build
run: npm run build
# The smoke suites. Twenty of them existed and CI ran two; the rest ran
# when somebody remembered. `check:ci` is every suite that needs nothing
# a runner lacks (the module builder wants the Xtensa toolchain, so
# `check:module` stays local).
- name: Smoke suites
run: npm run check:ci