Skip to content

Commit

Permalink
Fix uploading CodeCov coverage
Browse files Browse the repository at this point in the history
Add extra arguments to ensure that CodeCov assumes the upload comes from
a CI environment.

Signed-off-by: Ivan Valdes <ivan@vald.es>
  • Loading branch information
ivanvc committed Feb 16, 2025
1 parent 189eb92 commit 5bb5f28
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ test-coverage:

.PHONY: upload-coverage-report
upload-coverage-report: test-coverage
./scripts/codecov_upload.sh
COVERDIR=covdir ./scripts/codecov_upload.sh

.PHONY: fuzz
fuzz:
Expand Down
12 changes: 9 additions & 3 deletions scripts/codecov_upload.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
#!/usr/bin/env bash

# Script used to collect and upload test coverage (mostly by travis).
# Usage ./test_coverage_upload.sh [log_file]
# Script used to collect and upload test coverage.

set -o pipefail

# We try to upload whatever we have:
bash <(curl -s https://codecov.io/bash) -f ./covdir/all.coverprofile -cF all
bash <(curl -s https://codecov.io/bash) -f "${COVERDIR}/all.coverprofile" \
-cF all \
-C "${PULL_PULL_SHA}" \
-r "${REPO_OWNER}/${REPO_NAME}" \
-P "${PULL_NUMBER}" \
-b "${BUILD_ID}" \
-B "${PULL_BASE_REF}" \
-N "${PULL_BASE_SHA}"

0 comments on commit 5bb5f28

Please sign in to comment.