Skip to content

Commit

Permalink
Add CodSpeed for benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
Ogeon committed Sep 1, 2023
1 parent 67279cf commit cf2e170
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
on:
push:
branches:
- master
paths:
- '**.rs'
pull_request:
paths:
- '**.rs'
# `workflow_dispatch` allows CodSpeed to trigger backtest
# performance analysis in order to generate initial data.
workflow_dispatch:

name: Benchmark pull requests
jobs:
runBenchmark:
Expand All @@ -11,9 +20,16 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: dtolnay/rust-toolchain@stable
- uses: boa-dev/criterion-compare-action@v3
- name: Setup rust toolchain, cache and cargo-codspeed binary
uses: moonrepo/setup-rust@v0
with:
channel: stable
cache-target: release
bins: cargo-codspeed
- name: Build the benchmark target(s)
run: cargo codspeed build --all-features
- name: Run the benchmarks
uses: CodSpeedHQ/action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
branchName: ${{ github.base_ref }}
features: "wide"
run: cargo codspeed run
token: ${{ secrets.CODSPEED_TOKEN }}

0 comments on commit cf2e170

Please sign in to comment.