Skip to content

Commit e25b3b7

Browse files
committed
Add the bare metal submit workflow from the docs
1 parent b6e6321 commit e25b3b7

2 files changed

Lines changed: 33 additions & 0 deletions

File tree

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
on:
2+
pull_request:
3+
types: [opened, reopened, edited, synchronize]
4+
5+
jobs:
6+
submit_pr_benchmarks:
7+
name: Submit PR Benchmarks to Bencher Bare Metal
8+
# DO NOT REMOVE: For handling Fork PRs see Pull Requests from Forks
9+
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
10+
permissions:
11+
checks: write
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v6
15+
- uses: bencherdev/bencher@main
16+
- name: Submit PR Benchmarks with Bencher
17+
run: |
18+
bencher run \
19+
--project example \
20+
--key '${{ secrets.BENCHER_API_KEY }}' \
21+
--branch "$GITHUB_HEAD_REF" \
22+
--start-point "$GITHUB_BASE_REF" \
23+
--start-point-hash '${{ github.event.pull_request.base.sha }}' \
24+
--start-point-clone-thresholds \
25+
--start-point-reset \
26+
--adapter json \
27+
--image example:latest \
28+
--detach \
29+
--github-actions '${{ secrets.GITHUB_TOKEN }}' \
30+
--ci-callback-token '${{ secrets.BENCHER_CALLBACK_TOKEN }}' \
31+
mock

‎README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ The `.github` directory contains example workflows from [how to use Bencher in G
1212
- [Track benchmarks](.github/workflows/fork_pr_benchmarks_track.yml)
1313
- [Archive branches for closed pull requests from forks](.github/workflows/fork_pr_benchmarks_closed.yml)
1414
- Benchmark pull requests on Bare Metal
15+
- [Submit benchmarks as Jobs](.github/workflows/pr_bare_metal_benchmarks.yml)
1516
- [Post results of finished Jobs to pull requests](.github/workflows/pr_bare_metal_benchmarks_attach.yml)
1617

1718
These examples use the [Bencher CLI GitHub Action](https://github.com/marketplace/actions/bencher-cli).
19+
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`.

0 commit comments

Comments
 (0)