From a3b3b1ff4a1a9b7d7afa13246ebd0c75deb7b0ee Mon Sep 17 00:00:00 2001 From: Everett Pompeii Date: Mon, 28 Sep 2026 06:14:34 +0000 Subject: [PATCH 1/2] Replace the dev attach workflow with the bare metal attach workflow from the docs --- .github/workflows/bare_metal_attach.yml | 52 ------------------- .../pr_bare_metal_benchmarks_attach.yml | 23 ++++++++ README.md | 2 + 3 files changed, 25 insertions(+), 52 deletions(-) delete mode 100644 .github/workflows/bare_metal_attach.yml create mode 100644 .github/workflows/pr_bare_metal_benchmarks_attach.yml diff --git a/.github/workflows/bare_metal_attach.yml b/.github/workflows/bare_metal_attach.yml deleted file mode 100644 index 7425915..0000000 --- a/.github/workflows/bare_metal_attach.yml +++ /dev/null @@ -1,52 +0,0 @@ -on: - repository_dispatch: - types: [bencher_run] - -jobs: - attach_pr_benchmarks: - name: Post PR Benchmark Results from Bencher Bare Metal - permissions: - checks: write - pull-requests: write - runs-on: ubuntu-latest - steps: - - name: Show the type of each dispatch payload field, never its value - run: jq '.client_payload // {} | map_values(if type == "object" then map_values(type) else type end)' "$GITHUB_EVENT_PATH" - - name: Resolve the Bencher CLI commit - id: bencher-cli - run: | - sha="$(git ls-remote https://github.com/bencherdev/bencher refs/heads/u/ep/callback/smoke | cut -f1)" - test -n "$sha" - echo "sha=$sha" >> "$GITHUB_OUTPUT" - echo "key=bencher-cli-$ImageOS-$RUNNER_ARCH-$sha" >> "$GITHUB_OUTPUT" - - name: Restore the Bencher CLI - id: restore-bencher-cli - uses: actions/cache/restore@v5 - with: - path: ~/.bencher-cli - key: ${{ steps.bencher-cli.outputs.key }} - - name: Install the Bencher CLI - if: steps.restore-bencher-cli.outputs.cache-hit != 'true' - env: - BENCHER_SHA: ${{ steps.bencher-cli.outputs.sha }} - run: cargo install --git https://github.com/bencherdev/bencher --rev "$BENCHER_SHA" --locked --root ~/.bencher-cli bencher_cli - - name: Save the Bencher CLI - if: steps.restore-bencher-cli.outputs.cache-hit != 'true' - uses: actions/cache/save@v5 - with: - path: ~/.bencher-cli - key: ${{ steps.bencher-cli.outputs.key }} - - name: Add the Bencher CLI to the path - run: echo "$HOME/.bencher-cli/bin" >> "$GITHUB_PATH" - - name: Post PR Benchmark Results with Bencher - env: - JOB_UUID: ${{ github.event.client_payload.bencher.job }} - PROJECT_SLUG: ${{ github.event.client_payload.bencher.project }} - run: | - bencher run \ - --host https://dev.api.bencher.dev \ - --project "$PROJECT_SLUG" \ - --token '${{ secrets.DEV_BENCHER_API_TOKEN }}' \ - --job "$JOB_UUID" \ - --error-on-alert \ - --github-actions '${{ secrets.GITHUB_TOKEN }}' diff --git a/.github/workflows/pr_bare_metal_benchmarks_attach.yml b/.github/workflows/pr_bare_metal_benchmarks_attach.yml new file mode 100644 index 0000000..33bc827 --- /dev/null +++ b/.github/workflows/pr_bare_metal_benchmarks_attach.yml @@ -0,0 +1,23 @@ +on: + repository_dispatch: + types: [bencher_run] + +jobs: + attach_pr_benchmarks: + name: Post PR Benchmark Results from Bencher Bare Metal + permissions: + checks: write + pull-requests: write + runs-on: ubuntu-latest + steps: + - uses: bencherdev/bencher@main + - name: Post PR Benchmark Results with Bencher + env: + JOB_UUID: ${{ github.event.client_payload.bencher.job }} + run: | + bencher run \ + --project example \ + --key '${{ secrets.BENCHER_API_KEY }}' \ + --job "$JOB_UUID" \ + --error-on-alert \ + --github-actions '${{ secrets.GITHUB_TOKEN }}' diff --git a/README.md b/README.md index 7f57ba4..669e476 100644 --- a/README.md +++ b/README.md @@ -11,5 +11,7 @@ The `.github` directory contains example workflows from [how to use Bencher in G - [Run benchmarks](.github/workflows/fork_pr_benchmarks_run.yml) - [Track benchmarks](.github/workflows/fork_pr_benchmarks_track.yml) - [Archive branches for closed pull requests from forks](.github/workflows/fork_pr_benchmarks_closed.yml) +- Benchmark pull requests on Bare Metal + - [Post results of finished Jobs to pull requests](.github/workflows/pr_bare_metal_benchmarks_attach.yml) These examples use the [Bencher CLI GitHub Action](https://github.com/marketplace/actions/bencher-cli). From 318ffbd7fdf3875c87ee3d3dc7f015d467cd7d2d Mon Sep 17 00:00:00 2001 From: Everett Pompeii Date: Mon, 28 Sep 2026 06:14:44 +0000 Subject: [PATCH 2/2] Sync the workflows with their GitHub Actions docs blocks --- .github/workflows/base_benchmarks.yml | 2 +- .github/workflows/fork_pr_benchmarks_track.yml | 2 +- .github/workflows/pr_benchmarks.yml | 2 +- .github/workflows/pr_benchmarks_closed.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/base_benchmarks.yml b/.github/workflows/base_benchmarks.yml index 77bca5d..cd2c11b 100644 --- a/.github/workflows/base_benchmarks.yml +++ b/.github/workflows/base_benchmarks.yml @@ -23,7 +23,7 @@ jobs: --threshold-max-sample-size 64 \ --threshold-upper-boundary 0.99 \ --thresholds-reset \ - --err \ + --error-on-alert \ --adapter json \ --github-actions '${{ secrets.GITHUB_TOKEN }}' \ bencher mock diff --git a/.github/workflows/fork_pr_benchmarks_track.yml b/.github/workflows/fork_pr_benchmarks_track.yml index 1babf2f..a666b92 100644 --- a/.github/workflows/fork_pr_benchmarks_track.yml +++ b/.github/workflows/fork_pr_benchmarks_track.yml @@ -50,7 +50,7 @@ jobs: --start-point-clone-thresholds \ --start-point-reset \ --testbed ubuntu-latest \ - --err \ + --error-on-alert \ --adapter json \ --github-actions '${{ secrets.GITHUB_TOKEN }}' \ --ci-number "$PR_NUMBER" \ diff --git a/.github/workflows/pr_benchmarks.yml b/.github/workflows/pr_benchmarks.yml index 354c758..99ca64c 100644 --- a/.github/workflows/pr_benchmarks.yml +++ b/.github/workflows/pr_benchmarks.yml @@ -25,7 +25,7 @@ jobs: --start-point-clone-thresholds \ --start-point-reset \ --testbed ubuntu-latest \ - --err \ + --error-on-alert \ --adapter json \ --github-actions '${{ secrets.GITHUB_TOKEN }}' \ bencher mock diff --git a/.github/workflows/pr_benchmarks_closed.yml b/.github/workflows/pr_benchmarks_closed.yml index c94af0f..a255f37 100644 --- a/.github/workflows/pr_benchmarks_closed.yml +++ b/.github/workflows/pr_benchmarks_closed.yml @@ -5,7 +5,7 @@ on: jobs: archive_pr_branch: name: Archive closed PR branch with Bencher - # DO NOT REMOVE: For handling Fork PRs see Pull Requests from Forks + # DO NOT REMOVE: For handling Fork PRs see Pull Requests from Forks if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository runs-on: ubuntu-latest steps: