Skip to content
This repository has been archived by the owner on Sep 13, 2023. It is now read-only.

Set up CI with Azure Pipelines #16

Merged
merged 2 commits into from
Dec 1, 2018
Merged
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-template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
jobs:
- job: ${{ parameters.name }}
pool:
vmImage: ${{ parameters.vmImage }}
strategy:
matrix:
stable:
rustup_toolchain: stable
beta:
rustup_toolchain: beta
nightly:
rustup_toolchain: nightly
steps:
# Linux and macOS.
- ${{ if ne(parameters.name, 'Windows') }}:
- script: |
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $RUSTUP_TOOLCHAIN
echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin"
displayName: Install rust
# Windows.
- ${{ if eq(parameters.name, 'Windows') }}:
- script: |
curl -sSf -o rustup-init.exe https://win.rustup.rs
rustup-init.exe -y --default-toolchain %RUSTUP_TOOLCHAIN%
set PATH=%PATH%;%USERPROFILE%\.cargo\bin
echo "##vso[task.setvariable variable=PATH;]%PATH%;%USERPROFILE%\.cargo\bin"
displayName: Install rust (windows)
# All platforms.
- script: |
rustc -Vv
cargo -V
displayName: Query rust and cargo versions
- script: cargo build
displayName: Build
# Linux and macOS w/nightly toolchain.
# Ideally we'd only run the script for the nightly toolchain, but I can't
# figure out how to determine that within the Azure Pipelines conditional.
- ${{ if ne(parameters.name, 'Windows') }}:
- script: |
if [ "$RUSTUP_TOOLCHAIN" = 'nightly' ]
then cargo test
fi
displayName: Test
# Windows w/nightly toolchain.
# Ideally we'd only run the script for the nightly toolchain, but I can't
# figure out how to determine that within the Azure Pipelines conditional.
- ${{ if eq(parameters.name, 'Windows') }}:
- script: if "%RUSTUP_TOOLCHAIN%" == "nightly" cargo test
displayName: Test
15 changes: 15 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
jobs:
- template: azure-pipelines-template.yml
parameters:
name: macOS
vmImage: macOS-10.13

- template: azure-pipelines-template.yml
parameters:
name: Linux
vmImage: ubuntu-16.04

- template: azure-pipelines-template.yml
parameters:
name: Windows
vmImage: vs2017-win2016