Skip to content

Commit

Permalink
Correctly integrate buildkite with codecov (#7718) (#7726)
Browse files Browse the repository at this point in the history
automerge
  • Loading branch information
mergify[bot] authored and solana-grimes committed Jan 9, 2020
1 parent c16356e commit 95f9862
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
12 changes: 9 additions & 3 deletions ci/docker-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,19 +72,25 @@ ARGS+=(
--env CI_JOB_ID
--env CI_PULL_REQUEST
--env CI_REPO_SLUG
--env CODECOV_TOKEN
--env CRATES_IO_TOKEN
)

# Also propagate environment variables needed for codecov
# https://docs.codecov.io/docs/testing-with-docker#section-codecov-inside-docker
# We normalize CI to `1`; but codecov expects it to be `true` to detect Buildkite...
CODECOV_ENVS=$(CI=true bash <(curl -s https://codecov.io/env))

if $INTERACTIVE; then
if [[ -n $1 ]]; then
echo
echo "Note: '$*' ignored due to --shell argument"
echo
fi
set -x
exec docker run --interactive --tty "${ARGS[@]}" "$IMAGE" bash
# shellcheck disable=SC2086
exec docker run --interactive --tty "${ARGS[@]}" $CODECOV_ENVS "$IMAGE" bash
fi

set -x
exec docker run "${ARGS[@]}" "$IMAGE" "$@"
# shellcheck disable=SC2086
exec docker run "${ARGS[@]}" $CODECOV_ENVS "$IMAGE" "$@"
3 changes: 2 additions & 1 deletion ci/test-coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ if [[ -z "$CODECOV_TOKEN" ]]; then
echo "^^^ +++"
echo CODECOV_TOKEN undefined, codecov.io upload skipped
else
bash <(curl -s https://codecov.io/bash) -X gcov -f target/cov/lcov.info
# We normalize CI to `1`; but codecov expects it to be `true` to detect Buildkite...
CI=true bash <(curl -s https://codecov.io/bash) -X gcov -f target/cov/lcov.info

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

0 comments on commit 95f9862

Please sign in to comment.