forked from ohadravid/wmi-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
57 lines (46 loc) · 1.67 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
trigger:
branches:
include: ['*']
tags:
include: ['*']
strategy:
matrix:
windows-stable:
imageName: 'vs2017-win2016'
target: 'x86_64-pc-windows-msvc'
rustup_toolchain: stable
pool:
vmImage: $(imageName)
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 (posix)
condition: ne( variables['Agent.OS'], 'Windows_NT' )
- script: |
curl -sSf -o rustup-init.exe https://win.rustup.rs
rustup-init.exe -y --default-toolchain %RUSTUP_TOOLCHAIN%
echo "##vso[task.setvariable variable=PATH;]%PATH%;%USERPROFILE%\.cargo\bin"
rm rustup-init.exe
displayName: Install rust (windows)
condition: eq( variables['Agent.OS'], 'Windows_NT' )
- script: cargo build
displayName: Cargo build - Only chrono (default features)
- script: cargo build --no-default-features --features=time
displayName: Cargo build - Only time
- script: cargo build --no-default-features
displayName: Cargo build - No features
- script: cargo build --all-features
displayName: Cargo build - All features
# Test time crate
- script: cargo test --no-default-features --features=time,async-query
displayName: Cargo test - Use time
# Test chrono
- script: cargo test --no-default-features --features=chrono,async-query
displayName: Cargo test - Use chrono
- script: |
cargo publish
displayName: Cargo publish
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
env:
CARGO_REGISTRY_TOKEN: $(crates_io_token)