-
Notifications
You must be signed in to change notification settings - Fork 1.1k
102 lines (82 loc) · 2.77 KB
/
Copy pathci.yml
File metadata and controls
102 lines (82 loc) · 2.77 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'yarn'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Lint
run: yarn lint
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20, 22, 24]
steps:
- uses: actions/checkout@v4
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- name: Install dependencies
run: yarn install --frozen-lockfile
# The typeCompat tsc compile is Node-version-independent; skip it on every
# non-primary matrix node so the full source type graph is compiled once,
# not three times. All other unit tests still run on every Node version.
- name: Run unit tests
env:
SKIP_TSC_TYPE_COMPAT: ${{ matrix.node-version != 20 && '1' || '' }}
run: yarn test
# The build (tsup --dts + webpack) recompiles the full type graph for
# declaration emit; that output is byte-identical across Node versions, so
# building on every matrix entry just recompiles the same type graph N times.
# Gate it to the primary Node version. Unit tests still run on all versions.
- name: Build
if: matrix.node-version == 20
run: yarn build
test-browser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'yarn'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Build
run: yarn build
- name: Run browser tests
run: yarn test:browser
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'yarn'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Run tests with coverage
run: yarn test:coverage
# NOTE: the standalone TypeScript checks (`tsc --noEmit` for source and
# `tsc -p typings` for the public .d.ts) are already run by `make lint` in the
# `lint` job above. Running them again here recompiled the full type graph a
# second time every CI run for no added coverage, so this job was removed and
# `lint` is the single owner of type-checking. Re-add a dedicated job only if
# `make lint` ever stops invoking tsc.