-
Notifications
You must be signed in to change notification settings - Fork 108
84 lines (71 loc) · 2.27 KB
/
tests.yml
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
name: Tests
on: [push, pull_request]
jobs:
tests:
strategy:
# We support Node Current, LTS, and Maintenance. See
# https://github.com/nodejs/release#release-schedule for release schedule
#
# We test all supported Node versions on Linux, and the oldest and newest
# on macOS/Windows. See
# https://github.com/actions/runner-images?tab=readme-ov-file#available-images
# for the latest available images.
matrix:
include:
# Maintenance
- node: 18
os: ubuntu-22.04
- node: 18
os: macos-13
- node: 18
os: windows-2022
# LTS
- node: 20
os: ubuntu-22.04
# Current
- node: 22
os: ubuntu-22.04
- node: 22
os: macos-13
- node: 22
os: windows-2022
# Allow all matrix configurations to complete, instead of cancelling as
# soon as one fails. Useful because we often have different kinds of
# failures depending on the OS.
fail-fast: false
# Sometimes windows is far slower than the other OSs. Give it enough
# time to complete if it's going to.
timeout-minutes: 40
runs-on: ${{ matrix.os }}
env:
WIREIT_LOGGER: 'quiet-ci'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: npm
- uses: google/wireit@setup-github-actions-caching/v2
- run: npm ci
# See https://code.visualstudio.com/api/working-with-extensions/continuous-integration#github-actions for why we need xvfb-run
- run: npm test
if: runner.os != 'Linux'
# We run tests in parallel on Linux, but not on other OSs. This is
# because the Mac and Windows runners are very flaky, and parallelism
# makes them worse.
env:
WIREIT_PARALLEL: 1
- run: xvfb-run -a npm test
if: runner.os == 'Linux'
lint-and-format:
timeout-minutes: 5
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- run: npm ci
- run: npm run lint
- run: npm run format:check