@@ -162,6 +162,7 @@ jobs:
162
162
run : |
163
163
if npm -ps ls nyc | grep -q nyc; then
164
164
npm run test-ci
165
+ cp coverage/lcov.info "coverage/${{ matrix.name }}.lcov"
165
166
else
166
167
npm test
167
168
fi
@@ -171,19 +172,43 @@ jobs:
171
172
run : npm run lint
172
173
173
174
- name : Collect code coverage
174
- uses : coverallsapp/github-action@master
175
+ if : steps.list_env.outputs.nyc != ''
176
+ run : |
177
+ if [[ -d ./coverage ]]; then
178
+ mv ./coverage "./${{ matrix.name }}"
179
+ mkdir ./coverage
180
+ mv "./${{ matrix.name }}" "./coverage/${{ matrix.name }}"
181
+ fi
182
+
183
+ - name : Upload code coverage
184
+ uses : actions/upload-artifact@v2
175
185
if : steps.list_env.outputs.nyc != ''
176
186
with :
177
- github-token : ${{ secrets.GITHUB_TOKEN }}
178
- flag-name : run-${{ matrix.test_number }}
179
- parallel : true
187
+ name : coverage
188
+ path : ./coverage
189
+ retention-days : 1
180
190
181
191
coverage :
182
192
needs : test
183
193
runs-on : ubuntu-latest
184
194
steps :
185
- - name : Uploade code coverage
195
+ - uses : actions/checkout@v2
196
+
197
+ - name : Install lcov
198
+ shell : bash
199
+ run : sudo apt-get -y install lcov
200
+
201
+ - name : Collect coverage reports
202
+ uses : actions/download-artifact@v2
203
+ with :
204
+ name : coverage
205
+ path : ./coverage
206
+
207
+ - name : Merge coverage reports
208
+ shell : bash
209
+ run : find ./coverage -name lcov.info -exec printf '-a %q\n' {} \; | xargs lcov -o ./coverage/lcov.info
210
+
211
+ - name : Upload coverage report
186
212
uses : coverallsapp/github-action@master
187
213
with :
188
- github-token : ${{ secrets.github_token }}
189
- parallel-finished : true
214
+ github-token : ${{ secrets.GITHUB_TOKEN }}
0 commit comments