-
Notifications
You must be signed in to change notification settings - Fork 53
49 lines (40 loc) · 1.21 KB
/
benchmark.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
name: Benchmark Go code
on:
pull_request:
branches:
- main
permissions:
pull-requests: write
jobs:
benchmark:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
show-progress: false
- name: Set up Go
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
with:
go-version-file: go.ver
cache: false
- name: Fetch test rules
run: make -C cmd/pint/bench fetch
- name: Benchmark PR branch
run: |
make benchmark | tee new.txt
- name: Benchmark main branch
run: |
git fetch origin main
git reset --hard FETCH_HEAD
make benchmark | tee old.txt
- name: Diff benchmarks
run: |
git reset --hard ${GITHUB_SHA}
make benchmark-diff
- name: Report
if: ${{ github.event.pull_request.head.repo.full_name == 'cloudflare/pint' }}
uses: thollander/actions-comment-pull-request@e2c37e53a7d2227b61585343765f73a9ca57eda9 # v3.0.0
with:
file-path: benchstat.txt
comment-tag: benchstat