-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathnightly-only.yml
117 lines (116 loc) · 3.75 KB
/
nightly-only.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
parameters:
min: false
setup: []
services: {}
env: {}
cross: true
dir: "."
jobs:
- job: style
displayName: Style linting
pool:
vmImage: ubuntu-22.04
continueOnError: true
steps:
# latest nightly may not have rustfmt/clippy
# we can't check for both:
# https://github.com/rust-lang/rustup-components-history/issues/9
# but we at least check for one.
# rustfmt _seems_ to break most often:
- bash: |
echo '##vso[task.setvariable variable=nightly]nightly-'$(curl -s https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/rustfmt)
displayName: "Determine latest style nightly"
- template: install-rust.yml
parameters:
rust: $(nightly)
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
workingDirectory: ${{ parameters.dir }}
displayName: cargo clippy -- -D warnings
- job: main
displayName: Compile and test
dependsOn: []
${{ if eq('true', parameters.cross) }}:
strategy:
matrix:
Linux:
vmImage: ubuntu-22.04
rust: nightly
MacOS:
vmImage: macOS-12
rust: nightly
Windows:
vmImage: windows-2019
rust: nightly
${{ if ne('true', parameters.cross) }}:
strategy:
matrix:
Linux:
vmImage: ubuntu-22.04
rust: nightly
pool:
vmImage: $(vmImage)
services:
${{ insert }}: ${{ parameters.services }}
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.min) }}:
- job: msrv
displayName: "${{ format('Minimum supported Rust nightly: {0}', parameters.min) }}"
dependsOn: []
# This represents the minimum Rust version supported.
# Tests are not run as tests may require newer versions of nightly.
pool:
vmImage: ubuntu-22.04
steps:
- template: install-rust.yml
parameters:
rust: "${{ format('nightly-{0}', parameters.min) }}"
# 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 }}
nightly: true