Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/pr_bare_metal_benchmarks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
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 }}' \
--exec \
mock
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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), whose entrypoint is `bencher` and which has no shell, so its benchmark command is `mock` with `--exec`.
Loading