13
13
paths-ignore :
14
14
- ' *.md'
15
15
16
+ permissions :
17
+ contents : read
18
+
16
19
# Cancel in progress workflows
17
20
# in the scenario where we already had a run going for that PR/branch/tag but then triggered a new run
18
21
concurrency :
@@ -25,14 +28,13 @@ jobs:
25
28
runs-on : ubuntu-latest
26
29
steps :
27
30
- uses : actions/checkout@v4
28
- - name : Setup Node.js {{ matrix.node-version }}
31
+ - name : Setup Node.js
29
32
uses : actions/setup-node@v4
30
33
with :
31
34
node-version : ' lts/*'
32
- persist-credentials : false
33
35
34
36
- name : Install dependencies
35
- run : npm install --ignore-scripts --only =dev
37
+ run : npm install --ignore-scripts --include =dev
36
38
37
39
- name : Run lint
38
40
run : npm run lint
@@ -148,44 +150,39 @@ jobs:
148
150
149
151
- name : Run tests
150
152
shell : bash
151
- run : |
152
- npm run test-ci
153
- cp coverage/lcov.info "coverage/${{ matrix.node-version }}.lcov"
154
-
155
- - name : Collect code coverage
156
- run : |
157
- mv ./coverage "./${{ matrix.node-version }}"
158
- mkdir ./coverage
159
- mv "./${{ matrix.node-version }}" "./coverage/${{ matrix.node-version }}"
153
+ run : npm run test-ci
160
154
161
155
- name : Upload code coverage
162
- uses : actions/upload-artifact@v3
156
+ uses : actions/upload-artifact@v4
163
157
with :
164
- name : coverage
165
- path : ./coverage
158
+ name : coverage-node-${{ matrix.node-version }}-${{ matrix.os }}
159
+ path : ./coverage/lcov.info
166
160
retention-days : 1
167
161
168
162
coverage :
169
163
needs : test
170
164
runs-on : ubuntu-latest
165
+ permissions :
166
+ contents : read
167
+ checks : write
171
168
steps :
172
- - uses : actions/checkout@v4
173
-
174
- - name : Install lcov
175
- shell : bash
176
- run : sudo apt-get -y install lcov
177
-
178
- - name : Collect coverage reports
179
- uses : actions/download-artifact@v3
180
- with :
181
- name : coverage
182
- path : ./ coverage
183
-
184
- - name : Merge coverage reports
185
- shell : bash
186
- run : find ./coverage -name lcov.info -exec printf '-a %q\n' {} \; | xargs lcov -o ./coverage /lcov.info
187
-
188
- - name : Upload coverage report
189
- uses : coverallsapp/github-action@master
190
- with :
191
- github-token : ${{ secrets.GITHUB_TOKEN }}
169
+ - uses : actions/checkout@v4
170
+
171
+ - name : Install lcov
172
+ shell : bash
173
+ run : sudo apt-get -y install lcov
174
+
175
+ - name : Collect coverage reports
176
+ uses : actions/download-artifact@v4
177
+ with :
178
+ path : ./ coverage
179
+ pattern : coverage-node-*
180
+
181
+ - name : Merge coverage reports
182
+ shell : bash
183
+ run : find ./coverage -name lcov.info -exec printf '-a %q\n' {} \; | xargs lcov -o ./lcov.info
184
+
185
+ - name : Upload coverage report
186
+ uses : coverallsapp/github-action@v2
187
+ with :
188
+ file : ./lcov.info
0 commit comments