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,32 +137,35 @@ 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
138
171
@@ -202,24 +235,39 @@ jobs:
202
235
npm test
203
236
fi
204
237
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
238
+ - name : Upload code coverage
211
239
if : steps.list_env.outputs.nyc != ''
240
+ uses : actions/upload-artifact@v4
212
241
with :
213
- github-token : ${{ secrets.GITHUB_TOKEN }}
214
- flag-name : run-${{ matrix.test_number }}
215
- parallel : true
242
+ name : coverage-node- ${{ matrix.node-version }}
243
+ path : ./coverage/lcov.info
244
+ retention-days : 1
216
245
217
246
coverage :
218
247
needs : test
219
248
runs-on : ubuntu-latest
249
+ permissions :
250
+ contents : read
251
+ checks : write
220
252
steps :
221
- - name : Upload code coverage
222
- uses : coverallsapp/github-action@master
253
+ - uses : actions/checkout@v4
254
+
255
+ - name : Install lcov
256
+ shell : bash
257
+ run : sudo apt-get -y install lcov
258
+
259
+ - name : Collect coverage reports
260
+ uses : actions/download-artifact@v4
261
+ with :
262
+ path : ./coverage
263
+ pattern : coverage-node-*
264
+
265
+ - name : Merge coverage reports
266
+ shell : bash
267
+ run : find ./coverage -name lcov.info -exec printf '-a %q\n' {} \; | xargs lcov -o ./lcov.info
268
+
269
+ - name : Upload coverage report
270
+ uses : coverallsapp/github-action@v2
223
271
with :
224
272
github-token : ${{ secrets.GITHUB_TOKEN }}
225
- parallel-finished : true
273
+ file : ./lcov.info
0 commit comments