language: rust
cache: cargo
rust:
  - stable
  - beta
  - nightly

before_cache: |
  cargo install cargo-tarpaulin

before_script:
  - rustup component add rustfmt
  - rustup component add clippy
  - cargo install cargo-audit

# As a result of https://github.com/travis-ci/travis-ci/issues/1066, we run
# everything in one large command instead of multiple commands.
# In this way, the build stops immediately if one of the commands fails.
script: |
  cargo fmt --all -- --check &&
  cargo clippy -- -D warnings &&
  cargo build &&
  RUST_LOG=debug cargo test --workspace -- --nocapture &&
  cargo audit

after_success: |
  cargo tarpaulin -v --ignore-tests --timeout 900

notifications:
  email:
    on_success: never

