Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Benchmarks] Comment on PRs with benchmark scores #413

Merged
merged 3 commits into from
Dec 10, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ permissions:
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:
Expand All @@ -37,5 +35,4 @@ jobs:
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: true
alert-threshold: "150%"
comment-on-alert: true
fail-on-alert: true
38 changes: 38 additions & 0 deletions .github/workflows/benchmark-go-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Benchmark Go

on:
pull_request:
branches:
- main

permissions:
# allow posting comments to pull request
pull-requests: 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: false
alert-threshold: "150%"
fail-on-alert: true
comment-on-alert: true # notify on PR if alert triggers
summary-always: true # always comment on PRs to leave job summary
Loading