mirror of
https://github.com/tokio-rs/tracing.git
synced 2025-09-28 21:42:15 +00:00
chore: backport CI improvements (#2238)
This commit is contained in:
parent
c6abc10c3a
commit
abb23931ef
154
.github/workflows/CI.yml
vendored
154
.github/workflows/CI.yml
vendored
@ -3,7 +3,6 @@ name: CI
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- "v0.1.x"
|
||||
pull_request: {}
|
||||
|
||||
@ -27,9 +26,6 @@ env:
|
||||
RUSTUP_MAX_RETRIES: 10
|
||||
# Don't emit giant backtraces in the CI logs.
|
||||
RUST_BACKTRACE: short
|
||||
MSRV: 1.63.0
|
||||
# TODO: remove this once tracing's MSRV is bumped.
|
||||
APPENDER_MSRV: 1.63.0
|
||||
|
||||
jobs:
|
||||
### check jobs ###
|
||||
@ -40,16 +36,9 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
profile: minimal
|
||||
override: true
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
- name: Check
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: check
|
||||
args: --all --tests --benches
|
||||
run: cargo check --all --tests --benches
|
||||
|
||||
style:
|
||||
# Check style.
|
||||
@ -58,17 +47,11 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions-rs/toolchain@v1
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
toolchain: stable
|
||||
components: rustfmt
|
||||
profile: minimal
|
||||
override: true
|
||||
- name: rustfmt
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: fmt
|
||||
args: --all -- --check
|
||||
run: cargo fmt --all -- --check
|
||||
|
||||
warnings:
|
||||
# Check for any warnings. This is informational and thus is allowed to fail.
|
||||
@ -76,46 +59,15 @@ jobs:
|
||||
needs: check
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions-rs/toolchain@v1
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
toolchain: stable
|
||||
components: clippy
|
||||
profile: minimal
|
||||
- name: Clippy
|
||||
uses: actions-rs/clippy-check@v1
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
args: --all --examples --tests --benches -- -D warnings
|
||||
|
||||
minimal-versions:
|
||||
# Check for minimal-versions errors where a dependency is too
|
||||
# underconstrained to build on the minimal supported version of all
|
||||
# dependencies in the dependency graph.
|
||||
name: cargo check (-Zminimal-versions)
|
||||
needs: check
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: nightly
|
||||
profile: minimal
|
||||
override: true
|
||||
- name: install cargo-hack
|
||||
uses: taiki-e/install-action@cargo-hack
|
||||
- name: "check --all-features -Z minimal-versions"
|
||||
run: |
|
||||
# Remove dev-dependencies from Cargo.toml to prevent the next `cargo update`
|
||||
# from determining minimal versions based on dev-dependencies.
|
||||
cargo hack --remove-dev-deps --workspace
|
||||
# Update Cargo.lock to minimal version dependencies.
|
||||
cargo update -Z minimal-versions
|
||||
cargo hack check \
|
||||
--package tracing \
|
||||
--package tracing-core \
|
||||
--package tracing-subscriber \
|
||||
--all-features --ignore-private
|
||||
|
||||
cargo-hack:
|
||||
needs: check
|
||||
name: cargo check (feature combinations)
|
||||
@ -195,28 +147,47 @@ jobs:
|
||||
- stable
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: "install Rust ${{ env.APPENDER_MSRV }}"
|
||||
uses: actions-rs/toolchain@v1
|
||||
- name: install Rust nightly
|
||||
uses: dtolnay/rust-toolchain@nightly
|
||||
- name: "install Rust ${{ matrix.toolchain }}"
|
||||
uses: dtolnay/rust-toolchain@master
|
||||
with:
|
||||
toolchain: ${{ env.APPENDER_MSRV }}
|
||||
profile: minimal
|
||||
- name: "install Rust nightly"
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: nightly
|
||||
profile: minimal
|
||||
- name: Select minimal versions
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: update
|
||||
args: -Z minimal-versions
|
||||
toolchain: nightly
|
||||
- name: Check
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: check
|
||||
args: --all-features --locked -p tracing-appender
|
||||
toolchain: ${{ env.APPENDER_MSRV }}
|
||||
toolchain: ${{ matrix.toolchain }}
|
||||
- name: install cargo-hack
|
||||
uses: taiki-e/install-action@cargo-hack
|
||||
- name: install cargo-minimal-versions
|
||||
uses: taiki-e/install-action@cargo-minimal-versions
|
||||
- name: cargo minimal-versions check
|
||||
working-directory: ${{ matrix.subcrate }}
|
||||
# tracing and tracing-subscriber have too many features to be checked by
|
||||
# cargo-hack --feature-powerset with all features in the powerset, so
|
||||
# exclude some
|
||||
run: |
|
||||
CARGO_MINVER=(cargo minimal-versions check --feature-powerset --no-dev-deps)
|
||||
case "${{ matrix.subcrate }}" in
|
||||
tracing)
|
||||
EXCLUDE_FEATURES=(
|
||||
max_level_off max_level_error max_level_warn max_level_info
|
||||
max_level_debug max_level_trace release_max_level_off
|
||||
release_max_level_error release_max_level_warn
|
||||
release_max_level_info release_max_level_debug
|
||||
release_max_level_trace
|
||||
)
|
||||
${CARGO_MINVER[@]} --exclude-features "${EXCLUDE_FEATURES[*]}"
|
||||
;;
|
||||
tracing-subscriber)
|
||||
INCLUDE_FEATURES=(fmt ansi json registry env-filter)
|
||||
${CARGO_MINVER[@]} --include-features "${INCLUDE_FEATURES[*]}"
|
||||
;;
|
||||
tracing-futures)
|
||||
EXCLUDE_FEATURES=(futures-01 futures_01 tokio tokio_01)
|
||||
${CARGO_MINVER[@]} --exclude-features "${EXCLUDE_FEATURES[*]}"
|
||||
;;
|
||||
*)
|
||||
${CARGO_MINVER[@]}
|
||||
;;
|
||||
esac
|
||||
shell: bash
|
||||
|
||||
### test jobs #############################################################
|
||||
|
||||
@ -240,11 +211,10 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions-rs/toolchain@v1
|
||||
- name: "install Rust ${{ matrix.rust }}"
|
||||
uses: dtolnay/rust-toolchain@master
|
||||
with:
|
||||
toolchain: ${{ matrix.rust }}
|
||||
profile: minimal
|
||||
override: true
|
||||
- name: install cargo-nextest
|
||||
uses: taiki-e/install-action@nextest
|
||||
- name: Run tests
|
||||
@ -283,16 +253,11 @@ jobs:
|
||||
fail-fast: false
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions-rs/toolchain@v1
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
target: wasm32-unknown-unknown
|
||||
toolchain: stable
|
||||
override: true
|
||||
- name: build all tests
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: test
|
||||
args: --no-run -p ${{ matrix.subcrate }}
|
||||
run: cargo test --no-run -p ${{ matrix.subcrate }}
|
||||
|
||||
test-wasm:
|
||||
name: cargo test (wasm)
|
||||
@ -304,11 +269,9 @@ jobs:
|
||||
- tracing
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions-rs/toolchain@v1
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
target: wasm32-unknown-unknown
|
||||
toolchain: stable
|
||||
override: true
|
||||
- name: install test runner for wasm
|
||||
uses: taiki-e/install-action@wasm-pack
|
||||
- name: run wasm tests
|
||||
@ -321,29 +284,23 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
profile: minimal
|
||||
override: true
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
- name: "Test log support"
|
||||
run: cargo test
|
||||
- name: "Test static max level"
|
||||
run: cargo test
|
||||
working-directory: "tracing/test_static_max_level_features"
|
||||
- name: "Test static max level (release)"
|
||||
run: cargo test --release
|
||||
working-directory: "tracing/test_static_max_level_features"
|
||||
- name: "Test tracing-core no-std support"
|
||||
run: cargo test --no-default-features
|
||||
- name: "Test tracing no-std support"
|
||||
run: cargo test --no-default-features
|
||||
# this skips running doctests under the `--no-default-features` flag,
|
||||
# as rustdoc isn't aware of cargo's feature flags.
|
||||
- name: "Test tracing-subscriber no-std support"
|
||||
- name: "Test tracing-subscriber with all features disabled"
|
||||
run: cargo test --lib --tests --no-default-features
|
||||
- name: "Test tracing-subscriber with liballoc only"
|
||||
run: cargo test --lib --tests --no-default-features --features "alloc"
|
||||
- name: "Test tracing-subscriber with no default features"
|
||||
run: cargo test --lib --tests --no-default-features --features "std"
|
||||
|
||||
# all required checks except for the main test run (which we only require
|
||||
# specific matrix combinations from)
|
||||
@ -352,11 +309,10 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- style
|
||||
- minimal-versions
|
||||
- cargo-hack
|
||||
- check-msrv
|
||||
- test-build-wasm
|
||||
- test-wasm
|
||||
- test-features-stable
|
||||
steps:
|
||||
- run: exit 0
|
||||
- run: exit 0
|
Loading…
x
Reference in New Issue
Block a user