Repository navigation
73 lines (57 loc) · 1.72 KB
/
Copy pathunit-tests.yml
File metadata and controls
73 lines (57 loc) · 1.72 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
name: Unit Tests
on:
push:
branches:
- main
pull_request:
branches:
- main
# Supersede a PR's in-flight run rather than let it hold a runner for a verdict
# nobody wants. A push to main keeps its run: that is the commit's only record.
concurrency:
group: unit-tests-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
unit-tests:
name: Unit tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Set up Node.js
uses: actions/setup-node@v7
with:
node-version: "20"
cache: npm
- name: Install dependencies
run: npm ci
- name: Fix rollup native bindings
run: npm install @rollup/rollup-linux-x64-gnu --no-save
- name: Build workspace dependencies
run: npm run build
- name: Run tests
run: npm test --workspaces --if-present
- name: Test root scripts
run: npm run test:scripts
# Typechecking needs the same install and build as the tests but none of their
# output, so running it alongside them takes its ~60s off the critical path
# rather than adding to it.
typecheck:
name: Typecheck
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Set up Node.js
uses: actions/setup-node@v7
with:
node-version: "20"
cache: npm
- name: Install dependencies
run: npm ci
- name: Build workspace dependencies
run: npm run build
- name: Typecheck tests
run: npm run typecheck:tests --workspaces --if-present
- name: Typecheck scripts
run: npm run typecheck:scripts