@@ -161,6 +161,7 @@ jobs:
161161 run : |
162162 if npm -ps ls nyc | grep -q nyc; then
163163 npm run test-ci
164+ cp coverage/lcov.info "coverage/${{ matrix.name }}.lcov"
164165 else
165166 npm test
166167 fi
@@ -170,19 +171,43 @@ jobs:
170171 run : npm run lint
171172
172173 - 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
174184 if : steps.list_env.outputs.nyc != ''
175185 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
179189
180190 coverage :
181191 needs : test
182192 runs-on : ubuntu-latest
183193 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
185211 uses : coverallsapp/github-action@master
186212 with :
187213 github-token : ${{ secrets.github_token }}
188- parallel-finished : true
0 commit comments