Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added basic azure pipelines configuration #1844

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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' )