sudo: false
language: rust
rust:
  - nightly
branches:
  only:
  - master
before_script:
  - |
    set -ex
    rustup --version
    rustc -Vv
    curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.5/mdbook-v0.4.5-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=$HOME/.cargo/bin
    mdbook --version
    rustup toolchain update nightly -c rust-docs
script:
  - mdbook build
  - mdbook test
  - |
    set -e
    curl -sSLo linkcheck.sh \
        https://raw.githubusercontent.com/rust-lang/rust/master/src/tools/linkchecker/linkcheck.sh
    sh linkcheck.sh --all rust-by-example
