1
1
name : ci
2
2
3
3
on :
4
- - pull_request
5
- - push
4
+ push :
5
+ branches :
6
+ - master
7
+ paths-ignore :
8
+ - ' *.md'
9
+ pull_request :
10
+ paths-ignore :
11
+ - ' *.md'
12
+
13
+ # Cancel in progress workflows
14
+ # in the scenario where we already had a run going for that PR/branch/tag but then triggered a new run
15
+ concurrency :
16
+ group : " ${{ github.workflow }} ✨ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
17
+ cancel-in-progress : true
6
18
7
19
jobs :
20
+ lint :
21
+ name : Lint
22
+ runs-on : ubuntu-latest
23
+ steps :
24
+ - uses : actions/checkout@v4
25
+ - name : Setup Node.js
26
+ uses : actions/setup-node@v4
27
+ with :
28
+ node-version : ' lts/*'
29
+
30
+ - name : Install dependencies
31
+ run : npm install --ignore-scripts --only=dev
32
+
33
+ - name : Run lint
34
+ run : npm run lint
35
+
8
36
test :
9
- runs-on : ubuntu-20.04
10
37
strategy :
38
+ fail-fast : false
11
39
matrix :
40
+ os : [ubuntu-latest, windows-latest]
12
41
name :
13
42
- Node.js 0.8
14
43
- Node.js 0.10
35
64
- Node.js 20.x
36
65
- Node.js 21.x
37
66
- Node.js 22.x
67
+ - Node.js 23.x
38
68
39
69
include :
40
70
- name : Node.js 0.8
@@ -107,51 +137,48 @@ jobs:
107
137
npm-i : supertest@6.1.3
108
138
109
139
- name : Node.js 15.x
110
- node-version : " 15.14 "
140
+ node-version : " 15"
111
141
npm-i : supertest@6.1.3
112
142
113
143
- name : Node.js 16.x
114
- node-version : " 16.20 "
144
+ node-version : " 16"
115
145
npm-i : supertest@6.1.3
116
146
117
147
- name : Node.js 17.x
118
- node-version : " 17.9 "
148
+ node-version : " 17"
119
149
npm-i : supertest@6.1.3
120
150
121
151
- name : Node.js 18.x
122
- node-version : " 18.18 "
152
+ node-version : " 18"
123
153
124
154
- name : Node.js 19.x
125
- node-version : " 19.9 "
155
+ node-version : " 19"
126
156
127
157
- name : Node.js 20.x
128
- node-version : " 20.9 "
158
+ node-version : " 20"
129
159
130
160
- name : Node.js 21.x
131
- node-version : " 21.1 "
161
+ node-version : " 21"
132
162
133
163
- name : Node.js 22.x
134
- node-version : " 22.0 "
164
+ node-version : " 22"
135
165
166
+ - name : Node.js 23.x
167
+ node-version : " 23"
168
+ runs-on : ${{ matrix.os }}
136
169
steps :
137
170
- uses : actions/checkout@v4
171
+ with :
172
+ persist-credentials : false
138
173
139
- - name : Install Node.js ${{ matrix.node-version }}
140
- shell : bash -eo pipefail -l {0}
141
- run : |
142
- nvm install --default ${{ matrix.node-version }}
143
- if [[ "${{ matrix.node-version }}" == 0.* && "$(cut -d. -f2 <<< "${{ matrix.node-version }}")" -lt 10 ]]; then
144
- nvm install --alias=npm 0.10
145
- nvm use ${{ matrix.node-version }}
146
- if [[ "$(npm -v)" == 1.1.* ]]; then
147
- nvm exec npm npm install -g npm@1.1
148
- ln -fs "$(which npm)" "$(dirname "$(nvm which npm)")/npm"
149
- else
150
- sed -i '1s;^.*$;'"$(printf '#!%q' "$(nvm which npm)")"';' "$(readlink -f "$(which npm)")"
151
- fi
152
- npm config set strict-ssl false
153
- fi
154
- dirname "$(nvm which ${{ matrix.node-version }})" >> "$GITHUB_PATH"
174
+ - name : Setup Node.js ${{ matrix.node-version }}
175
+ uses : actions/setup-node@v4
176
+ with :
177
+ node-version : ${{ matrix.node-version }}
178
+
179
+ - name : Npm version fixes
180
+ if : ${{matrix.npm-version != ''}}
181
+ run : npm install -g ${{ matrix.npm-version }}
155
182
156
183
- name : Configure npm
157
184
run : |
@@ -202,24 +229,39 @@ jobs:
202
229
npm test
203
230
fi
204
231
205
- - name : Lint code
206
- if : steps.list_env.outputs.eslint != ''
207
- run : npm run lint
208
-
209
- - name : Collect code coverage
210
- uses : coverallsapp/github-action@master
232
+ - name : Upload code coverage
211
233
if : steps.list_env.outputs.nyc != ''
234
+ uses : actions/upload-artifact@v4
212
235
with :
213
- github-token : ${{ secrets.GITHUB_TOKEN }}
214
- flag-name : run-${{ matrix.test_number }}
215
- parallel : true
236
+ name : coverage-node- ${{ matrix.node-version }}
237
+ path : ./coverage/lcov.info
238
+ retention-days : 1
216
239
217
240
coverage :
218
241
needs : test
219
242
runs-on : ubuntu-latest
243
+ permissions :
244
+ contents : read
245
+ checks : write
220
246
steps :
221
- - name : Upload code coverage
222
- uses : coverallsapp/github-action@master
247
+ - uses : actions/checkout@v4
248
+
249
+ - name : Install lcov
250
+ shell : bash
251
+ run : sudo apt-get -y install lcov
252
+
253
+ - name : Collect coverage reports
254
+ uses : actions/download-artifact@v4
255
+ with :
256
+ path : ./coverage
257
+ pattern : coverage-node-*
258
+
259
+ - name : Merge coverage reports
260
+ shell : bash
261
+ run : find ./coverage -name lcov.info -exec printf '-a %q\n' {} \; | xargs lcov -o ./lcov.info
262
+
263
+ - name : Upload coverage report
264
+ uses : coverallsapp/github-action@v2
223
265
with :
224
266
github-token : ${{ secrets.GITHUB_TOKEN }}
225
- parallel-finished : true
267
+ file : ./lcov.info
0 commit comments