diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml new file mode 100644 index 0000000..62ff799 --- /dev/null +++ b/.azure-pipelines.yml @@ -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 \ No newline at end of file diff --git a/ci/azure-install-rust.yml b/ci/azure-install-rust.yml new file mode 100644 index 0000000..b304a14 --- /dev/null +++ b/ci/azure-install-rust.yml @@ -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 \ No newline at end of file diff --git a/ci/azure-test-all.yml b/ci/azure-test-all.yml new file mode 100644 index 0000000..e2e3f4a --- /dev/null +++ b/ci/azure-test-all.yml @@ -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