language: rust
sudo: false
env:
global:
- RUST_VERSION="stable"
- RUST_VERSION_MIN="1.37.0"
matrix:
include:
- rust: stable
env:
- NAME="stable"
- FEATURES=''
- rust: stable
env:
- NAME="stable,clippy"
- FEATURES=''
- CLIPPY=yes
- rust: stable
env:
- NAME="stable,fmt"
- FEATURES=''
- RUSTFMT=yes
- rust: stable
env:
- NAME="rust-${RUST_VERSION_MIN}"
- RUST_VERSION="${RUST_VERSION_MIN}"
- FEATURES=''
- rust: nightly
env:
- NAME="nightly"
- RUST_VERSION="nightly"
- FEATURES=''
before_script:
- rustup default "${RUST_VERSION}"
- rustc --version
- ([ "$CLIPPY" != yes ] || rustup component add clippy)
- ([ "$RUSTFMT" != yes ] || rustup component add rustfmt)
script:
- ([ "$CLIPPY" != yes ] || cargo clippy --features "$FEATURES" --all-targets -- -D clippy::all)
- ([ "$RUSTFMT" != yes ] || cargo fmt --all -- --check)
- |
cargo build --verbose --features "$FEATURES" &&
cargo test --verbose --features "$FEATURES" &&
([ "$BENCH" != 1 ] || cargo bench --verbose --features "$FEATURES")