1name: $(Build.BuildId)
2trigger:
3  # Always build master
4  - v2-master
5pr:
6  # Enable building pull requests.
7  - v2-master
8stages:
9  - stage: Testing
10    jobs:
11      - job:
12        variables:
13          rust: 1.36.0
14        strategy:
15          matrix:
16            Windows 32-bit (MSVC):
17              image: vs2017-win2016
18              target: i686-pc-windows-msvc
19            Windows 64-bit (MSVC):
20              image: vs2017-win2016
21              target: x86_64-pc-windows-msvc
22            Windows 32-bit (MinGW):
23              image: vs2017-win2016
24              target: i686-pc-windows-gnu
25            Windows 64-bit (MinGW):
26              image: vs2017-win2016
27              target: x86_64-pc-windows-gnu
28        pool:
29          vmImage: $(image)
30        steps:
31          - checkout: self
32            fetchDepth: 1
33            path: clap
34            displayName: Checkout repository
35          - task: Cache@2
36            inputs:
37              key: cargo | "$(rust)" | $(target) | Cargo.toml
38              path: C:\Rust\.cargo
39            displayName: Caching cargo
40          - task: Cache@2
41            inputs:
42              key: compiled | "$(rust)" | $(target) | Cargo.toml
43              path: target
44            displayName: Caching compiled
45          - script: rustup default $(rust)-$(target)
46            displayName: Install rust
47          - script: cargo test --no-default-features
48            displayName: Test without default features
49            env:
50              RUST_BACKTRACE: full
51          - script: cargo test --features "yaml unstable"
52            displayName: Test with most features
53            env:
54              RUST_BACKTRACE: full
55          - script: |
56              rmdir /Q /S C:\Rust\.cargo\registry\src
57              rmdir /Q /S target\.rustc_info.json
58              rmdir /Q /S target\debug\examples
59              rmdir /Q /S target\debug\incremental
60            displayName: Cleaning for cache
61            continueOnError: true
62