forked from Inner-Heaven/libzetta-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
64 lines (63 loc) · 2.24 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
60
61
62
63
trigger:
- master
pr:
- master
jobs:
- job: run_tests
displayName: Run Unit Tests
variables:
zol_rel: "0.7.12"
pool:
vmImage: ubuntu-16.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 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 add-apt-repository ppa:jonathonf/zfs-0.7
sudo apt-get update
sudo apt-get install zfs-dkms
displayName: Install ZFS on Linux
- script: |
dd if=/dev/zero of=loop0 bs=1M count=96
sudo losetup /dev/loop0 `pwd`/loop0
displayName: Setup loop device
- 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: |
CARGO=$(which cargo)
RUSTFLAGS="-C link-dead-code" $CARGO test --no-run
mkdir test-results
sudo RUSTFLAGS="-C link-dead-code" $CARGO suity
displayName: Run Tests
- script: |
RUSTFLAGS="--cfg procmacro2_semver_exempt" cargo install cargo-tarpaulin -f
sudo RUSTFLAGS="-C link-dead-code" $(which cargo) 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