2020-06-07 09:14:32 -04:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -ex
|
2020-06-07 09:21:33 -04:00
|
|
|
export CARGO_OPTIONS="--all-features -p sailfish -p sailfish-compiler -p integration-tests"
|
2020-06-07 09:14:32 -04:00
|
|
|
|
|
|
|
if [ "$TRAVIS_RUST_VERSION" = "nightly" ] && [ -z "$TRAVIS_TAG" ]; then
|
|
|
|
export CARGO_INCREMENTAL=0
|
2020-06-07 09:21:33 -04:00
|
|
|
export RUSTFLAGS="-Zprofile -Ccodegen-units=1 -Clink-dead-code -Coverflow-checks=off -Copt-level=0"
|
2020-06-07 09:14:32 -04:00
|
|
|
|
|
|
|
wget https://github.com/mozilla/grcov/releases/download/v0.5.5/grcov-linux-x86_64.tar.bz2
|
|
|
|
tar xvf grcov-linux-x86_64.tar.bz2
|
|
|
|
|
2022-02-19 00:47:00 -05:00
|
|
|
wget https://github.com/rust-sailfish/rust-covfix/releases/download/v0.2.1/rust-covfix-linux-x86_64.tar.xz
|
2020-06-07 09:14:32 -04:00
|
|
|
tar xvf rust-covfix-linux-x86_64.tar.xz
|
|
|
|
mv rust-covfix-linux-x86_64/rust-covfix ./
|
|
|
|
fi
|
|
|
|
|
|
|
|
cargo build $CARGO_OPTIONS
|
2020-06-16 09:59:58 -04:00
|
|
|
|
|
|
|
if [ "$TRAVIS_RUST_VERSION" != "1.42.0" ]; then
|
|
|
|
cargo test $CARGO_OPTIONS
|
|
|
|
fi
|
2020-06-07 09:14:32 -04:00
|
|
|
|
|
|
|
if [ "$TRAVIS_RUST_VERSION" = "nightly" ] && [ -z "$TRAVIS_TAG" ]; then
|
|
|
|
zip -0 ccov.zip `find . \( -name "sailfish*.gc*" -o -name "test-*.gc*" \) -print`
|
|
|
|
./grcov ccov.zip -s . -t lcov --llvm --ignore "/*" --ignore "integration-tests/*" -o lcov.info
|
|
|
|
sed -e 's/^SF:src\//SF:sailfish\/src\//' -i lcov.info
|
|
|
|
./rust-covfix lcov.info -o lcov.info
|
|
|
|
bash <(curl -s https://codecov.io/bash) -f lcov.info
|
|
|
|
fi
|