-
Notifications
You must be signed in to change notification settings - Fork 7
/
azure-pipelines.yml
112 lines (96 loc) · 3.25 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
trigger:
- master
strategy:
matrix:
Linux_nightly:
imageName: "ubuntu-20.04"
rustVersion: nightly
cmake_generator_opts:
memcheck: valgrind --error-exitcode=1 --leak-check=full
Windows_nightly:
imageName: "windows-2019"
rustVersion: nightly
cmake_generator_opts: -DCMAKE_GENERATOR_PLATFORM=x64
memcheck:
Linux_stable:
imageName: "ubuntu-20.04"
rustVersion: stable
cmake_generator_opts:
memcheck: valgrind --error-exitcode=1 --leak-check=full
Windows_stable:
imageName: "windows-2019"
rustVersion: stable
cmake_generator_opts: -DCMAKE_GENERATOR_PLATFORM=x64
memcheck:
pool:
vmImage: $(imageName)
steps:
- script: |
curl -sSf -o rustup-init.exe https://win.rustup.rs
rustup-init.exe --default-toolchain none -y --default-host x86_64-pc-windows-msvc
displayName: 'Update environment (Windows)'
condition: and(succeeded(), eq( variables['Agent.OS'], 'Windows_NT' ))
- script: |
sudo apt-get install valgrind -y
displayName: 'Update environment (Linux)'
condition: and(succeeded(), eq( variables['Agent.OS'], 'Linux' ))
- script: |
rustup -V
rustup self update
rustup set profile minimal
rustup toolchain install $(rustVersion) -c rustfmt -c clippy
rustup default $(rustVersion)
cargo -V
rustc -V
cargo clippy -V
cargo fmt -- -V
displayName: 'Setup environment'
- script: |
cargo fmt -- --check
cd test
cargo fmt -- --check
displayName: 'Check style'
condition: and(succeeded(), eq( variables['rustVersion'], 'nightly' ))
- script: |
cargo clippy --all -- -D warnings
displayName: 'Run build'
condition: and(succeeded(), eq( variables['rustVersion'], 'nightly' ))
- script: cargo test
displayName: 'Run unit tests'
condition: and(succeeded(), eq( variables['rustVersion'], 'nightly' ))
- script: |
cd test
cargo clippy --all -- -D warnings
displayName: 'Clippy integration tests'
condition: and(succeeded(), eq( variables['rustVersion'], 'nightly' ))
- script: |
mkdir build
cd build
cmake .. $(cmake_generator_opts)
cmake --build .
displayName: "Build integration tests"
- bash: |
$(memcheck) build/bin/cpp-raw
$(memcheck) build/bin/cpp-dl
$(memcheck) build/bin/cpp-wrapper
displayName: "Run integration tests"
- script: |
"C:/Program Files (x86)/Microsoft SDKs/Windows/v10.0A/bin/NETFX 4.8 Tools/tlbimp" test/target/debug/test_lib.dll /MACHINE:X64 /out:test/cs/TestLib.Interop.dll
displayName: "Generate C# type library"
condition: and(succeeded(), eq( variables['Agent.OS'], 'Windows_NT' ))
- task: NuGetCommand@2
inputs:
restoreSolution: test/cs/cs.sln
displayName: 'Restore NuGet packages'
condition: and(succeeded(), eq( variables['Agent.OS'], 'Windows_NT' ))
- task: MSBuild@1
inputs:
solution: test/cs/cs.sln
platform: x64
displayName: 'Build C# tests'
condition: and(succeeded(), eq( variables['Agent.OS'], 'Windows_NT' ))
- task: VSTest@2
inputs:
testAssemblyVer2: test/cs/bin/x64/debug/cs.dll
displayName: 'Run C# tests'
condition: and(succeeded(), eq( variables['Agent.OS'], 'Windows_NT' ))