-
Notifications
You must be signed in to change notification settings - Fork 378
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Add a new benchmark recording workflow.
- Loading branch information
Showing
2 changed files
with
42 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: benchmark | ||
on: | ||
pull_request: # for testing | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
benchmark: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
# For benchmark-action summary-always | ||
issues: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version-file: 'go.mod' | ||
cache: true | ||
- name: benchmark | ||
env: | ||
HEAD_REF: ${{ env.GITHUB_REF_NAME }} | ||
run: | | ||
BENCH_COUNT=1 make bench | ||
- uses: actions/cache@v4 | ||
with: | ||
path: ./cache | ||
key: ${{ runner.os }}-benchmark | ||
- uses: benchmark-action/github-action-benchmark@v1 | ||
with: | ||
# What benchmark tool the output.txt came from | ||
tool: 'go' | ||
# Where the output from the benchmark tool is stored | ||
output-file-path: test-results/benchmark-results-${{ env.GITHUB_REF_NAME }}.txt | ||
# Where the previous data file is stored | ||
external-data-json-path: ./cache/benchmark-data.json | ||
# Workflow will fail when an alert happens | ||
fail-on-alert: true | ||
comment-on-alert: true | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
summary-always: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters