Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Commit 287995f

Browse files
authored
Correctly integrate buildkite with codecov (#7718)
* Correctly integrate buildkite with codecov * Fix shellcheck... * Really detect Buildkite
1 parent 0e506a5 commit 287995f

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

ci/docker-run.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,19 +72,25 @@ ARGS+=(
7272
--env CI_JOB_ID
7373
--env CI_PULL_REQUEST
7474
--env CI_REPO_SLUG
75-
--env CODECOV_TOKEN
7675
--env CRATES_IO_TOKEN
7776
)
7877

78+
# Also propagate environment variables needed for codecov
79+
# https://docs.codecov.io/docs/testing-with-docker#section-codecov-inside-docker
80+
# We normalize CI to `1`; but codecov expects it to be `true` to detect Buildkite...
81+
CODECOV_ENVS=$(CI=true bash <(curl -s https://codecov.io/env))
82+
7983
if $INTERACTIVE; then
8084
if [[ -n $1 ]]; then
8185
echo
8286
echo "Note: '$*' ignored due to --shell argument"
8387
echo
8488
fi
8589
set -x
86-
exec docker run --interactive --tty "${ARGS[@]}" "$IMAGE" bash
90+
# shellcheck disable=SC2086
91+
exec docker run --interactive --tty "${ARGS[@]}" $CODECOV_ENVS "$IMAGE" bash
8792
fi
8893

8994
set -x
90-
exec docker run "${ARGS[@]}" "$IMAGE" "$@"
95+
# shellcheck disable=SC2086
96+
exec docker run "${ARGS[@]}" $CODECOV_ENVS "$IMAGE" "$@"

ci/test-coverage.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ if [[ -z "$CODECOV_TOKEN" ]]; then
4141
echo "^^^ +++"
4242
echo CODECOV_TOKEN undefined, codecov.io upload skipped
4343
else
44-
bash <(curl -s https://codecov.io/bash) -X gcov -f target/cov/lcov.info
44+
# We normalize CI to `1`; but codecov expects it to be `true` to detect Buildkite...
45+
CI=true bash <(curl -s https://codecov.io/bash) -X gcov -f target/cov/lcov.info
4546

4647
annotate --style success --context codecov.io \
4748
"CodeCov report: https://codecov.io/github/solana-labs/solana/commit/${CI_COMMIT:0:9}"

0 commit comments

Comments
 (0)