From e25b3b7e77326d624362e8a27981dfc261cb6b68 Mon Sep 17 00:00:00 2001 From: Everett Pompeii Date: Mon, 28 Sep 2026 06:15:52 +0000 Subject: [PATCH 1/2] Add the bare metal submit workflow from the docs --- .../workflows/pr_bare_metal_benchmarks.yml | 31 +++++++++++++++++++ README.md | 2 ++ 2 files changed, 33 insertions(+) create mode 100644 .github/workflows/pr_bare_metal_benchmarks.yml diff --git a/.github/workflows/pr_bare_metal_benchmarks.yml b/.github/workflows/pr_bare_metal_benchmarks.yml new file mode 100644 index 0000000..d70249c --- /dev/null +++ b/.github/workflows/pr_bare_metal_benchmarks.yml @@ -0,0 +1,31 @@ +on: + pull_request: + types: [opened, reopened, edited, synchronize] + +jobs: + submit_pr_benchmarks: + name: Submit PR Benchmarks to Bencher Bare Metal + # 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 + permissions: + checks: write + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: bencherdev/bencher@main + - name: Submit PR Benchmarks with Bencher + run: | + bencher run \ + --project example \ + --key '${{ secrets.BENCHER_API_KEY }}' \ + --branch "$GITHUB_HEAD_REF" \ + --start-point "$GITHUB_BASE_REF" \ + --start-point-hash '${{ github.event.pull_request.base.sha }}' \ + --start-point-clone-thresholds \ + --start-point-reset \ + --adapter json \ + --image example:latest \ + --detach \ + --github-actions '${{ secrets.GITHUB_TOKEN }}' \ + --ci-callback-token '${{ secrets.BENCHER_CALLBACK_TOKEN }}' \ + mock diff --git a/README.md b/README.md index 669e476..e1487df 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,8 @@ The `.github` directory contains example workflows from [how to use Bencher in G - [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 + - [Submit benchmarks as Jobs](.github/workflows/pr_bare_metal_benchmarks.yml) - [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). +The bare metal example's benchmark Image is the [Bencher CLI image](https://github.com/bencherdev/bencher/pkgs/container/bencher), so its benchmark command is `mock`. From 87f6e2dc0a2fe6f2a2446b60a8e58078b5c85263 Mon Sep 17 00:00:00 2001 From: Everett Pompeii Date: Mon, 28 Sep 2026 07:34:44 +0000 Subject: [PATCH 2/2] Run mock with --exec, since the Bencher CLI image has no shell --- .github/workflows/pr_bare_metal_benchmarks.yml | 1 + README.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr_bare_metal_benchmarks.yml b/.github/workflows/pr_bare_metal_benchmarks.yml index d70249c..1a81bbe 100644 --- a/.github/workflows/pr_bare_metal_benchmarks.yml +++ b/.github/workflows/pr_bare_metal_benchmarks.yml @@ -28,4 +28,5 @@ jobs: --detach \ --github-actions '${{ secrets.GITHUB_TOKEN }}' \ --ci-callback-token '${{ secrets.BENCHER_CALLBACK_TOKEN }}' \ + --exec \ mock diff --git a/README.md b/README.md index e1487df..18a3380 100644 --- a/README.md +++ b/README.md @@ -16,4 +16,4 @@ The `.github` directory contains example workflows from [how to use Bencher in G - [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). -The bare metal example's benchmark Image is the [Bencher CLI image](https://github.com/bencherdev/bencher/pkgs/container/bencher), so its benchmark command is `mock`. +The bare metal example's benchmark Image is the [Bencher CLI image](https://github.com/bencherdev/bencher/pkgs/container/bencher), whose entrypoint is `bencher` and which has no shell, so its benchmark command is `mock` with `--exec`.