codecov: improve coverage upload

Align running the code coverage upload with other workflows by
executing it from a Makefile target.

Update the current GitHub workflow to call this new target.

Signed-off-by: Ivan Valdes <ivan@vald.es>
This commit is contained in:
Ivan Valdes 2025-02-07 14:19:16 -08:00
parent 9de211ddf8
commit 6c866548dc
No known key found for this signature in database
GPG Key ID: 4037D37741ED0CC5
3 changed files with 10 additions and 11 deletions

View File

@ -25,7 +25,7 @@ jobs:
mkdir "${TARGET}"
case "${TARGET}" in
linux-amd64-coverage)
GOARCH=amd64 ./scripts/codecov_upload.sh
GOARCH=amd64 make upload-coverage-report
;;
*)
echo "Failed to find target"

View File

@ -58,6 +58,14 @@ test-e2e-release: build
test-robustness:
PASSES="robustness" ./scripts/test.sh $(GO_TEST_FLAGS)
.PHONY: test-coverage
test-coverage:
COVERDIR=covdir PASSES="build cov" ./scripts/test.sh $(GO_TEST_FLAGS)
.PHONY: upload-coverage-report
upload-coverage-report: test-coverage
./scripts/codecov_upload.sh
.PHONY: fuzz
fuzz:
./scripts/fuzzing.sh

View File

@ -5,14 +5,5 @@
set -o pipefail
LOG_FILE=${1:-test-coverage.log}
# We collect the coverage
COVERDIR=covdir PASSES='build cov' ./scripts/test.sh 2>&1 | tee "${LOG_FILE}"
test_success="$?"
# We try to upload whatever we have:
bash <(curl -s https://codecov.io/bash) -f ./covdir/all.coverprofile -cF all || exit 2
# Expose the original status of the test coverage execution.
exit ${test_success}
bash <(curl -s https://codecov.io/bash) -f ./covdir/all.coverprofile -cF all