Add azure-pipelines config
This commit is contained in:
parent
f144a4ff6a
commit
dd2810e855
3 changed files with 99 additions and 0 deletions
47
.azure-pipelines.yml
Normal file
47
.azure-pipelines.yml
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
trigger:
|
||||||
|
- master
|
||||||
|
|
||||||
|
pr:
|
||||||
|
branches:
|
||||||
|
include:
|
||||||
|
- master
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
- job: Windows
|
||||||
|
pool:
|
||||||
|
vmImage: vs2017-win2016
|
||||||
|
steps:
|
||||||
|
- template: ci/azure-install-rust.yml
|
||||||
|
- template: ci/azure-test-all.yml
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
stable:
|
||||||
|
TOOLCHAIN: stable
|
||||||
|
nightly:
|
||||||
|
TOOLCHAIN: nightly
|
||||||
|
|
||||||
|
- job: Linux
|
||||||
|
pool:
|
||||||
|
vmImage: ubuntu-16.04
|
||||||
|
steps:
|
||||||
|
- template: ci/azure-install-rust.yml
|
||||||
|
- template: ci/azure-test-all.yml
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
stable:
|
||||||
|
TOOLCHAIN: stable
|
||||||
|
nightly:
|
||||||
|
TOOLCHAIN: nightly
|
||||||
|
|
||||||
|
- job: MacOS
|
||||||
|
pool:
|
||||||
|
vmImage: macOS-10.14
|
||||||
|
steps:
|
||||||
|
- template: ci/azure-install-rust.yml
|
||||||
|
- template: ci/azure-test-all.yml
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
stable:
|
||||||
|
TOOLCHAIN: stable
|
||||||
|
nightly:
|
||||||
|
TOOLCHAIN: nightly
|
33
ci/azure-install-rust.yml
Normal file
33
ci/azure-install-rust.yml
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
steps:
|
||||||
|
- bash: |
|
||||||
|
set -e -x
|
||||||
|
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $TOOLCHAIN
|
||||||
|
source $HOME/.cargo/env
|
||||||
|
echo "##vso[task.prependpath]$HOME/.cargo/bin"
|
||||||
|
rustup --version
|
||||||
|
displayName: Install rustup
|
||||||
|
condition: eq(variables['Agent.OS'], 'Darwin')
|
||||||
|
# - script: |
|
||||||
|
# echo %TOOLCHAIN%
|
||||||
|
# curl -sSf -o rustup-init.exe https://win.rustup.rs
|
||||||
|
# rustup-init.exe -v -y --default-toolchain %TOOLCHAIN%
|
||||||
|
# echo ##vso[task.prependpath]%USERPROFILE%\.cargo\bin
|
||||||
|
# rustup default %TOOLCHAIN%
|
||||||
|
# rustup component add rustfmt
|
||||||
|
# displayName: Install rust (windows)
|
||||||
|
# condition: eq(variables['Agent.OS'], 'Windows_NT')
|
||||||
|
- bash: |
|
||||||
|
set -x
|
||||||
|
rustup --version
|
||||||
|
rustup component remove --toolchain $TOOLCHAIN rust-docs || true
|
||||||
|
rustup default $TOOLCHAIN
|
||||||
|
rustup update --no-self-update $TOOLCHAIN
|
||||||
|
rustup toolchain install stable
|
||||||
|
rustup component add rustfmt --toolchain stable
|
||||||
|
displayName: Configure rust
|
||||||
|
- bash: |
|
||||||
|
set -x
|
||||||
|
rustc -Vv
|
||||||
|
cargo -Vv
|
||||||
|
cargo +stable fmt --version
|
||||||
|
displayName: Query rustc, cargo, and rustfmt versions
|
19
ci/azure-test-all.yml
Normal file
19
ci/azure-test-all.yml
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
steps:
|
||||||
|
- bash: |
|
||||||
|
set -e -x
|
||||||
|
cargo +stable fmt --all -- --check
|
||||||
|
displayName: Check formatting
|
||||||
|
- bash: |
|
||||||
|
set -e -x
|
||||||
|
cargo test --no-run
|
||||||
|
displayName: Build everything
|
||||||
|
env:
|
||||||
|
RUST_BACKTRACE: 1
|
||||||
|
CARGO_INCREMENTAL: 0
|
||||||
|
- bash: |
|
||||||
|
set -e -x
|
||||||
|
cargo test
|
||||||
|
displayName: Run unit tests
|
||||||
|
env:
|
||||||
|
RUST_BACKTRACE: 1
|
||||||
|
CARGO_INCREMENTAL: 0
|
Loading…
Add table
Add a link
Reference in a new issue