language: rust
rust:
- stable
- beta
cache: cargo
before_script:
- rustup component add rustfmt
- rustup component add clippy
script:
- cargo fetch
- cargo fmt --all -- --check
- cargo clippy --all-targets --all-features -- -D warnings
- cargo test --all-features
jobs:
include:
- stage: docs
if: branch = master
rust: stable
script:
- cargo doc --all-features
deploy:
provider: pages
github-token: $GITHUB_TOKEN
committer-from-gh: true
local-dir: "target/doc"
keep-history: true
skip_cleanup: true
branches:
only:
- master