Skip to content

Commit 91f1d18

Browse files
committed
ci(coverage): fail fast if unit-test LCOV is missing before Codecov upload
Address CodeRabbit on #5966: with disable_search + plugins:noop and fail_ci_if_error:false, a missing coverage/lcov.info would silently skip upload while keeping the job green. Require a non-empty LCOV before upload so generation regressions fail the job; still upload partial coverage when unit tests fail but LCOV exists.
1 parent d1c19c7 commit 91f1d18

1 file changed

Lines changed: 13 additions & 6 deletions

File tree

.github/workflows/CI-unit-tests-asan-coverage.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -168,18 +168,25 @@ jobs:
168168
path: coverage/lcov.info
169169
if-no-files-found: warn
170170

171+
- name: Require non-empty coverage/lcov.info
172+
# With disable_search + plugins:noop, a missing/empty LCOV would
173+
# make the Codecov step a silent no-op while fail_ci_if_error:false
174+
# keeps the job green. Fail here so coverage-generation regressions
175+
# are visible; Codecov SaaS outages remain non-blocking below.
176+
id: require-lcov
177+
if: always()
178+
run: test -s coverage/lcov.info
179+
171180
- name: Upload coverage to Codecov
172181
# Send the same lcov.info we already archive as a workflow artifact
173182
# to Codecov so PRs get the "this PR changes coverage of touched
174183
# files from N% to M%" comment and main accumulates a historical
175184
# graph at https://app.codecov.io/gh/sysown/proxysql.
176185
#
177-
# `if: always()` so coverage uploads regardless of whether the unit
178-
# tests themselves passed; partial coverage is still useful for
179-
# diagnosing why a PR went red. `fail_ci_if_error: false` so a
180-
# transient Codecov outage never gates a green CI run on a
181-
# third-party SaaS.
182-
if: always()
186+
# Upload when LCOV exists even if unit tests failed (partial coverage
187+
# is still useful). Skip only when require-lcov failed. Codecov SaaS
188+
# outages stay non-blocking via fail_ci_if_error: false.
189+
if: always() && steps.require-lcov.outcome == 'success'
183190
uses: codecov/codecov-action@v4
184191
with:
185192
codecov_yml_path: codecov.yml

0 commit comments

Comments
 (0)