Skip to content

Commit

Permalink
ci: Continuous benchmarking with codspeed.io (#783)
Browse files Browse the repository at this point in the history
  • Loading branch information
aborgna-q authored Feb 21, 2025
1 parent f0c67be commit d4d4afd
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
20 changes: 15 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,19 +103,29 @@ jobs:
run: uv run ruff check

benches:
name: Build benchmarks 🏋️
name: Continuous benchmarking 🏋️
needs: changes
if: ${{ needs.changes.outputs.rust == 'true' && github.event_name != 'merge_group' }}
runs-on: ubuntu-latest
permissions:
checks: write
steps:
- uses: actions/checkout@v4
- uses: mozilla-actions/[email protected]
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- name: Build benchmarks with no features
run: cargo bench --verbose --no-run --workspace --no-default-features
- name: Build benchmarks with all features
run: cargo bench --verbose --no-run --workspace --all-features
- uses: cargo-bins/cargo-binstall@main
- name: Install cargo-codspeed
run: cargo binstall cargo-codspeed --force
- name: Override criterion with the CodSpeed harness
run: cargo add --dev codspeed-criterion-compat --rename criterion --package tket2
- name: Build benchmarks
run: cargo codspeed build --profile bench --features portmatching,binary-eccs,rewrite-tracing
- name: Run benchmarks
uses: CodSpeedHQ/action@v3
with:
token: ${{ secrets.CODSPEED_TOKEN }}
run: "cargo codspeed run"

# Run tests on Rust stable
tests-rs-stable-no-features:
Expand Down
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ bytemuck = "1.21.0"
cgmath = "0.18.0"
chrono = "0.4.39"
clap = "4.5.29"
criterion = "0.5.1"
crossbeam-channel = "0.5.14"
csv = "1.3.1"
delegate = "0.13.2"
Expand Down
5 changes: 4 additions & 1 deletion tket2/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,12 @@ zstd = { workspace = true, optional = true }

[dev-dependencies]
rstest = { workspace = true }
criterion = { workspace = true, features = ["html_reports"] }
cool_asserts = { workspace = true }

# Defined here so it can be overridden by the codspeed CI job
# using `cargo add`.
criterion = { version = "0.5.1", features = ["html_reports"] }

[[bench]]
name = "bench_main"
harness = false

0 comments on commit d4d4afd

Please sign in to comment.