language: rust
os: linux
dist: trusty
addons:
  apt:
    packages:
      - libssl-dev

cache: cargo

rust:
  - stable
  - beta
  - nightly

env:
  - CARGO_FEATURES="std bytemuck mint rand serde debug-glam-assert transform-types"
  - CARGO_FEATURES="std bytemuck mint rand serde scalar-math debug-glam-assert transform-types"
  - CARGO_FEATURES="bytemuck mint rand serde debug-glam-assert transform-types"

jobs:
  allow_failures:
    - rust: nightly
  fast_finish: true

before_script: |
  if [[ "$TRAVIS_RUST_VERSION" == stable ]]; then
    cargo install cargo-tarpaulin
  fi

script:
  - cargo clean
  - cargo build --no-default-features --features "$CARGO_FEATURES"
  - cargo test --no-default-features --features "$CARGO_FEATURES"
  - cargo bench --no-default-features --features "$CARGO_FEATURES" --no-run

after_success: |
  if [[ "$TRAVIS_RUST_VERSION" == stable ]]; then
    cargo tarpaulin --no-default-features --features "$CARGO_FEATURES" --exclude-files src/f32/transform.rs --exclude-files benches/* --exclude-files tests/support/mod.rs --ciserver travis-ci --coveralls $TRAVIS_JOB_ID
  fi
