113 lines (91 loc) · 2.64 KB
/
test.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: Test
on:
pull_request:
paths:
- "**/*.js"
- "**/*.ts"
- "**/package-lock.json"
- "**/package.json"
- "**/tsconfig.json"
- "!docs/**"
push:
branches:
- main
paths-ignore:
- "docs/**"
jobs:
test-node-versions:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version:
# List of supported node versions (latest is tested in `test-os`)
- 12.x
- 14.x
- 16.x
- 17.x
os:
- ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3.0.0
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
cache-dependency-path: |
package-lock.json
packages/*/package-lock.json
integration-tests/package-lock.json
- run: npm i -g npm@8
- run: npm -v
- name: Restore CSpell cache
uses: actions/cache@v3
with:
key: cspell-cache-${{ runner.os }}-test-${{ hashFiles('**/*.ts', '**/*.md') }}
path: |
.cspell/.cspellcache
restore-keys: |
cspell-cache-${{ runner.os }}-test-
cspell-cache-${{ runner.os }}-
- run: npm ci
- run: npm run build
- run: npm test
- name: verify trace command
run: npm run test-bin-trace
- name: verify the spell checker runs
run: npm run test-bin-spell
- name: verify the check command
run: npm run test-bin-check
# Ensure the repository is clean after build & test
- run: git --no-pager diff --compact-summary --exit-code
test-os:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version:
# Test the latest node version here, move older versions to `test-old-node-versions`
- 16.x
os:
- windows-latest
- macos-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3.0.0
with:
node-version: ${{ matrix.node-version }}
cache: npm
- run: npm i -g npm@8
- run: npm -v
- run: npm ci
- run: npm run build
- run: npm test
- name: verify trace command
run: npm run test-bin-trace
- name: verify the spell checker runs
run: npm run test-bin-spell
- name: verify the check command
run: npm run test-bin-check
# Ensure the repository is clean after build & test
- run: git --no-pager diff --compact-summary --exit-code