language: rust
rust:
  - 1.32.0 # minimum supported toolchain & pinned toolchain for clippy
  - stable
  - beta
  - nightly

matrix:
  allow_failures:
    - rust: nightly

branches:
  only:
    - master

env:
  global:
    - CLIPPY_RUST_VERSION=1.32.0

before_script:
  - bash -c 'if [[ "$TRAVIS_RUST_VERSION" == "$CLIPPY_RUST_VERSION" ]]; then
      rustup component add clippy;
    fi'

script:
  - cargo test
  # Running clippy on lib and tests only as bench uses features not available on stable toolchain
  - bash -c 'if [[ "$TRAVIS_RUST_VERSION" == "$CLIPPY_RUST_VERSION" ]]; then
      cargo clippy --lib --tests --all-features -- -D clippy::pedantic -D clippy::nursery;
    fi'

notifications:
  email:
    on_success: never

language: rust
rust:
  - 1.32.0 # minimum supported toolchain & pinned toolchain for clippy
  - stable
  - beta
  - nightly

matrix:
  allow_failures:
    - rust: nightly

branches:
  only:
    - master

env:
  global:
    - CLIPPY_RUST_VERSION=1.32.0

before_script:
  - bash -c 'if [[ "$TRAVIS_RUST_VERSION" == "$CLIPPY_RUST_VERSION" ]]; then
      rustup component add clippy;
    fi'
  - bash -c 'if [ "$(rustup default | grep stable)" ]; then
      rustup component add rustfmt;
    fi'

script:
  - cargo test
  - bash -c 'if [ "$(rustup default | grep stable)" ]; then
      echo "Checking code style...";
      cargo fmt -- --check;
    fi'
  - bash -c 'if [[ "$TRAVIS_RUST_VERSION" == "$CLIPPY_RUST_VERSION" ]]; then
      cargo clippy --lib --tests --all-features -- -D clippy::pedantic -D clippy::nursery;
    fi'

notifications:
  email:
    on_success: never

Check rustfmt as part of CI
Check rustfmt as part of CI
