language: rust

rust:
  - stable
  - beta
  - nightly
  # - 1.46.0  // does not work since cargo test is executed automatically

os:
  - linux
  - windows
  - osx

jobs:
  fast_finish: true
  allow_failures:
    - rust: nightly
    - os: windows
  include:
    - if: rust = stable
      script:
        - rustup component add rustfmt
        - cargo fmt --all -- --check

    - if: rust = stable OR rust = beta OR rust = nightly
      script:
        - cargo test --release --all-features
        - cargo test --release
        - cargo test --release --no-default-features

    - if: rust = nightly
      script:
        - cargo test --release --doc
        - cargo doc --all-features --no-deps

    - if: rust = "1.46.0"
      script:
        - cargo build --release
        - cargo build --release --no-default-features
        - cargo build --release --all-features