Skip to content

Commit

Permalink
🐛 fix bench
Browse files Browse the repository at this point in the history
  • Loading branch information
chriamue committed Feb 21, 2025
1 parent 0878c72 commit 9d1f909
Showing 1 changed file with 21 additions and 11 deletions.
32 changes: 21 additions & 11 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:
# Allow manual triggering
workflow_dispatch:

permissions:
contents: write # Required for pushing to gh-pages
deployments: write

jobs:
benchmark:
name: Run tests and benchmarks
Expand All @@ -20,6 +24,14 @@ jobs:
with:
fetch-depth: 1

- name: Checkout gh-pages branch
uses: actions/checkout@v4
with:
ref: gh-pages
path: gh-pages
fetch-depth: 0
continue-on-error: true # If the branch doesn't exist, it's okay

- uses: jetli/wasm-pack-action@v0.4.0
with:
version: "latest"
Expand All @@ -33,7 +45,7 @@ jobs:
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
toolchain: nightly # Use nightly for Criterion
override: true
components: rustfmt, clippy
targets: wasm32-unknown-unknown
Expand Down Expand Up @@ -64,24 +76,22 @@ jobs:
- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
name: Rust Benchmark
tool: "criterion"
output-file-path: target/criterion/**/new/*.json
alert-threshold: "150%"
name: Criterion.rs Benchmark
tool: cargo
output-file-path: "target/criterion/**/new/benchmark.json"
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: true
# Comment the following lines to use GitHub Pages instead
gh-pages-branch: gh-pages
benchmark-data-dir-path: dev/bench/data
# Uncomment the following lines to publish to GitHub Pages
# publish-to-github-pages: true
# github-pages-branch: gh-pages
# static-site-dir: dev/bench/
alert-threshold: "200%"
comment-on-alert: true
fail-on-alert: true
alert-comment-cc-users: "@chriamue"

- name: Check benchmark results
if: github.event_name == 'pull_request'
run: |
if [ -f dev/bench/data/latest.json ]; then
if [ -f gh-pages/dev/bench/data/latest.json ]; then
echo "Comparing benchmark results..."
fi
Expand Down

0 comments on commit 9d1f909

Please sign in to comment.