-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (58 loc) · 1.91 KB
/
ci.yml
File metadata and controls
69 lines (58 loc) · 1.91 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
name: ci
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
matrix:
runs-on: ubuntu-latest
strategy:
# Don't cancel sibling matrix jobs on a single failure — easier to see
# 'Node 20 broke, 22 and 24 are fine' at a glance.
fail-fast: false
matrix:
# engines.node: >=20 in package.json. Test the actively-supported
# LTS lines (20, 22) plus the version we ship releases on (24).
# OS matrix is intentionally NOT used here — the CLI shells out to
# OS-specific tools (xclip, wl-paste, pbcopy, PowerShell) that
# clean GitHub runners don't exercise meaningfully, so an Ubuntu/
# macOS/Windows matrix would test 'corepack enable' three times.
node: ['20', '22', '24']
name: matrix (Node ${{ matrix.node }})
steps:
- uses: actions/checkout@v4
- name: Enable corepack
run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'yarn'
- name: Install
run: yarn install --immutable
- name: Build (tsc)
run: yarn build
- name: Typecheck
run: yarn typecheck
- name: Lint
run: yarn lint
- name: Format check
run: yarn format:check
- name: Test
run: yarn test
# Aggregator job named 'build' so the existing branch-protection rule on
# master (which requires the 'build' status check) keeps working without
# us having to rewrite the rule for every matrix entry. Fails iff any
# matrix entry failed.
build:
needs: matrix
runs-on: ubuntu-latest
if: always()
steps:
- name: Check matrix result
run: |
if [ "${{ needs.matrix.result }}" != "success" ]; then
echo "::error::At least one Node-version matrix job failed"
exit 1
fi
echo "All Node versions passed"