26
26
RUSTUP_MAX_RETRIES : 10
27
27
# Don't emit giant backtraces in the CI logs.
28
28
RUST_BACKTRACE : short
29
- MSRV : 1.49.0
30
- # TODO: remove this once tracing's MSRV is bumped.
31
- APPENDER_MSRV : 1.53.0
32
29
33
30
jobs :
34
31
# ## check jobs ###
39
36
runs-on : ubuntu-latest
40
37
steps :
41
38
- uses : actions/checkout@v3
42
- - uses : actions-rs/toolchain@v1
43
- with :
44
- toolchain : stable
45
- profile : minimal
46
- override : true
39
+ - uses : dtolnay/rust-toolchain@stable
47
40
- name : Check
48
- uses : actions-rs/cargo@v1
49
- with :
50
- command : check
51
- args : --all --tests --benches
41
+ run : cargo check --all --tests --benches
52
42
53
43
style :
54
44
# Check style.
@@ -57,64 +47,27 @@ jobs:
57
47
runs-on : ubuntu-latest
58
48
steps :
59
49
- uses : actions/checkout@v3
60
- - uses : actions-rs/ toolchain@v1
50
+ - uses : dtolnay/rust- toolchain@stable
61
51
with :
62
- toolchain : stable
63
52
components : rustfmt
64
- profile : minimal
65
- override : true
66
53
- name : rustfmt
67
- uses : actions-rs/cargo@v1
68
- with :
69
- command : fmt
70
- args : --all -- --check
54
+ run : cargo fmt --all -- --check
71
55
72
56
warnings :
73
57
# Check for any warnings. This is informational and thus is allowed to fail.
74
58
runs-on : ubuntu-latest
75
59
needs : check
76
60
steps :
77
61
- uses : actions/checkout@v3
78
- - uses : actions-rs/ toolchain@v1
62
+ - uses : dtolnay/rust- toolchain@stable
79
63
with :
80
- toolchain : stable
81
64
components : clippy
82
- profile : minimal
83
65
- name : Clippy
84
66
uses : actions-rs/clippy-check@v1
85
67
with :
86
68
token : ${{ secrets.GITHUB_TOKEN }}
87
69
args : --all --examples --tests --benches -- -D warnings
88
70
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
71
cargo-hack :
119
72
needs : check
120
73
name : cargo check (feature combinations)
@@ -137,11 +90,7 @@ jobs:
137
90
- tracing-subscriber
138
91
steps :
139
92
- uses : actions/checkout@v3
140
- - uses : actions-rs/toolchain@v1
141
- with :
142
- toolchain : stable
143
- profile : minimal
144
- override : true
93
+ - uses : dtolnay/rust-toolchain@stable
145
94
146
95
- name : install cargo-hack
147
96
uses : taiki-e/install-action@cargo-hack
@@ -174,77 +123,80 @@ jobs:
174
123
shell : bash
175
124
176
125
check-msrv :
177
- # Run `cargo check` on our minimum supported Rust version (1.49.0).
178
- name : " cargo check (MSRV on ubuntu-latest)"
179
- needs : check
180
- runs-on : ubuntu-latest
181
- steps :
182
- - uses : actions/checkout@v3
183
- - 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
195
- 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
- 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)"
126
+ # Run `cargo check` on our minimum supported Rust version (1.49.0). This
127
+ # checks with minimal versions; maximal versions are checked above.
128
+ name : " cargo check (+MSRV -Zminimal-versions)"
222
129
needs : check
223
130
runs-on : ubuntu-latest
131
+ strategy :
132
+ matrix :
133
+ # cargo hack --feature-powerset will have a significant permutation
134
+ # number, we can't just use --all as it increases the runtime
135
+ # further than what we would like to
136
+ subcrate :
137
+ - tracing-attributes
138
+ - tracing-core
139
+ - tracing-futures
140
+ - tracing-log
141
+ - tracing-macros
142
+ - tracing-serde
143
+ - tracing-tower
144
+ - tracing-opentelemetry
145
+ - tracing
146
+ - tracing-subscriber
147
+ toolchain :
148
+ - 1.49.0
149
+ - stable
150
+ # TODO(eliza): remove this when appender is on the same MSRV.
151
+ exclude :
152
+ - subcrate : tracing-appender
153
+ toolchain : 1.49.0
154
+ include :
155
+ - subcrate : tracing-appender
156
+ toolchain : 1.53.0
224
157
steps :
225
158
- uses : actions/checkout@v3
226
- - name : " install Rust ${{ env.APPENDER_MSRV }}"
227
- uses : actions-rs/toolchain@v1
228
- with :
229
- toolchain : ${{ env.APPENDER_MSRV }}
230
- profile : minimal
231
- - name : " install Rust nightly"
232
- uses : actions-rs/toolchain@v1
159
+ - name : install Rust nightly
160
+ uses : dtolnay/rust-toolchain@nightly
161
+ - name : " install Rust ${{ matrix.toolchain }}"
162
+ uses : dtolnay/rust-toolchain@master
233
163
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
242
- - 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 }}
164
+ toolchain : ${{ matrix.toolchain }}
165
+ - name : install cargo-hack
166
+ uses : taiki-e/install-action@cargo-hack
167
+ - name : install cargo-minimal-versions
168
+ uses : taiki-e/install-action@cargo-minimal-versions
169
+ - name : cargo minimal-versions check
170
+ working-directory : ${{ matrix.subcrate }}
171
+ # tracing and tracing-subscriber have too many features to be checked by
172
+ # cargo-hack --feature-powerset with all features in the powerset, so
173
+ # exclude some
174
+ run : |
175
+ CARGO_MINVER=(cargo minimal-versions check --feature-powerset --no-dev-deps)
176
+ case "${{ matrix.subcrate }}" in
177
+ tracing)
178
+ EXCLUDE_FEATURES=(
179
+ max_level_off max_level_error max_level_warn max_level_info
180
+ max_level_debug max_level_trace release_max_level_off
181
+ release_max_level_error release_max_level_warn
182
+ release_max_level_info release_max_level_debug
183
+ release_max_level_trace
184
+ )
185
+ ${CARGO_MINVER[@]} --exclude-features "${EXCLUDE_FEATURES[*]}"
186
+ ;;
187
+ tracing-subscriber)
188
+ INCLUDE_FEATURES=(fmt ansi json registry env-filter)
189
+ ${CARGO_MINVER[@]} --include-features "${INCLUDE_FEATURES[*]}"
190
+ ;;
191
+ tracing-futures)
192
+ EXCLUDE_FEATURES=(futures-01 futures_01 tokio tokio_01)
193
+ ${CARGO_MINVER[@]} --exclude-features "${EXCLUDE_FEATURES[*]}"
194
+ ;;
195
+ *)
196
+ ${CARGO_MINVER[@]}
197
+ ;;
198
+ esac
199
+ shell : bash
248
200
249
201
# ## test jobs #############################################################
250
202
@@ -268,11 +220,10 @@ jobs:
268
220
runs-on : ${{ matrix.os }}
269
221
steps :
270
222
- uses : actions/checkout@v3
271
- - uses : actions-rs/toolchain@v1
223
+ - name : " install Rust ${{ matrix.rust }}"
224
+ uses : dtolnay/rust-toolchain@master
272
225
with :
273
226
toolchain : ${{ matrix.rust }}
274
- profile : minimal
275
- override : true
276
227
- name : install cargo-nextest
277
228
uses : taiki-e/install-action@nextest
278
229
- name : Run tests
@@ -312,16 +263,11 @@ jobs:
312
263
fail-fast : false
313
264
steps :
314
265
- uses : actions/checkout@v3
315
- - uses : actions-rs/ toolchain@v1
266
+ - uses : dtolnay/rust- toolchain@stable
316
267
with :
317
268
target : wasm32-unknown-unknown
318
- toolchain : stable
319
- override : true
320
269
- name : build all tests
321
- uses : actions-rs/cargo@v1
322
- with :
323
- command : test
324
- args : --no-run -p ${{ matrix.subcrate }}
270
+ run : cargo test --no-run -p ${{ matrix.subcrate }}
325
271
326
272
test-wasm :
327
273
name : cargo test (wasm)
@@ -333,11 +279,9 @@ jobs:
333
279
- tracing
334
280
steps :
335
281
- uses : actions/checkout@v3
336
- - uses : actions-rs/ toolchain@v1
282
+ - uses : dtolnay/rust- toolchain@stable
337
283
with :
338
284
target : wasm32-unknown-unknown
339
- toolchain : stable
340
- override : true
341
285
- name : install test runner for wasm
342
286
uses : taiki-e/install-action@wasm-pack
343
287
- name : run wasm tests
@@ -353,11 +297,7 @@ jobs:
353
297
runs-on : ubuntu-latest
354
298
steps :
355
299
- uses : actions/checkout@v3
356
- - uses : actions-rs/toolchain@v1
357
- with :
358
- toolchain : stable
359
- profile : minimal
360
- override : true
300
+ - uses : dtolnay/rust-toolchain@stable
361
301
- name : " Test log support"
362
302
run : cargo test
363
303
working-directory : " tracing/test-log-support"
@@ -386,10 +326,8 @@ jobs:
386
326
runs-on : ubuntu-latest
387
327
needs :
388
328
- style
389
- - minimal-versions
390
329
- cargo-hack
391
330
- check-msrv
392
- - check-msrv-appender
393
331
- test-build-wasm
394
332
- test-wasm
395
333
- test-features-stable
0 commit comments