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