os:
- "linux"
dist: "xenial"
language: rust
sudo: required
cache: cargo
rust:
- stable
- beta
- nightly
env:
global:
- RUN_TEST=true
- RUN_CLIPPY=false
- RUN_BENCH=false
matrix:
fast_finish: true
include:
- &rustfmt_build
rust: "stable"
env:
- RUN_RUSTFMT=true
- RUN_TEST=false
- &bench_build
rust: "stable"
env:
- RUN_BENCH=true
- RUN_TEST=false
- &clippy_build
rust: "nightly"
env:
- RUN_CLIPPY=true
- RUN_TEST=false
allow_failures: []
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;
rustup component add clippy-preview
;
fi'
script:
- bash -c 'if [[ "$RUN_TEST" == "true" ]]; then
cargo test
;
fi'
- bash -c 'if [[ "$RUN_RUSTFMT" == "true" ]]; then
cargo fmt -v -- --check
;
fi'
- bash -c 'if [[ "$RUN_BENCH" == "true" ]]; 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