-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathazure-pipelines.yml
52 lines (51 loc) · 2.09 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
trigger:
- master
pr:
- master
jobs:
- job: run_tests
displayName: Run Unit Tests
pool:
vmImage: ubuntu-20.04
steps:
- script: |
sudo apt-get update
sudo apt-get install -y libblkid-dev libattr1-dev libcurl4-openssl-dev libelf-dev libdw-dev cmake gcc binutils-dev libiberty-dev zlib1g-dev libssl-dev
displayName: Install dependencies
- script: |
sudo sh -c "curl https://sh.rustup.rs -sSf | sh -s -- -y"
sudo env PATH=${PATH} rustup install stable
- script: |
sudo apt-get update
sudo apt-get install zfsutils-linux libnvpair1linux libzfslinux-dev
displayName: Install ZFS on Linux
- script: |
dd if=/dev/zero of=loop99 bs=1M count=96
sudo losetup /dev/loop99 `pwd`/loop99
displayName: Setup loop device
- script: |
curl -LSfs https://japaric.github.io/trust/install.sh | sh -s -- --git andoriyu/cargo-suity --tag v0.3.0
sudo ln -s /home/vsts/.cargo/bin/cargo-suity /usr/local/bin/
displayName: Install suity
- script: |
sudo env PATH=${PATH} RUSTFLAGS="-C link-dead-code" cargo +stable test --no-run
mkdir test-results
sudo env PATH=${PATH} RUSTFLAGS="-C link-dead-code" cargo +stable suity
displayName: Run Tests
- script: |
sudo sh -c "zpool list -H -oname | grep test | xargs zpool destroy"
RUSTFLAGS="--cfg procmacro2_semver_exempt" cargo +stable install cargo-tarpaulin -f
sudo env PATH=${PATH} RUSTFLAGS="-C link-dead-code" cargo +stable tarpaulin --out Xml
bash <(curl -s https://codecov.io/bash)
displayName: Run Coverage
condition: and(succeeded(),eq(variables['rustup_toolchain'], 'nightly'))
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: 'Cobertura'
summaryFileLocation: $(System.DefaultWorkingDirectory)/**/cobertura.xml
condition: and(succeeded(),eq(variables['rustup_toolchain'], 'nightly'))
- task: PublishTestResults@2
inputs:
testRunner: JUnit
testResultsFiles: 'test-results/default.xml'
failTaskOnFailedTests: true