-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (56 loc) · 2.12 KB
/
Copy pathci.yml
File metadata and controls
60 lines (56 loc) · 2.12 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
# Type-check, test and build on every push and pull request.
#
# The publish workflow runs the same three steps, but only on a tag — which is
# far too late to learn that main is broken. This is the one that has to be
# green before a release is ever cut.
name: CI
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
jobs:
# Style and static analysis. One job, one platform, one Node version — the
# answer cannot differ across the matrix, and running it nine times would only
# cost nine times as long to tell a contributor the same thing.
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile
# `--max-warnings` is pinned in the script to the ReDoS backlog that
# existed when the linter was adopted, so the old ones survive and a new
# one fails here. See the comment in eslint.config.js.
- run: pnpm lint
- run: pnpm format:check
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# The transform layer runs server-side too (Node, no DOM), and the
# sanitizer's parser differs by platform — so all three, not just Linux.
os: [ubuntu-latest, macos-latest, windows-latest]
node-version: [18, 20, 22]
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm type-check
# Coverage rather than a plain test run: the thresholds in
# vitest.config.ts are 100% and they only fail the build when the coverage
# reporter actually runs. A rule that can delete part of somebody's email
# must not reach main with an untested branch — and the README's coverage
# badge is only honest while this step is the one that gates the merge.
- run: pnpm test:coverage
- run: pnpm build