---
language: rust
os:
  - linux
  - osx
rust:
  - nightly
  - beta
  - stable
  - 1.32.0  # pinned minimum supported toolchain

matrix:
  allow_failures:
    - rust: nightly
  include:
    - name: "Lints with stable toolchain"
      os: linux
      arch: amd64
      rust: stable
      before_script:
        - rustup component add clippy
        - rustup component add rustfmt
      script:
        - cargo fmt -- --check
        # Ideally we would run CLippy on all targets, but benchmarks depend
        # on an unstable feature and only work on nightly.
        # - cargo clippy --all-targets -- -D warnings
        - cargo clippy -- -D warnings -W clippy::match-same-arms
        - cargo clippy --tests -- -D warnings -W clippy::match-same-arms

script:
  - RUSTFLAGS="-D warnings" cargo build --verbose
  - RUSTFLAGS="-D warnings" cargo test  --verbose
  - RUSTFLAGS="-D warnings" cargo build --verbose --all-features
  - RUSTFLAGS="-D warnings" cargo test  --verbose --all-features

---
language: rust
os:
  - linux
  - osx
rust:
  - nightly
  - beta
  - stable
  - 1.32.0  # pinned minimum supported toolchain

matrix:
  allow_failures:
    - rust: nightly
  include:
    - name: "Lints with stable toolchain"
      os: linux
      arch: amd64
      rust: stable
      before_script:
        - rustup component add clippy
        - rustup component add rustfmt
      script:
        - cargo fmt -- --check
        # Ideally we would run Clippy on all targets, but benchmarks depend
        # on an unstable feature and only work on nightly.
        # - cargo clippy --all-targets -- -D warnings
        - cargo clippy -- -D warnings -W clippy::match-same-arms
        - cargo clippy --tests -- -D warnings -W clippy::match-same-arms
        # Cargo tools don't check the fuzz/ folder. Manually run the lints
        # there.
        - cd fuzz && cargo fmt -- --check && cd ..
        - cd fuzz && cargo clippy -- -D warnings -W clippy::match-same-arms && cd ..
    - name: "Build benches with nightly toolchain"
      rust: nightly
      script:
        - RUSTFLAGS="-D warnings" cargo build --benches --verbose

script:
  - RUSTFLAGS="-D warnings" cargo build --verbose
  - RUSTFLAGS="-D warnings" cargo test --verbose
  - RUSTFLAGS="-D warnings" cargo build --verbose --all-features
  - RUSTFLAGS="-D warnings" cargo test --verbose --all-features
  - cd fuzz && RUSTFLAGS="-D warnings" cargo build --verbose && cd ..

Add more checks in Travis-CI.
Add more checks in Travis-CI.
