From 9d1f909e317417643cb41a007d62f56dc117908e Mon Sep 17 00:00:00 2001 From: Christian M Date: Fri, 21 Feb 2025 18:40:39 +0100 Subject: [PATCH] :bug: fix bench --- .github/workflows/bench.yml | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index a68accb..0fec820 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -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 @@ -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" @@ -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 @@ -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