File tree 2 files changed +37
-0
lines changed
2 files changed +37
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : go benchmarks
2
+ on :
3
+ push :
4
+ branches :
5
+ - main
6
+ pull_request :
7
+
8
+ jobs :
9
+ benchmark :
10
+ name : benchmark regression check
11
+ runs-on : ubuntu-latest
12
+ steps :
13
+ - uses : actions/checkout@v4
14
+ - uses : actions/setup-go@v4
15
+ with :
16
+ go-version-file : ' go.mod'
17
+ - name : Run benchmark
18
+ run : make bench.txt
19
+ - name : Download previous benchmark data
20
+ uses : actions/cache@v4
21
+ with :
22
+ path : ./cache
23
+ key : ${{ runner.os }}-benchmark
24
+ - name : Store benchmark result
25
+ uses : benchmark-action/github-action-benchmark@v1
26
+ with :
27
+ tool : ' go'
28
+ output-file-path : bench.txt
29
+ external-data-json-path : ./cache/benchmark-data.json
30
+ fail-on-alert : true
31
+ comment-on-alert : true
32
+ comment-always : true
33
+ github-token : ${{ secrets.GITHUB_TOKEN }}
34
+ alert-threshold : " 200%"
Original file line number Diff line number Diff line change 33
33
test :
34
34
go test $(TEST_ARGS ) -coverprofile=c.out ./...
35
35
36
+ bench.txt :
37
+ go test -benchmem -run=xxx -bench . ./... | tee $@
38
+
36
39
bin/fscli_% v7$(call extension,$(GOOS ) ) : $(shell find . -type f -name "* .go")
37
40
GOOS=$(shell echo $* | cut -f1 -d-) \
38
41
GOARCH=$(shell echo $* | cut -f2 -d- ) \
You can’t perform that action at this time.
0 commit comments