-
Notifications
You must be signed in to change notification settings - Fork 26
52 lines (50 loc) · 1.75 KB
/
bench-diff.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
44
45
46
47
48
49
50
51
52
name: bench-diff
on:
push:
pull_request_target:
types: [labeled]
permissions:
contents: read
jobs:
run-benchdiff:
runs-on: ubuntu-latest
# Support for branches, non-forked-prs or forked-prs with a label
if: |
contains(github.event.pull_request.labels.*.name, 'safe-to-test') ||
github.event_name != 'pull_request' ||
(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false)
permissions:
checks: write
steps:
- name: Debug event types
run: |
echo "${{ github.event_name != 'pull_request' && github.sha || github.event.pull_request.head.sha }}"
echo "github.sha=${{ github.sha }}"
echo "github.event.pull_request.head.sha=${{ github.event.pull_request.head.sha }}"
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
ref: ${{ github.event_name != 'pull_request' && github.sha || github.event.pull_request.head.sha }}
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
# Version: https://github.com/WillAbides/benchdiff-action/releases/tag/v0.3.3
- uses: WillAbides/benchdiff-action@990b4c50b5420b485bf87e42c9f18234eba76fbc
id: benchdiff
with:
benchdiff_version: 0.9.1
status_sha: ${{ github.event_name != 'pull_request' && github.sha || github.event.pull_request.head.sha }}
status_name: benchdiff-result
status_on_degraded: neutral
# See https://github.com/WillAbides/benchdiff
benchdiff_args: |
--base-ref=origin/main
--cpu=1,2
--count=5
--warmup-count=1
--warmup-time=10ms
--benchtime=100ms
--tolerance=20
--benchmem
--debug