-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathazure-pipelines.yml
55 lines (55 loc) · 2.06 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
trigger:
- master
pr:
- master
jobs:
- job: run_tests
displayName: Run Unit Tests
pool:
vmImage: ubuntu-20.04
strategy:
matrix:
stable:
rustup_toolchain: stable
beta:
rustup_toolchain: beta
nightly:
rustup_toolchain: nightly
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
- script: |
sudo apt-get install -y software-properties-common
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install -y libblkid-dev libattr1-dev libcurl4-openssl-dev libelf-dev libdw-dev cmake gcc-9 binutils-dev libiberty-dev zlib1g-dev libssl-dev
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 60 \
--slave /usr/bin/g++ g++ /usr/bin/g++-9
displayName: Install dependencies
- script: |
curl -LSfs https://japaric.github.io/trust/install.sh | sh -s -- --git andoriyu/cargo-suity
sudo ln -s /home/vsts/.cargo/bin/cargo-suity /usr/local/bin/
displayName: Install suity
- script: |
RUSTFLAGS="-C link-dead-code" cargo test --no-run
mkdir test-results
RUSTFLAGS="-C link-dead-code" cargo suity
displayName: Run Tests
- script: |
cargo install cargo-tarpaulin -f
RUSTFLAGS="-C link-dead-code" cargo tarpaulin --out Xml
bash <(curl -s https://codecov.io/bash)
displayName: Run Coverage
condition: and(succeeded(),eq(variables['rustup_toolchain'], 'stable'))
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: 'Cobertura'
summaryFileLocation: $(System.DefaultWorkingDirectory)/**/cobertura.xml
condition: and(succeeded(),eq(variables['rustup_toolchain'], 'stable'))
- task: PublishTestResults@2
inputs:
testRunner: JUnit
testResultsFiles: 'test-results/default.xml'
failTaskOnFailedTests: true