-
Notifications
You must be signed in to change notification settings - Fork 24
/
default.yml
127 lines (126 loc) · 3.8 KB
/
default.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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
parameters:
minrust: 1.32.0 # Rust 2018 with uniform paths
setup: []
services: {}
env: {}
cross: true
dir: "."
jobs:
- job: style
displayName: Style linting
strategy:
matrix:
stable:
rust: stable
beta:
rust: beta
pool:
vmImage: ubuntu-22.04
continueOnError: $[eq(variables.rust, 'beta')]
steps:
- template: install-rust.yml
parameters:
rust: $(rust)
components:
- rustfmt
- clippy
# Run any user-specific setup steps
- ${{ parameters.setup }}
- script: cargo fmt --all -- --check
workingDirectory: ${{ parameters.dir }}
displayName: cargo fmt --check
- script: cargo clippy --all -- -D warnings
workingDirectory: ${{ parameters.dir }}
displayName: cargo clippy -- -D warnings
- job: main
displayName: Compile and test
dependsOn: []
${{ if eq('true', parameters.cross) }}:
strategy:
matrix:
"Linux (nightly)":
vmImage: ubuntu-22.04
rust: nightly
"Linux (beta)":
vmImage: ubuntu-22.04
rust: beta
Linux:
vmImage: ubuntu-22.04
rust: stable
MacOS:
vmImage: macOS-12
rust: stable
Windows:
vmImage: windows-2019
rust: stable
${{ if ne('true', parameters.cross) }}:
strategy:
matrix:
"Linux (nightly)":
vmImage: ubuntu-22.04
rust: nightly
"Linux (beta)":
vmImage: ubuntu-22.04
rust: beta
Linux:
vmImage: ubuntu-22.04
rust: stable
pool:
vmImage: $(vmImage)
services:
${{ insert }}: ${{ parameters.services }}
continueOnError: $[eq(variables.rust, 'nightly')]
steps:
- template: install-rust.yml
parameters:
rust: $(rust)
# Run any user-specific setup steps
- ${{ parameters.setup }}
- script: cargo check
workingDirectory: ${{ parameters.dir }}
displayName: cargo check
- script: cargo check --no-default-features
workingDirectory: ${{ parameters.dir }}
displayName: cargo check --no-default-features
- script: cargo check --all-features
workingDirectory: ${{ parameters.dir }}
displayName: cargo check --all-features
- script: cargo test --all-features
workingDirectory: ${{ parameters.dir }}
displayName: cargo test
env:
${{ insert }}: ${{ parameters.env }}
- script: cargo doc --no-deps
workingDirectory: ${{ parameters.dir }}
displayName: cargo doc
- ${{ if ne('false', parameters.minrust) }}:
- job: msrv
displayName: "${{ format('Minimum supported Rust version: {0}', parameters.minrust) }}"
dependsOn: []
# This represents the minimum Rust version supported.
# Tests are not run as tests may require newer versions of rust.
pool:
vmImage: ubuntu-22.04
steps:
- template: install-rust.yml
parameters:
rust: ${{ parameters.minrust }}
# Run any user-specific setup steps
- ${{ parameters.setup }}
- script: cargo check
workingDirectory: ${{ parameters.dir }}
displayName: cargo check
- script: cargo check --no-default-features
workingDirectory: ${{ parameters.dir }}
displayName: cargo check --no-default-features
- script: cargo check --all-features
workingDirectory: ${{ parameters.dir }}
displayName: cargo check --all-features
- ${{ if ne('', parameters.codecov_token) }}:
- template: coverage.yml
parameters:
token: ${{ parameters.codecov_token }}
setup: ${{ parameters.setup }}
services: ${{ parameters.services }}
env: ${{ parameters.env }}
dir: ${{ parameters.dir }}