language: rust
matrix:
include:
- os: linux
dist: trusty
rust: stable
addons:
apt:
packages:
- binutils-dev
- libcurl4-openssl-dev
- libdw-dev
- libelf-dev
- libiberty-dev
- os: linux
dist: trusty
rust: nightly
allow_failures:
- rust: nightly
before_script:
- rustup install nightly
- rustup component add rustfmt-preview --toolchain nightly
- >
if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "$TRAVIS_RUST_VERSION" == "stable" ]]; then
LOCAL="~/.local" && export PATH=$LOCAL/bin:$PATH;
fi
script:
- cargo +nightly fmt --all -- --check
- cargo build
- cargo test
after_success: >
if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "$TRAVIS_RUST_VERSION" == "stable" ]]; then
wget https://github.com/SimonKagstrom/kcov/archive/v34.tar.gz &&
tar xzf v34.tar.gz &&
mkdir kcov-34/build &&
cd kcov-34/build &&
cmake -DCMAKE_INSTALL_PREFIX:PATH=$LOCAL .. &&
make &&
make install &&
cd ../.. &&
rm -rf kcov-34 &&
RUSTFLAGS='-C link-dead-code' cargo test --no-run &&
for file in target/debug/statrs-*; do
if [[ "${file: -2}" != ".d" ]]; then
mkdir -p "target/cov/$(basename $file)";
kcov --exclude-pattern=/.cargo,/usr/lib --verify "target/cov/$(basename $file)" "$file";
fi;
done &&
bash <(curl -s https://codecov.io/bash);
fi