forked from geiger-rs/cargo-geiger
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
59 lines (50 loc) · 1.62 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
strategy:
matrix:
Windows:
imageName: 'windows-latest'
macOS:
imageName: 'macOS-latest'
Linux:
imageName: 'ubuntu-latest'
pool:
vmImage: $(imageName)
steps:
# Linux and macOS.
- script: |
set -e
curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal --default-toolchain stable
export PATH=$PATH:$HOME/.cargo/bin
echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin"
displayName: "Install Rust (*nix)"
condition: not(eq(variables['Agent.OS'], 'Windows_NT'))
# Windows.
- script: |
curl -sSf -o rustup-init.exe https://win.rustup.rs
rustup-init.exe -y --profile minimal --default-toolchain stable --default-host x86_64-pc-windows-msvc
set PATH=%PATH%;%USERPROFILE%\.cargo\bin
echo "##vso[task.setvariable variable=PATH;]%PATH%;%USERPROFILE%\.cargo\bin"
displayName: "Install Rust (Windows)"
condition: eq(variables['Agent.OS'], 'Windows_NT')
# All platforms
- script: cargo build --all
displayName: Cargo build
# All platforms
- script: cargo test --all
displayName: Cargo test
# Linux
- script: |
cargo install cargo-tarpaulin --version 0.14.3
cargo tarpaulin --out Xml
displayName: Cargo tarpaulin
condition: eq(variables['Agent.OS'], 'Linux')
# Linux
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: cobertura.xml
condition: eq(variables['Agent.OS'], 'Linux')
- script: |
rm Cargo.lock
cargo build --all
displayName: Cargo build without lockfile
condition: eq(variables['Agent.OS'], 'Linux')