Skip to content

Commit

Permalink
chore(ci): add azure pipelines configuration
Browse files Browse the repository at this point in the history
Add a basic azure configuration that runs tests and benchmarks
on linux, mac, and windows.

Closes #1673
  • Loading branch information
Perseus101 committed Sep 9, 2019
1 parent 144893b commit e594728
Show file tree
Hide file tree
Showing 3 changed files with 118 additions and 0 deletions.
49 changes: 49 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
trigger: ["master"]
pr: ["master"]

variables:
features: ''
bench: 'false'

strategy:
matrix:
windows-nightly:
imageName: 'vs2017-win2016'
rust: nightly
mac-nightly:
imageName: 'macos-10.13'
rust: nightly
bench: 'true'
# linux-stable:
# imageName: 'ubuntu-16.04'
# rust: stable
# features: '--no-default-features --features runtime,__internal_happy_eyeballs_tests'
# linux-stable-no-features:
# imageName: 'ubuntu-16.04'
# rust: stable
# features: '--no-default-features'
# linux-beta:
# imageName: 'ubuntu-16.04'
# rust: beta
# features: '--no-default-features --features runtime,__internal_happy_eyeballs_tests'
linux-nightly:
imageName: 'ubuntu-16.04'
rust: nightly
features: '--no-default-features --features runtime,nightly'
bench: 'true'
# linux-minimum-supported-version:
# imageName: 'ubuntu-16.04'
# rust: stable
# features: '--no-default-features --features runtime'

pool:
vmImage: $(imageName)

steps:
- template: ci/azure-install-rust.yml
parameters:
rust_version: $(rust)
- template: ci/azure-test.yml
parameters:
features: $(features)
bench: $(bench)
33 changes: 33 additions & 0 deletions ci/azure-install-rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
steps:
# Linux and macOS.
- script: |
set -e
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none
export PATH=$PATH:$HOME/.cargo/bin
rustup toolchain install $RUSTUP_TOOLCHAIN
rustup default $RUSTUP_TOOLCHAIN
echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin"
env:
RUSTUP_TOOLCHAIN: ${{parameters.rust_version}}
displayName: "Install rust (*nix)"
condition: ne( variables['Agent.OS'], 'Windows_NT' )
# Windows.
- script: |
curl -sSf -o rustup-init.exe https://win.rustup.rs
rustup-init.exe -y --default-toolchain none
set PATH=%PATH%;%USERPROFILE%\.cargo\bin
rustup toolchain install %RUSTUP_TOOLCHAIN%
rustup default %RUSTUP_TOOLCHAIN%
echo "##vso[task.setvariable variable=PATH;]%PATH%;%USERPROFILE%\.cargo\bin"
env:
RUSTUP_TOOLCHAIN: ${{parameters.rust_version}}
displayName: "Install rust (Windows)"
condition: eq( variables['Agent.OS'], 'Windows_NT' )
# All platforms.
- script: |
rustup toolchain list
rustc -Vv
cargo -V
displayName: Query rust and cargo versions
36 changes: 36 additions & 0 deletions ci/azure-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
steps:
# Linux and macOS.
- script: |
set -e
cargo build $FEATURES
cargo test $FEATURES
env:
FEATURES: ${{parameters.features}}
displayName: "Build & Test (*nix)"
condition: ne( variables['Agent.OS'], 'Windows_NT' )
# Windows.
- script: |
cargo build %FEATURES%
cargo test %FEATURES%
env:
FEATURES: ${{parameters.features}}
displayName: "Build & Test (Windows)"
condition: eq( variables['Agent.OS'], 'Windows_NT' )
# Linux and macOS.
- ${{ if eq(parameters.bench, 'true') }}:
- script: cargo bench $FEATURES
env:
FEATURES: ${{parameters.features}}
displayName: "Benchmark (*nix)"
condition: ne( variables['Agent.OS'], 'Windows_NT' )

# Windows.
- ${{ if eq(parameters.bench, 'true') }}:
- script: cargo bench %FEATURES%
env:
FEATURES: ${{parameters.features}}
displayName: "Benchmark (Windows)"
condition: eq( variables['Agent.OS'], 'Windows_NT' )

0 comments on commit e594728

Please sign in to comment.