dist: trusty
language: rust
sudo: required
cache: cargo
rust:
- stable
- beta
- nightly
os:
- linux
env:
global:
- CRATE_NAME=ratelimit_meter
- DEPLOY_VERSION=stable
- RUN_CLIPPY=false
- RUN_RUSTFMT=false
matrix:
fast_finish: true include:
- rust: stable
env: RUN_RUSTFMT=true
- rust: nightly
env: RUN_CLIPPY=true
allow_failures:
- rust: nightly
env: RUN_CLIPPY=true
before_script:
- bash -c 'if [[ "$RUN_RUSTFMT" == "true" ]]; then
rustup component add rustfmt-preview
;
fi'
- bash -c 'if [[ "$RUN_CLIPPY" == "true" ]]; then
rm -f ~/.cargo/bin/clippy;
cargo install clippy --force
;
fi'
script:
- cargo test
- bash -c 'if [[ "$RUN_RUSTFMT" == "true" ]]; then
cargo fmt -v -- --write-mode diff
;
fi'
- bash -c 'if [[ "$TRAVIS_RUST_VERSION" == "nightly" ]]; then
cargo bench
;
fi'
- bash -c 'if [[ "$RUN_CLIPPY" == "true" ]]; then
cargo clippy -- -D warnings
;
fi'
branches:
only:
- /^v\d+\.\d+\.\d+.*$/
- master
notifications:
email:
on_success: never