Add cross-platform CI

This commit is contained in:
Matan Kushner 2019-04-03 23:33:19 -04:00
parent e68a7d244a
commit 471af82ebe
1 changed files with 56 additions and 19 deletions

View File

@ -1,21 +1,58 @@
strategy: jobs:
matrix: - job: "Clippy"
stable: pool:
rustup_toolchain: stable vmImage: "ubuntu-16.04"
beta: container: "rust:latest"
rustup_toolchain: beta steps:
nightly: - script: rustup component add clippy
rustup_toolchain: nightly displayName: Install Clippy
- script: cargo clippy --all
displayName: Run clippy
pool: - job: "Rustfmt"
vmImage: 'ubuntu-16.04' pool:
vmImage: "ubuntu-16.04"
container: "rust:latest"
condition: eq(variables['Build.Reason'], 'PullRequest')
steps:
- script: rustup component add rustfmt
displayName: Install Rustfmt
- script: cargo fmt --all -- --check
displayName: Run Rustfmt
steps: - job: "Test"
- script: | strategy:
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $RUSTUP_TOOLCHAIN matrix:
echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin" windows-stable:
displayName: Install rust imageName: "vs2017-win2016"
- script: cargo build --all rustup_toolchain: stable
displayName: Cargo build mac-stable:
- script: cargo test --all imageName: "macos-10.13"
displayName: Cargo test rustup_toolchain: stable
linux-stable:
imageName: "ubuntu-16.04"
rustup_toolchain: stable
linux-beta:
imageName: "ubuntu-16.04"
rustup_toolchain: beta
linux-nightly:
imageName: "ubuntu-16.04"
rustup_toolchain: nightly
pool:
vmImage: "ubuntu-16.04"
steps:
- 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
condition: ne( variables['Agent.OS'], 'Windows_NT' )
- script: |
curl -sSf -o rustup-init.exe https://win.rustup.rs
rustup-init.exe -y --default-toolchain %RUSTUP_TOOLCHAIN%
echo "##vso[task.setvariable variable=PATH;]%PATH%;%USERPROFILE%\.cargo\bin"
displayName: Windows install rust
condition: eq( variables['Agent.OS'], 'Windows_NT' )
- script: cargo build --all
displayName: Cargo build
- script: cargo test --all
displayName: Cargo test