39
39
runs-on : ubuntu-latest
40
40
steps :
41
41
- uses : actions/checkout@v3
42
- - uses : actions-rs/toolchain@v1
43
- with :
44
- toolchain : stable
45
- profile : minimal
46
- override : true
42
+ - uses : dtolnay/rust-toolchain@stable
47
43
- name : Check
48
- uses : actions-rs/cargo@v1
49
- with :
50
- command : check
51
- args : --all --tests --benches
44
+ run : cargo check --all --tests --benches
52
45
53
46
style :
54
47
# Check style.
@@ -57,64 +50,27 @@ jobs:
57
50
runs-on : ubuntu-latest
58
51
steps :
59
52
- uses : actions/checkout@v3
60
- - uses : actions-rs/ toolchain@v1
53
+ - uses : dtolnay/rust- toolchain@stable
61
54
with :
62
- toolchain : stable
63
55
components : rustfmt
64
- profile : minimal
65
- override : true
66
56
- name : rustfmt
67
- uses : actions-rs/cargo@v1
68
- with :
69
- command : fmt
70
- args : --all -- --check
57
+ run : cargo fmt --all -- --check
71
58
72
59
warnings :
73
60
# Check for any warnings. This is informational and thus is allowed to fail.
74
61
runs-on : ubuntu-latest
75
62
needs : check
76
63
steps :
77
64
- uses : actions/checkout@v3
78
- - uses : actions-rs/ toolchain@v1
65
+ - uses : dtolnay/rust- toolchain@stable
79
66
with :
80
- toolchain : stable
81
67
components : clippy
82
- profile : minimal
83
68
- name : Clippy
84
69
uses : actions-rs/clippy-check@v1
85
70
with :
86
71
token : ${{ secrets.GITHUB_TOKEN }}
87
72
args : --all --examples --tests --benches -- -D warnings
88
73
89
- minimal-versions :
90
- # Check for minimal-versions errors where a dependency is too
91
- # underconstrained to build on the minimal supported version of all
92
- # dependencies in the dependency graph.
93
- name : cargo check (-Zminimal-versions)
94
- needs : check
95
- runs-on : ubuntu-latest
96
- steps :
97
- - uses : actions/checkout@v3
98
- - uses : actions-rs/toolchain@v1
99
- with :
100
- toolchain : nightly
101
- profile : minimal
102
- override : true
103
- - name : install cargo-hack
104
- uses : taiki-e/install-action@cargo-hack
105
- - name : " check --all-features -Z minimal-versions"
106
- run : |
107
- # Remove dev-dependencies from Cargo.toml to prevent the next `cargo update`
108
- # from determining minimal versions based on dev-dependencies.
109
- cargo hack --remove-dev-deps --workspace
110
- # Update Cargo.lock to minimal version dependencies.
111
- cargo update -Z minimal-versions
112
- cargo hack check \
113
- --package tracing \
114
- --package tracing-core \
115
- --package tracing-subscriber \
116
- --all-features --ignore-private
117
-
118
74
cargo-hack :
119
75
needs : check
120
76
name : cargo check (feature combinations)
@@ -137,11 +93,7 @@ jobs:
137
93
- tracing-subscriber
138
94
steps :
139
95
- uses : actions/checkout@v3
140
- - uses : actions-rs/toolchain@v1
141
- with :
142
- toolchain : stable
143
- profile : minimal
144
- override : true
96
+ - uses : dtolnay/rust-toolchain@stable
145
97
146
98
- name : install cargo-hack
147
99
uses : taiki-e/install-action@cargo-hack
@@ -175,76 +127,40 @@ jobs:
175
127
176
128
check-msrv :
177
129
# Run `cargo check` on our minimum supported Rust version (1.49.0).
178
- name : " cargo check (MSRV on ubuntu-latest)"
130
+ name : " cargo check (+ MSRV -Zminimal-versions) ( ubuntu-latest)"
179
131
needs : check
180
132
runs-on : ubuntu-latest
181
133
steps :
182
134
- uses : actions/checkout@v3
135
+ - name : install rust nightly
136
+ uses : dtolnay/rust-toolchain@nightly
183
137
- name : " install Rust ${{ env.MSRV }}"
184
- uses : actions-rs/toolchain@v1
185
- with :
186
- toolchain : ${{ env.MSRV }}
187
- profile : minimal
188
- - name : " install Rust nightly"
189
- uses : actions-rs/toolchain@v1
190
- with :
191
- toolchain : nightly
192
- profile : minimal
193
- - name : Select minimal versions
194
- uses : actions-rs/cargo@v1
138
+ uses : dtolnay/rust-toolchain@master
195
139
with :
196
- command : update
197
- args : -Z minimal-versions
198
- toolchain : nightly
199
- - name : Check
200
- uses : actions-rs/cargo@v1
201
- with :
202
- command : check
203
- # skip the following crates:
204
- # - tracing-appender, as it has its own MSRV.
205
- # TODO(eliza): remove this when appender is on the same MSRV as
206
- # everything else
207
- # - the examples, as they are not published & we don't care about
208
- # MSRV support for them.
209
- # - tracing-futures, as it depends on ancient tokio versions.
210
- # TODO(eliza): remove this when the ancient tokio deps are dropped
211
- args : >-
212
- --workspace --all-features --locked
213
- --exclude=tracing-appender
214
- --exclude=tracing-examples
215
- --exclude=tracing-futures
216
140
toolchain : ${{ env.MSRV }}
217
-
218
- # TODO: remove this once tracing's MSRV is bumped.
219
- check-msrv-appender :
220
- # Run `cargo check` on our minimum supported Rust version (1.53.0).
221
- name : " cargo check (tracing-appender MSRV)"
222
- needs : check
223
- runs-on : ubuntu-latest
224
- steps :
225
- - uses : actions/checkout@v3
226
141
- name : " install Rust ${{ env.APPENDER_MSRV }}"
227
- uses : actions-rs/ toolchain@v1
142
+ uses : dtolnay/rust- toolchain@master
228
143
with :
229
144
toolchain : ${{ env.APPENDER_MSRV }}
230
- profile : minimal
231
- - name : " install Rust nightly"
232
- uses : actions-rs/toolchain@v1
233
- with :
234
- toolchain : nightly
235
- profile : minimal
236
- - name : Select minimal versions
237
- uses : actions-rs/cargo@v1
238
- with :
239
- command : update
240
- args : -Z minimal-versions
241
- toolchain : nightly
145
+ - name : install cargo-hack
146
+ uses : taiki-e/install-action@cargo-hack
147
+ - name : install cargo-minimal-versions
148
+ uses : taiki-e/install-action@cargo-minimal-versions
242
149
- name : Check
243
- uses : actions-rs/cargo@v1
244
- with :
245
- command : check
246
- args : --all-features --locked -p tracing-appender
247
- toolchain : ${{ env.APPENDER_MSRV }}
150
+ # the following crates are handled specially:
151
+ # - unpublished crates (examples, mock); we don't care about their MSRV
152
+ # - tracing-appender; it has its own MSRV.
153
+ # TODO(eliza): remove this when appender is on the same MSRV.
154
+ # - tracing-futures; it depends on ancient tokio versions.
155
+ # TODO(eliza): remove this when the ancient tokio deps are dropped
156
+ run : >-
157
+ cargo +${{ env.MSRV }} hack --workspace --ignore-private
158
+ --exclude tracing-appender --exclude tracing-futures
159
+ minimal-versions check --all-features &&
160
+ cargo +${{ env.APPENDER_MSRV }} hack --package tracing-appender
161
+ minimal-versions check --all-features &&
162
+ cargo +{{ env.MSRV }} hack --package tracing-futures
163
+ minimal-versions check --features futures-03
248
164
249
165
# ## test jobs #############################################################
250
166
@@ -268,11 +184,10 @@ jobs:
268
184
runs-on : ${{ matrix.os }}
269
185
steps :
270
186
- uses : actions/checkout@v3
271
- - uses : actions-rs/toolchain@v1
187
+ - name : " install Rust ${{ matrix.rust }}"
188
+ uses : dtolnay/rust-toolchain@master
272
189
with :
273
190
toolchain : ${{ matrix.rust }}
274
- profile : minimal
275
- override : true
276
191
- name : install cargo-nextest
277
192
uses : taiki-e/install-action@nextest
278
193
- name : Run tests
@@ -312,16 +227,11 @@ jobs:
312
227
fail-fast : false
313
228
steps :
314
229
- uses : actions/checkout@v3
315
- - uses : actions-rs/ toolchain@v1
230
+ - uses : dtolnay/rust- toolchain@stable
316
231
with :
317
232
target : wasm32-unknown-unknown
318
- toolchain : stable
319
- override : true
320
233
- name : build all tests
321
- uses : actions-rs/cargo@v1
322
- with :
323
- command : test
324
- args : --no-run -p ${{ matrix.subcrate }}
234
+ run : cargo test --no-run -p ${{ matrix.subcrate }}
325
235
326
236
test-wasm :
327
237
name : cargo test (wasm)
@@ -333,11 +243,9 @@ jobs:
333
243
- tracing
334
244
steps :
335
245
- uses : actions/checkout@v3
336
- - uses : actions-rs/ toolchain@v1
246
+ - uses : dtolnay/rust- toolchain@stable
337
247
with :
338
248
target : wasm32-unknown-unknown
339
- toolchain : stable
340
- override : true
341
249
- name : install test runner for wasm
342
250
uses : taiki-e/install-action@wasm-pack
343
251
- name : run wasm tests
@@ -353,11 +261,7 @@ jobs:
353
261
runs-on : ubuntu-latest
354
262
steps :
355
263
- uses : actions/checkout@v3
356
- - uses : actions-rs/toolchain@v1
357
- with :
358
- toolchain : stable
359
- profile : minimal
360
- override : true
264
+ - uses : dtolnay/rust-toolchain@stable
361
265
- name : " Test log support"
362
266
run : cargo test
363
267
working-directory : " tracing/test-log-support"
@@ -386,10 +290,8 @@ jobs:
386
290
runs-on : ubuntu-latest
387
291
needs :
388
292
- style
389
- - minimal-versions
390
293
- cargo-hack
391
294
- check-msrv
392
- - check-msrv-appender
393
295
- test-build-wasm
394
296
- test-wasm
395
297
- test-features-stable
0 commit comments