Skip to content

Commit e2dbaf7

Browse files
committed
Add gcovr step to generate coverage report before Codecov upload
The codecov-action@v5 does not auto-process gcov data like the old bash uploader did. This adds a step to run gcovr to convert .gcda/.gcno files to Cobertura XML format, which codecov can parse.
1 parent fcdede1 commit e2dbaf7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

.github/workflows/verify-build.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,9 +665,15 @@ jobs:
665665
sleep 5 && ab -n 1000000 -c 100 127.0.0.1:8080/plaintext
666666
if: ${{ matrix.build-type == 'threads' }}
667667

668+
- name: Generate coverage report
669+
run: |
670+
cd build
671+
gcovr --xml coverage.xml --xml-pretty
672+
if: ${{ matrix.os-type == 'ubuntu' && matrix.c-compiler == 'gcc' && matrix.debug == 'debug' && matrix.coverage == 'coverage' && success() }}
673+
668674
- name: Upload coverage to Codecov
669675
uses: codecov/codecov-action@v5
670676
with:
671-
directory: build
677+
files: build/coverage.xml
672678
fail_ci_if_error: false
673679
if: ${{ matrix.os-type == 'ubuntu' && matrix.c-compiler == 'gcc' && matrix.debug == 'debug' && matrix.coverage == 'coverage' && success() }}

0 commit comments

Comments
 (0)