solana/ci/test-nightly.sh

42 lines
721 B
Bash
Raw Normal View History

2018-05-21 23:02:54 -07:00
#!/bin/bash -e
2018-05-27 18:19:07 -07:00
cd "$(dirname "$0")/.."
2018-05-21 23:02:54 -07:00
2018-08-06 08:57:12 -07:00
ci/version-check.sh nightly
2018-06-24 21:24:08 -07:00
export RUST_BACKTRACE=1
2018-05-22 16:57:14 -07:00
2018-06-24 21:24:08 -07:00
_() {
echo "--- $*"
"$@"
}
_ cargo build --verbose --features unstable
_ cargo test --verbose --features=unstable
2018-09-04 15:34:21 -07:00
2018-09-01 17:05:12 -07:00
maybe_cargo_install() {
for cmd in "$@"; do
set +e
cargo "$cmd" --help > /dev/null 2>&1
declare exitcode=$?
set -e
if [[ $exitcode -eq 101 ]]; then
_ cargo install cargo-"$cmd"
fi
done
}
2018-06-24 21:24:08 -07:00
2018-09-01 17:05:12 -07:00
maybe_cargo_install cov
_ cargo cov clean
_ cargo cov test --lib
2018-09-28 12:42:41 -07:00
_ cargo cov report
2018-09-01 17:05:12 -07:00
2018-09-28 12:42:41 -07:00
echo --- Coverage report:
ls -l target/cov/report/index.html
if [[ -z "$CODECOV_TOKEN" ]]; then
echo CODECOV_TOKEN undefined
else
bash <(curl -s https://codecov.io/bash) -x 'llvm-cov-7 gcov'
2018-09-28 12:42:41 -07:00
fi