Skip to content

Commit

Permalink
Set up benchmark action
Browse files Browse the repository at this point in the history
Towards #338.
  • Loading branch information
mhutchinson committed Dec 9, 2024
1 parent c30d02c commit 384f481
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/benchmark-go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
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
# allow posting comments to pull request
pull-requests: write

jobs:
benchmark:
name: Performance regression check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
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/[email protected]
with:
tool: 'go'
output-file-path: output.txt
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: true
alert-threshold: "150%"
comment-on-alert: true
fail-on-alert: true

0 comments on commit 384f481

Please sign in to comment.