Split out cargo bench compile check (#753)

Acknowledged that running "cargo bench --no-run" on every test platform
is slow. This PR
- extracts benchmark compilation verification from the Linux and macOS
build_and_test jobs into a dedicated `check-bench-compiles` job so it
runs in parallel with the cargo test jobs;
- also skips compiling "git_xet" in release mode which itself doesn't
contain benchmarks and takes the longest to compile due to optimized
linking;
- also removes unused clippy component installs from Windows and macOS
toolchain setup.

See below that the `check-bench-compiles` job finishes faster than
`build_and_test-linux` and `build_and_test-win`, so it's not introducing
extra wait time.
This commit is contained in:
Di Xiao
2026-03-25 22:25:20 -07:00
committed by GitHub
parent 101837f691
commit b3edd92a10

View File

@@ -30,6 +30,16 @@ jobs:
- uses: actions/checkout@v6
- name: Machete
uses: bnjbvr/cargo-machete@main
check-bench-compiles:
name: Check benchmarks compile
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@1.89.0
- uses: ./.github/actions/cache-rust-build
- name: Compile benchmarks
run: |
cargo bench --no-run --workspace --exclude git_xet
build_and_test-linux:
runs-on: ubuntu-latest
steps:
@@ -55,9 +65,6 @@ jobs:
- name: Build and Test hf_xet
run: |
cd hf_xet && cargo test --verbose --no-fail-fast
- name: Check benchmarks compile
run: |
cargo bench --no-run
- name: Check Cargo.lock has no uncommitted changes
run: |
# the build and test steps would update Cargo.lock if it is out of date
@@ -69,8 +76,6 @@ jobs:
uses: actions/checkout@v6
- name: Install Rust 1.89
uses: dtolnay/rust-toolchain@1.89.0
with:
components: clippy
- uses: ./.github/actions/cache-rust-build
- name: Build and Test
run: |
@@ -85,8 +90,6 @@ jobs:
uses: actions/checkout@v6
- name: Install Rust 1.89
uses: dtolnay/rust-toolchain@1.89.0
with:
components: clippy
- name: Set up Git LFS
run: |
brew install git-lfs
@@ -98,9 +101,6 @@ jobs:
- name: Build and Test hf_xet
run: |
cd hf_xet && cargo test --verbose --no-fail-fast
- name: Check benchmarks compile
run: |
cargo bench --no-run
build_and_test-wasm:
name: Build WASM
runs-on: ubuntu-latest