Skip to content

Commit

Permalink
Support bencher and codspeed (#60)
Browse files Browse the repository at this point in the history
Signed-off-by: Moritz Hoffmann <[email protected]>
  • Loading branch information
antiguru authored Jul 15, 2024
1 parent 7dc86fa commit 712966c
Show file tree
Hide file tree
Showing 3 changed files with 126 additions and 74 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/codspeed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: codspeed-benchmarks

on:
# Run on pushes to the main branch
push:
branches:
- "main"
# Run on pull requests
pull_request:
# `workflow_dispatch` allows CodSpeed to trigger backtest
# performance analysis in order to generate initial data.
workflow_dispatch:

jobs:
benchmarks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1

- name: Build the codspeed binary
run: cargo install cargo-codspeed

- name: Build the benchmark targets
run: cargo codspeed build

- name: Run the benchmarks
uses: CodSpeedHQ/action@v2
with:
run: cargo codspeed run
token: ${{ secrets.CODSPEED_TOKEN }}
8 changes: 8 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,11 @@ default = ["serde"]
debug = 2
codegen-units = 1
lto = true

[dev-dependencies]
bencher = "0.1.5"
codspeed-bencher-compat = "2.6.0"

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

0 comments on commit 712966c

Please sign in to comment.