Skip to content

Commit

Permalink
chore: don't check benches on MSRV
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
hawkw committed Aug 16, 2021
1 parent 340cfd7 commit 85119d7
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 85119d7

Please sign in to comment.