env:
global:
- RUST_BACKTRACE=1
- PATH=$PATH:$HOME/.cargo/bin
- TEST_FEATURES="use-mock-crust use-mock-crypto"
os:
- linux
- osx
language: rust
rust:
- 1.17.0
- nightly-2017-04-28
sudo: false
cache:
cargo: true
before_script:
- curl -sSL https://github.com/maidsafe/QA/raw/master/travis/cargo_install.sh > cargo_install.sh
- bash cargo_install.sh cargo-prune;
- if [ "${TRAVIS_RUST_VERSION}" = 1.17.0 ]; then
bash cargo_install.sh rustfmt 0.8.3;
elif [ "${TRAVIS_OS_NAME}" = linux ]; then
bash cargo_install.sh clippy 0.0.128;
fi
script:
- export RUSTFLAGS="-C opt-level=2 -C codegen-units=8"
- if [ "${TRAVIS_RUST_VERSION}" = 1.17.0 ]; then
(
set -x;
cargo fmt -- --write-mode=diff &&
cargo rustc --verbose -- --test -Zno-trans &&
cargo rustc --verbose --example ci_test -- -Zno-trans &&
cargo rustc --verbose --example key_value_store -- -Zno-trans &&
cargo rustc --verbose -- -Zno-trans &&
cargo test --release --verbose --features "$TEST_FEATURES"
);
elif [ "${TRAVIS_OS_NAME}" = linux ]; then
(
set -x;
cargo clippy &&
cargo clippy --features="$TEST_FEATURES" &&
cargo clippy --profile=test &&
cargo clippy --profile=test --features="$TEST_FEATURES"
);
fi
before_cache:
- cargo prune