From 85119d744162792a2ff81fda26f34340a7d7eb24 Mon Sep 17 00:00:00 2001 From: Eliza Weisman Date: Mon, 16 Aug 2021 10:20:55 -0700 Subject: [PATCH] chore: don't check benches on MSRV Currently, CI runs `cargo check --all --bins --tests --benches` on our MSRV. This is failing, because the latest `criterion` version now depends on a revision of `bitflags` that doesn't build on Rust 1.42.0 (due to `const fn`s not being const on 1.42.0). We *could* solve this by bumping our MSRV to a version where the appropriate functions are `const fn`, or we could use a `=` dependency to pin to a specific older version of `bitflags` that compiles on 1.42.0. However, both of these solutions seem kind of unfortunate. This commit just removes the `--benches` from the MSRV `cargo check` run. The benchmarks are an internal development tool, not an officially supported part of `tracing`. Users on 1.42.0 can still depend on `tracing` and use it in their code even if the benchmarks don't compile on their (fairly old) Rust version. Therefore, it should be fine to just remove the benchmarks from the MSRV check. I split the MSRV and stable `cargo check` jobs into separate jobs, so we still check that commits don't break the benchmarks on stable Rust. Signed-off-by: Eliza Weisman --- .github/workflows/CI.yml | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index a7a77b62a7..a5ff6b6f45 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -7,17 +7,32 @@ on: pull_request: {} jobs: + check-msrv: + # Run `cargo check` on our minimum supported Rust version (1.42.0). + runs-on: ubuntu-latest + rust: 1.42.0 + steps: + - uses: actions/checkout@main + - uses: actions-rs/toolchain@v1 + with: + toolchain: 1.42.0 + profile: minimal + override: true + - name: Check + uses: actions-rs/cargo@v1 + with: + command: check + args: --all --bins --tests + check: # Run `cargo check` first to ensure that the pushed code at least compiles. runs-on: ubuntu-latest - strategy: - matrix: - rust: [stable, 1.42.0] + rust: stable steps: - uses: actions/checkout@main - uses: actions-rs/toolchain@v1 with: - toolchain: ${{ matrix.rust }} + toolchain: stable profile: minimal override: true - name: Check