Skip to content

Commit 1f175c0

Browse files
committed
Fail the coverage job when the report holds no records
The gcc capture failure left build/lcov.info absent, but the Codecov and artifact steps run with if: always(), so the job still uploaded, logged "No coverage reports found" as a non-fatal warning, and published a stub artifact. A report that exists but carries no line records would pass even that much in silence. Assert at least one DA record on both legs before listing, so an empty or missing report stops the job where it is produced instead of surfacing later as a quiet gap in Codecov.
1 parent 3f9511b commit 1f175c0

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

.github/workflows/coverage.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ jobs:
9191
"*/tools/mexce_protect_lib.h" \
9292
"*/tools/mexce_protect.cpp" \
9393
-o lcov.info
94+
grep -q '^DA:' lcov.info || { echo "lcov.info holds no coverage records"; exit 1; }
9495
lcov --list lcov.info
9596
9697
# Clang/LLVM: export every instrumented executable, then keep production files.
@@ -125,6 +126,7 @@ jobs:
125126
"*/tools/mexce_protect_lib.h" \
126127
"*/tools/mexce_protect.cpp" \
127128
-o lcov.info
129+
grep -q '^DA:' lcov.info || { echo "lcov.info holds no coverage records"; exit 1; }
128130
lcov --list lcov.info
129131
130132
- name: Upload coverage to Codecov

0 commit comments

Comments
 (0)