Skip to content

Commit

Permalink
ci: Enable continuous benchmarks through codspeed
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-ferdinand committed Dec 10, 2024
1 parent 822fa9f commit 3e01946
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
37 changes: 37 additions & 0 deletions .github/workflows/codspeed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: CodSpeed

on:
push:
branches:
- master
pull_request:
branches:
- master
# `workflow_dispatch` allows CodSpeed to trigger backtest
# performance analysis in order to generate initial data.
workflow_dispatch:

jobs:
benchmarks:
name: Run benchmarks
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable

- name: Install codspeed
uses: taiki-e/install-action@v2
with:
tool: cargo-codspeed

- name: Build benchmarks
run: cargo codspeed build

- name: Run benchmarks
uses: CodSpeedHQ/action@v3
with:
run: cargo codspeed run
token: ${{ secrets.CODSPEED_TOKEN }}
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ arbitrary = { version = "1", features = ["derive"] }
assert2 = "0.3"
colored = "2.1"
clap = { version = "4", features = ["derive", "cargo", "wrap_help", "unicode", "string"] }
criterion = { version = "0.5", features = ["html_reports"] }
criterion = { package = "codspeed-criterion-compat", version = "2.7", features = ["html_reports"] }
directories = "5"
fs-err = "3.0"
get-size2 = { version = "0.1.2", features = ["derive"] }
Expand Down

0 comments on commit 3e01946

Please sign in to comment.