2018-12-17 10:11:02 -08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -e
|
|
|
|
cd "$(dirname "$0")/.."
|
|
|
|
|
|
|
|
annotate() {
|
|
|
|
${BUILDKITE:-false} && {
|
|
|
|
buildkite-agent annotate "$@"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
source ci/upload-ci-artifact.sh
|
2019-02-02 10:42:08 -08:00
|
|
|
source scripts/ulimit-n.sh
|
2018-12-17 10:11:02 -08:00
|
|
|
|
2020-06-16 09:32:16 -07:00
|
|
|
scripts/coverage.sh "$@"
|
|
|
|
|
|
|
|
if [[ -z $CI ]]; then
|
|
|
|
exit
|
|
|
|
fi
|
2018-12-17 10:11:02 -08:00
|
|
|
|
2019-06-06 12:20:47 -07:00
|
|
|
report=coverage-"${CI_COMMIT:0:9}".tar.gz
|
2018-12-17 10:11:02 -08:00
|
|
|
mv target/cov/report.tar.gz "$report"
|
|
|
|
upload-ci-artifact "$report"
|
2019-10-16 16:53:07 -07:00
|
|
|
|
2019-10-17 13:08:51 -07:00
|
|
|
gzip -f target/cov/coverage-stderr.log
|
2019-10-16 16:53:07 -07:00
|
|
|
upload-ci-artifact target/cov/coverage-stderr.log.gz
|
|
|
|
|
2018-12-17 10:11:02 -08:00
|
|
|
annotate --style success --context lcov-report \
|
|
|
|
"lcov report: <a href=\"artifact://$report\">$report</a>"
|
|
|
|
|
|
|
|
echo "--- codecov.io report"
|
|
|
|
if [[ -z "$CODECOV_TOKEN" ]]; then
|
|
|
|
echo "^^^ +++"
|
|
|
|
echo CODECOV_TOKEN undefined, codecov.io upload skipped
|
|
|
|
else
|
2020-01-09 10:39:33 -08:00
|
|
|
# We normalize CI to `1`; but codecov expects it to be `true` to detect Buildkite...
|
2020-02-13 06:23:10 -08:00
|
|
|
# Unfortunately, codecov.io fails sometimes:
|
|
|
|
# curl: (7) Failed to connect to codecov.io port 443: Connection timed out
|
|
|
|
CI=true bash <(while ! curl -sS --retry 5 --retry-delay 2 --retry-connrefused https://codecov.io/bash; do sleep 10; done) -Z -X gcov -f target/cov/lcov.info
|
2018-12-17 10:11:02 -08:00
|
|
|
|
|
|
|
annotate --style success --context codecov.io \
|
2019-06-06 12:20:47 -07:00
|
|
|
"CodeCov report: https://codecov.io/github/solana-labs/solana/commit/${CI_COMMIT:0:9}"
|
2018-12-17 10:11:02 -08:00
|
|
|
fi
|