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

matrix:
  include:
  - name: "rust-fmt"
    rust: 1.41.0
    install:
      - rustup component add rustfmt-preview
    script:
      - cargo fmt -- --check
  - name: "rust-clippy"
    rust: 1.41.0
    install:
      - rustup component add clippy-preview
    script:
      - cargo clippy --all-features -- -D clippy::all
  - name: "rust-warn"
    env: RUSTFLAGS="-D warnings"
    rust: stable
    script:
      - cargo check --tests
  - name: 'Rust: code coverage'
    rust: stable
    os: linux
    before_script:
    - cargo install cargo-tarpaulin
    script:
    - cargo tarpaulin --verbose --ciserver travis-ci --coveralls $TRAVIS_JOB_ID

jobs:
  allow_failures:
    - rust: nightly
    - name: "rust-warn"

script:
  - cargo build --all
  - cargo test --all-features --workspace
  - cd papergrid && cargo test --all-features 

