1
1
name : ci
2
2
3
3
on :
4
- - pull_request
5
- - push
4
+ pull_request :
5
+ branches :
6
+ - master
7
+ paths-ignore :
8
+ - ' *.md'
9
+ push :
10
+ paths-ignore :
11
+ - ' *.md'
12
+
13
+ permissions :
14
+ contents : read
15
+
16
+ # Cancel in progress workflows
17
+ # in the scenario where we already had a run going for that PR/branch/tag but then triggered a new run
18
+ concurrency :
19
+ group : " ${{ github.workflow }} ✨ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
20
+ cancel-in-progress : true
6
21
7
22
jobs :
23
+ lint :
24
+ name : Lint
25
+ runs-on : ubuntu-latest
26
+ steps :
27
+ - uses : actions/checkout@v4
28
+ - name : Setup Node.js
29
+ uses : actions/setup-node@v4
30
+ with :
31
+ node-version : ' lts/*'
32
+
33
+ - name : Install dependencies
34
+ run : npm install --ignore-scripts --only=dev
35
+
36
+ - name : Run lint
37
+ run : npm run lint
38
+
8
39
test :
9
40
runs-on : ubuntu-latest
10
41
strategy :
@@ -195,24 +226,39 @@ jobs:
195
226
npm test
196
227
fi
197
228
198
- - name : Lint code
199
- if : steps.list_env.outputs.eslint != ''
200
- run : npm run lint
201
-
202
- - name : Collect code coverage
203
- uses : coverallsapp/github-action@master
229
+ - name : Upload code coverage
204
230
if : steps.list_env.outputs.nyc != ''
231
+ uses : actions/upload-artifact@v4
205
232
with :
206
- github-token : ${{ secrets.GITHUB_TOKEN }}
207
- flag-name : run-${{ matrix.test_number }}
208
- parallel : true
233
+ name : coverage-node- ${{ matrix.node-version }}
234
+ path : ./coverage/lcov.info
235
+ retention-days : 1
209
236
210
237
coverage :
211
238
needs : test
212
239
runs-on : ubuntu-latest
240
+ permissions :
241
+ contents : read
242
+ checks : write
213
243
steps :
214
- - name : Upload code coverage
215
- uses : coverallsapp/github-action@master
244
+ - uses : actions/checkout@v4
245
+
246
+ - name : Install lcov
247
+ shell : bash
248
+ run : sudo apt-get -y install lcov
249
+
250
+ - name : Collect coverage reports
251
+ uses : actions/download-artifact@v4
216
252
with :
217
- github-token : ${{ secrets.github_token }}
218
- parallel-finished : true
253
+ path : ./coverage
254
+ pattern : coverage-node-*
255
+
256
+ - name : Merge coverage reports
257
+ shell : bash
258
+ run : find ./coverage -name lcov.info -exec printf '-a %q\n' {} \; | xargs lcov -o ./lcov.info
259
+
260
+ - name : Upload coverage report
261
+ uses : coverallsapp/github-action@v2
262
+ with :
263
+ github-token : ${{ secrets.GITHUB_TOKEN }}
264
+ file : ./lcov.info
0 commit comments