11name : ci
22
33on :
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
621
722jobs :
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+
839 test :
940 runs-on : ubuntu-latest
1041 strategy :
@@ -195,24 +226,39 @@ jobs:
195226 npm test
196227 fi
197228
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
204230 if : steps.list_env.outputs.nyc != ''
231+ uses : actions/upload-artifact@v4
205232 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
209236
210237 coverage :
211238 needs : test
212239 runs-on : ubuntu-latest
240+ permissions :
241+ contents : read
242+ checks : write
213243 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
216252 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