Skip to content

Commit

Permalink
👷 CI: Run benchmarks as part of the CI on pushes to main
Browse files Browse the repository at this point in the history
So if a change brings any performane regressions, we can catch them early on.

I originally wanted to run this workflow on PRs but seems that's not
only not possible from forked repos[1] but also a security hole[2]. Oh
well, at least we can catch the regressions on the main repo.

[1]: benchmark-action/github-action-benchmark#56
[2]: https://github.com/benchmark-action/github-action-benchmark?tab=readme-ov-file#run-only-on-your-branches
  • Loading branch information
zeenix committed Nov 5, 2024
1 parent 0837b08 commit b9620aa
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Benchmarks

on:
push:
branches: [main]

jobs:
benchmarks:
runs-on: ubuntu-latest
permissions:
# deployments permission to deploy GitHub pages website
deployments: write
# contents permission to update benchmark contents in gh-pages branch
contents: write
env:
RUST_BACKTRACE: full
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
- name: Run benchmark
run: cargo bench -p zbus -p zbus_names -p zvariant -- --output-format bencher | tee output.txt
- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
tool: 'cargo'
output-file-path: output.txt
fail-on-alert: true
github-token: ${{ secrets.GITHUB_TOKEN }}
comment-on-alert: true
alert-threshold: 50%
alert-comment-cc-users: '@zeenix'
auto-push: true


0 comments on commit b9620aa

Please sign in to comment.