Add cross-platform CI
This commit is contained in:
parent
e68a7d244a
commit
471af82ebe
|
@ -1,20 +1,57 @@
|
||||||
strategy:
|
jobs:
|
||||||
|
- job: "Clippy"
|
||||||
|
pool:
|
||||||
|
vmImage: "ubuntu-16.04"
|
||||||
|
container: "rust:latest"
|
||||||
|
steps:
|
||||||
|
- script: rustup component add clippy
|
||||||
|
displayName: Install Clippy
|
||||||
|
- script: cargo clippy --all
|
||||||
|
displayName: Run clippy
|
||||||
|
|
||||||
|
- job: "Rustfmt"
|
||||||
|
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
|
||||||
|
|
||||||
|
- job: "Test"
|
||||||
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
stable:
|
windows-stable:
|
||||||
|
imageName: "vs2017-win2016"
|
||||||
rustup_toolchain: stable
|
rustup_toolchain: stable
|
||||||
beta:
|
mac-stable:
|
||||||
|
imageName: "macos-10.13"
|
||||||
|
rustup_toolchain: stable
|
||||||
|
linux-stable:
|
||||||
|
imageName: "ubuntu-16.04"
|
||||||
|
rustup_toolchain: stable
|
||||||
|
linux-beta:
|
||||||
|
imageName: "ubuntu-16.04"
|
||||||
rustup_toolchain: beta
|
rustup_toolchain: beta
|
||||||
nightly:
|
linux-nightly:
|
||||||
|
imageName: "ubuntu-16.04"
|
||||||
rustup_toolchain: nightly
|
rustup_toolchain: nightly
|
||||||
|
pool:
|
||||||
pool:
|
vmImage: "ubuntu-16.04"
|
||||||
vmImage: 'ubuntu-16.04'
|
steps:
|
||||||
|
|
||||||
steps:
|
|
||||||
- script: |
|
- script: |
|
||||||
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $RUSTUP_TOOLCHAIN
|
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $RUSTUP_TOOLCHAIN
|
||||||
echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin"
|
echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin"
|
||||||
displayName: Install rust
|
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
|
- script: cargo build --all
|
||||||
displayName: Cargo build
|
displayName: Cargo build
|
||||||
- script: cargo test --all
|
- script: cargo test --all
|
||||||
|
|
Loading…
Reference in New Issue