-
Notifications
You must be signed in to change notification settings - Fork 12
56 lines (54 loc) · 1.72 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
53
54
55
56
name: bench-diff
on:
push:
pull_request_target:
types: [labeled, synchronize]
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') ||
! startsWith(github.event_name, 'pull_request') ||
(startsWith(github.event_name, 'pull_request') && github.event.pull_request.head.repo.fork == false)
permissions:
checks: write
steps:
- name: Get sha commit
id: event
run: |
echo "DEBUG: event type(${{ github.event_name }})"
ref="${{ github.sha }}"
if [ "${{ startsWith(github.event_name, 'pull_request') }}" = "true" ] ; then
ref="${{ github.event.pull_request.head.sha }}"
fi
echo "ref=${ref}" >> "$GITHUB_OUTPUT"
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
ref: ${{ steps.event.outputs.ref }}
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
# Version: https://github.com/WillAbides/benchdiff-action/releases/tag/v0.3.5
- uses: WillAbides/benchdiff-action@990b4c50b5420b485bf87e42c9f18234eba76fbc
id: benchdiff
with:
benchdiff_version: 0.9.1
status_sha: ${{ steps.event.outputs.ref }}
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