Skip to content

Commit

Permalink
Support bencher and codspeed
Browse files Browse the repository at this point in the history
Signed-off-by: Moritz Hoffmann <[email protected]>
  • Loading branch information
antiguru committed Jul 15, 2024
1 parent 7dc86fa commit 47a31a4
Show file tree
Hide file tree
Showing 3 changed files with 123 additions and 74 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/codspeed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
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 benchmark target(s)
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 47a31a4

Please sign in to comment.