juniper/azure-pipelines.yml
Christoph Herzog ca7f9aa253 (ci) CI integration for book
* Test book code examples in separate job
* In master branch, build + push book to gh-pages branch
2019-03-08 12:00:43 +01:00

57 lines
1.5 KiB
YAML

jobs:
- job: check_formatting
displayName: Check formatting
pool:
vmImage: ubuntu-16.04
steps:
- script: |
curl https://sh.rustup.rs -sSf | sh -s -- -y
$HOME/.cargo/bin/rustup component add rustfmt
displayName: Install stable Rust
- script: |
$HOME/.cargo/bin/cargo fmt -- --check
displayName: Run rustfmt
- job: run_book_tests
displayName: Book code example tests
pool:
vmImage: ubuntu-16.04
steps:
- script: |
curl https://sh.rustup.rs -sSf | sh -s -- -y
$HOME/.cargo/bin/rustup component add rustfmt
displayName: Install stable Rust
- script: |
cd docs/book/tests && $HOME/.cargo/bin/cargo test
displayName: Test book code examples via skeptic
- job: build_book_master
displayName: Build rendered book on master branch and push to Github
dependsOn: run_book_tests
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
variables:
- group: github-keys
steps:
- task: InstallSSHKey@0
inputs:
hostName: $(secret.GHSshKnownHosts)
sshPublicKey: $(secret.GHSshPub)
sshKeySecureFile: $(secret.GHSshPriv)
- script: |
./docs/book/build.sh master
- template: _build/azure-pipelines-template.yml
parameters:
name: Linux
vmImage: ubuntu-16.04
- template: _build/azure-pipelines-template.yml
parameters:
name: macOS
vmImage: macOS-10.13
- template: _build/azure-pipelines-template.yml
parameters:
name: Windows
vmImage: vs2017-win2016