language: rust
os:
- osx
- windows
- linux
rust:
- stable
- beta
- nightly
cache: cargo
before_script:
- if [ "$TRAVIS_RUST_VERSION" == "stable" ]; then rustup component add rustfmt clippy; fi
script:
- cargo build
- cargo test --all
- if [ "$TRAVIS_RUST_VERSION" == "stable" ]; then cargo fmt --all -- --check; fi
- if [ "$TRAVIS_RUST_VERSION" == "stable" ]; then cargo clippy -- -D warnings; fi
# See https://levans.fr/rust_travis_cache.html
cache:
directories:
- /home/travis/.cargo
before_cache:
- rm -rf /home/travis/.cargo/registry