env:
global:
- RUST_BACKTRACE=1
- PATH=$PATH:$HOME/.cargo/bin
os:
- linux
- osx
language: rust
rust:
- stable
- nightly-2016-12-19
sudo: false
branches:
only:
- master
cache:
cargo: true
before_script:
- (which cargo-install-update && cargo install-update cargo-update) || cargo install cargo-update
- (which cargo-prune && cargo install-update cargo-prune) || cargo install cargo-prune
- if [ "${TRAVIS_RUST_VERSION}" = stable ]; then
(which rustfmt && cargo install-update rustfmt) || cargo install rustfmt;
elif [ "${TRAVIS_OS_NAME}" = linux ]; then
clippy_vers=0.0.104;
if ! cargo clippy --version | grep -q $clippy_vers; then
cargo install clippy --vers=$clippy_vers --force;
fi
fi
script:
- if [ "${TRAVIS_RUST_VERSION}" = stable ]; then
(
set -x;
cargo fmt -- --write-mode=diff &&
cargo test --release --verbose
);
elif [ "${TRAVIS_OS_NAME}" = linux ]; then
(
set -x;
cargo clippy && cargo clippy --profile test
);
fi
before_cache:
- cargo prune