Skip to content

Commit 984e2d7

Browse files
author
Nachoo Mangas
committed
fix: simplify coverage artifact structure
- Upload only lcov.info file instead of entire coverage directory - Remove unnecessary 'Collect code coverage' step that created nested folders - Generate merged coverage report in root (./lcov.info) to avoid conflicts - Explicitly specify coverage file for Coveralls This fixes the 'trace file does not exist' error caused by complex nested directory structure when using download-artifact@v6 with patterns. Aligns with best practices from upstream repositories.
1 parent 4f41408 commit 984e2d7

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,6 @@ jobs:
199199
run: |
200200
if npm -ps ls nyc | grep -q nyc; then
201201
npm run test-ci
202-
cp coverage/lcov.info "coverage/${{ matrix.name }}.lcov"
203202
else
204203
npm test
205204
fi
@@ -208,21 +207,12 @@ jobs:
208207
if: steps.list_env.outputs.eslint != ''
209208
run: npm run lint
210209

211-
- name: Collect code coverage
212-
if: steps.list_env.outputs.nyc != ''
213-
run: |
214-
if [[ -d ./coverage ]]; then
215-
mv ./coverage "./${{ matrix.name }}"
216-
mkdir ./coverage
217-
mv "./${{ matrix.name }}" "./coverage/${{ matrix.name }}"
218-
fi
219-
220210
- name: Upload code coverage
221211
uses: actions/upload-artifact@v4
222212
if: steps.list_env.outputs.nyc != ''
223213
with:
224214
name: coverage-${{ matrix.name }}
225-
path: ./coverage
215+
path: ./coverage/lcov.info
226216
retention-days: 1
227217

228218
coverage:
@@ -246,9 +236,10 @@ jobs:
246236

247237
- name: Merge coverage reports
248238
shell: bash
249-
run: find ./coverage -name lcov.info -exec printf '-a %q\n' {} \; | xargs lcov -o ./coverage/lcov.info
239+
run: find ./coverage -name lcov.info -exec printf '-a %q\n' {} \; | xargs lcov -o ./lcov.info
250240

251241
- name: Upload coverage report
252242
uses: coverallsapp/github-action@master
253243
with:
254244
github-token: ${{ secrets.GITHUB_TOKEN }}
245+
file: ./lcov.info

0 commit comments

Comments
 (0)