-
Notifications
You must be signed in to change notification settings - Fork 15
43 lines (36 loc) · 1.19 KB
/
benchmark-go-pr.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: Benchmark Go
on:
pull_request:
branches:
- main
permissions:
contents: read
jobs:
benchmark:
name: Performance regression check
runs-on: ubuntu-latest
permissions:
# allow posting comments to pull request
pull-requests: write
steps:
- name: Fetch Repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- 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