language: rust
cache: cargo
env: # required for allow_failures
rust:
  - stable
  - beta
  - nightly

matrix:
  fast_finish: true
  allow_failures:
    - rust: nightly

  include:

  - rust: stable
    script:
    - cargo update
    - cargo test --all --locked --verbose
    - cargo doc --verbose
    - rustup component add clippy rustfmt
    - cargo clippy --all-targets -- -D warnings
    - cargo fmt --all -- --check

  - rust: nightly
    script:
    - cargo update
    - cargo test --locked
    - rustup component add clippy rustfmt
    - cargo clippy --all-targets -- -D warnings
    - cargo fmt --all -- --check

branches:
  only:
    - master

deploy:
  provider: pages
  local-dir: target/doc
  skip-cleanup: true
  github-token: $GITHUB_TOKEN
  on:
    branch: master

language: rust
cache: cargo
env: # required for allow_failures
rust:
  - stable
  - beta
  - nightly

matrix:
  fast_finish: true
  allow_failures:
    - rust: nightly

  include:

  - rust: stable
    env: DEPLOY_GH_PAGES=true
    script:
    - cargo update
    - cargo test --all --locked --verbose
    - cargo doc --verbose
    - rustup component add clippy rustfmt
    - cargo clippy --all-targets -- -D warnings
    - cargo fmt --all -- --check

  - rust: beta
    script:
    - cargo update
    - cargo test --all --locked --verbose
    - rustup component add clippy rustfmt
    - cargo clippy --all-targets -- -D warnings
    - cargo fmt --all -- --check

  - rust: nightly
    script:
    - cargo update
    - cargo test --all --locked --verbose
    - rustup component add clippy rustfmt
    - cargo clippy --all-targets -- -D warnings
    - cargo fmt --all -- --check

branches:
  only:
    - master

deploy:
  provider: pages
  local-dir: target/doc
  skip-cleanup: true
  github-token: $GITHUB_TOKEN
  on:
    branch: master
    condition: $DEPLOY_GH_PAGES = true

Make doc push to gh-pages conditional
Make doc push to gh-pages conditional
