4
4
push :
5
5
branches :
6
6
- master
7
- - " v0.1.x"
8
7
pull_request : {}
9
8
10
9
env :
27
26
RUSTUP_MAX_RETRIES : 10
28
27
# Don't emit giant backtraces in the CI logs.
29
28
RUST_BACKTRACE : short
30
- MSRV : 1.63.0
31
- # TODO: remove this once tracing's MSRV is bumped.
32
- APPENDER_MSRV : 1.63.0
33
29
34
30
jobs :
35
31
# ## check jobs ###
40
36
runs-on : ubuntu-latest
41
37
steps :
42
38
- uses : actions/checkout@v3
43
- - uses : actions-rs/toolchain@v1
44
- with :
45
- toolchain : stable
46
- profile : minimal
47
- override : true
39
+ - uses : dtolnay/rust-toolchain@stable
48
40
- name : Check
49
- uses : actions-rs/cargo@v1
50
- with :
51
- command : check
52
- args : --all --tests --benches
41
+ run : cargo check --all --tests --benches
53
42
54
43
style :
55
44
# Check style.
@@ -58,64 +47,27 @@ jobs:
58
47
runs-on : ubuntu-latest
59
48
steps :
60
49
- uses : actions/checkout@v3
61
- - uses : actions-rs/ toolchain@v1
50
+ - uses : dtolnay/rust- toolchain@stable
62
51
with :
63
- toolchain : stable
64
52
components : rustfmt
65
- profile : minimal
66
- override : true
67
53
- name : rustfmt
68
- uses : actions-rs/cargo@v1
69
- with :
70
- command : fmt
71
- args : --all -- --check
54
+ run : cargo fmt --all -- --check
72
55
73
56
warnings :
74
57
# Check for any warnings. This is informational and thus is allowed to fail.
75
58
runs-on : ubuntu-latest
76
59
needs : check
77
60
steps :
78
61
- uses : actions/checkout@v3
79
- - uses : actions-rs/ toolchain@v1
62
+ - uses : dtolnay/rust- toolchain@stable
80
63
with :
81
- toolchain : stable
82
64
components : clippy
83
- profile : minimal
84
65
- name : Clippy
85
66
uses : actions-rs/clippy-check@v1
86
67
with :
87
68
token : ${{ secrets.GITHUB_TOKEN }}
88
69
args : --all --examples --tests --benches -- -D warnings
89
70
90
- minimal-versions :
91
- # Check for minimal-versions errors where a dependency is too
92
- # underconstrained to build on the minimal supported version of all
93
- # dependencies in the dependency graph.
94
- name : cargo check (-Zminimal-versions)
95
- needs : check
96
- runs-on : ubuntu-latest
97
- steps :
98
- - uses : actions/checkout@v3
99
- - uses : actions-rs/toolchain@v1
100
- with :
101
- toolchain : nightly
102
- profile : minimal
103
- override : true
104
- - name : install cargo-hack
105
- uses : taiki-e/install-action@cargo-hack
106
- - name : " check --all-features -Z minimal-versions"
107
- run : |
108
- # Remove dev-dependencies from Cargo.toml to prevent the next `cargo update`
109
- # from determining minimal versions based on dev-dependencies.
110
- cargo hack --remove-dev-deps --workspace
111
- # Update Cargo.lock to minimal version dependencies.
112
- cargo update -Z minimal-versions
113
- cargo hack check \
114
- --package tracing \
115
- --package tracing-core \
116
- --package tracing-subscriber \
117
- --all-features --ignore-private
118
-
119
71
cargo-hack :
120
72
needs : check
121
73
name : cargo check (feature combinations)
@@ -195,28 +147,47 @@ jobs:
195
147
- stable
196
148
steps :
197
149
- uses : actions/checkout@v3
198
- - name : " install Rust ${{ env.APPENDER_MSRV }}"
199
- uses : actions-rs/toolchain@v1
200
- with :
201
- toolchain : ${{ env.APPENDER_MSRV }}
202
- profile : minimal
203
- - name : " install Rust nightly"
204
- uses : actions-rs/toolchain@v1
150
+ - name : install Rust nightly
151
+ uses : dtolnay/rust-toolchain@nightly
152
+ - name : " install Rust ${{ matrix.toolchain }}"
153
+ uses : dtolnay/rust-toolchain@master
205
154
with :
206
- toolchain : nightly
207
- profile : minimal
208
- - name : Select minimal versions
209
- uses : actions-rs/cargo@v1
210
- with :
211
- command : update
212
- args : -Z minimal-versions
213
- toolchain : nightly
214
- - name : Check
215
- uses : actions-rs/cargo@v1
216
- with :
217
- command : check
218
- args : --all-features --locked -p tracing-appender
219
- toolchain : ${{ env.APPENDER_MSRV }}
155
+ toolchain : ${{ matrix.toolchain }}
156
+ - name : install cargo-hack
157
+ uses : taiki-e/install-action@cargo-hack
158
+ - name : install cargo-minimal-versions
159
+ uses : taiki-e/install-action@cargo-minimal-versions
160
+ - name : cargo minimal-versions check
161
+ working-directory : ${{ matrix.subcrate }}
162
+ # tracing and tracing-subscriber have too many features to be checked by
163
+ # cargo-hack --feature-powerset with all features in the powerset, so
164
+ # exclude some
165
+ run : |
166
+ CARGO_MINVER=(cargo minimal-versions check --feature-powerset --no-dev-deps)
167
+ case "${{ matrix.subcrate }}" in
168
+ tracing)
169
+ EXCLUDE_FEATURES=(
170
+ max_level_off max_level_error max_level_warn max_level_info
171
+ max_level_debug max_level_trace release_max_level_off
172
+ release_max_level_error release_max_level_warn
173
+ release_max_level_info release_max_level_debug
174
+ release_max_level_trace
175
+ )
176
+ ${CARGO_MINVER[@]} --exclude-features "${EXCLUDE_FEATURES[*]}"
177
+ ;;
178
+ tracing-subscriber)
179
+ INCLUDE_FEATURES=(fmt ansi json registry env-filter)
180
+ ${CARGO_MINVER[@]} --include-features "${INCLUDE_FEATURES[*]}"
181
+ ;;
182
+ tracing-futures)
183
+ EXCLUDE_FEATURES=(futures-01 futures_01 tokio tokio_01)
184
+ ${CARGO_MINVER[@]} --exclude-features "${EXCLUDE_FEATURES[*]}"
185
+ ;;
186
+ *)
187
+ ${CARGO_MINVER[@]}
188
+ ;;
189
+ esac
190
+ shell : bash
220
191
221
192
# ## test jobs #############################################################
222
193
@@ -240,11 +211,10 @@ jobs:
240
211
runs-on : ${{ matrix.os }}
241
212
steps :
242
213
- uses : actions/checkout@v3
243
- - uses : actions-rs/toolchain@v1
214
+ - name : " install Rust ${{ matrix.rust }}"
215
+ uses : dtolnay/rust-toolchain@master
244
216
with :
245
217
toolchain : ${{ matrix.rust }}
246
- profile : minimal
247
- override : true
248
218
- name : install cargo-nextest
249
219
uses : taiki-e/install-action@nextest
250
220
- name : Run tests
@@ -283,16 +253,11 @@ jobs:
283
253
fail-fast : false
284
254
steps :
285
255
- uses : actions/checkout@v3
286
- - uses : actions-rs/ toolchain@v1
256
+ - uses : dtolnay/rust- toolchain@stable
287
257
with :
288
258
target : wasm32-unknown-unknown
289
- toolchain : stable
290
- override : true
291
259
- name : build all tests
292
- uses : actions-rs/cargo@v1
293
- with :
294
- command : test
295
- args : --no-run -p ${{ matrix.subcrate }}
260
+ run : cargo test --no-run -p ${{ matrix.subcrate }}
296
261
297
262
test-wasm :
298
263
name : cargo test (wasm)
@@ -304,11 +269,9 @@ jobs:
304
269
- tracing
305
270
steps :
306
271
- uses : actions/checkout@v3
307
- - uses : actions-rs/ toolchain@v1
272
+ - uses : dtolnay/rust- toolchain@stable
308
273
with :
309
274
target : wasm32-unknown-unknown
310
- toolchain : stable
311
- override : true
312
275
- name : install test runner for wasm
313
276
uses : taiki-e/install-action@wasm-pack
314
277
- name : run wasm tests
@@ -321,11 +284,7 @@ jobs:
321
284
runs-on : ubuntu-latest
322
285
steps :
323
286
- uses : actions/checkout@v3
324
- - uses : actions-rs/toolchain@v1
325
- with :
326
- toolchain : stable
327
- profile : minimal
328
- override : true
287
+ - uses : dtolnay/rust-toolchain@stable
329
288
- name : " Test log support"
330
289
run : cargo test
331
290
- name : " Test static max level"
@@ -338,12 +297,8 @@ jobs:
338
297
run : cargo test --no-default-features
339
298
# this skips running doctests under the `--no-default-features` flag,
340
299
# as rustdoc isn't aware of cargo's feature flags.
341
- - name : " Test tracing-subscriber no-std support "
300
+ - name : " Test tracing-subscriber with all features disabled "
342
301
run : cargo test --lib --tests --no-default-features
343
- - name : " Test tracing-subscriber with liballoc only"
344
- run : cargo test --lib --tests --no-default-features --features "alloc"
345
- - name : " Test tracing-subscriber with no default features"
346
- run : cargo test --lib --tests --no-default-features --features "std"
347
302
348
303
# all required checks except for the main test run (which we only require
349
304
# specific matrix combinations from)
@@ -352,11 +307,10 @@ jobs:
352
307
runs-on : ubuntu-latest
353
308
needs :
354
309
- style
355
- - minimal-versions
356
310
- cargo-hack
357
311
- check-msrv
358
312
- test-build-wasm
359
313
- test-wasm
360
314
- test-features-stable
361
315
steps :
362
- - run : exit 0
316
+ - run : exit 0
0 commit comments