-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
One workflow generates the report and publishes it on commits to main. The other attempts only to comment on PRs.
- Loading branch information
1 parent
3ffe21f
commit 66b73d4
Showing
2 changed files
with
38 additions
and
8 deletions.
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,38 @@ | ||
name: Benchmark Go | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
# deployments permission to deploy GitHub pages website | ||
deployments: write | ||
# contents permission to update benchmark contents in gh-pages branch | ||
contents: write | ||
|
||
jobs: | ||
benchmark: | ||
name: Performance regression check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Fetch Repo | ||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
|
||
- name: Install Go | ||
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.1.0 | ||
with: | ||
go-version-file: go.mod | ||
|
||
- name: Run benchmark | ||
run: set -o pipefail; go test ./... -benchmem -run=^$ -bench . | tee output.txt | ||
|
||
- name: Store benchmark result | ||
uses: benchmark-action/github-action-benchmark@d48d326b4ca9ba73ca0cd0d59f108f9e02a381c7 # v1.20.4 | ||
with: | ||
tool: 'go' | ||
output-file-path: output.txt | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
auto-push: true | ||
alert-threshold: "150%" | ||
fail-on-alert: 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