language: rust
dist: xenial

rust:
    - "1.40.0"
    - "1.41.1"
    - "1.42.0"
    - "1.43.1"
    - "1.44.1"
    - "stable"
    - "beta"
    - "nightly"

jobs:
    allow_failures:
        - rust: "nightly"
    include:
        - name: Run cargo audit
          rust: stable
          env: TASK=audit
    fast_finish: true

install:
    - cargo build --verbose
    - if [ "$TASK" = "audit" ]; then cargo install cargo-audit; fi

script:
    - if [ "$TASK" = "audit" ]; then
          cargo audit;
      else
          cargo test --verbose;
      fi