File tree 1 file changed +13
-24
lines changed
1 file changed +13
-24
lines changed Original file line number Diff line number Diff line change @@ -12,38 +12,27 @@ jobs:
12
12
bench :
13
13
name : Performance regression check
14
14
runs-on : ubuntu-latest
15
- timeout-minutes : 5
16
15
steps :
17
- - name : Checkout (previous)
18
- uses : actions/checkout@v3
19
- with :
20
- ref : ${{ github.base_ref }}
21
- path : previous
22
-
23
16
- name : Checkout (new)
24
17
uses : actions/checkout@v3
25
- with :
26
- path : new
27
18
28
19
- name : Set up Go
29
20
uses : actions/setup-go@v4
30
21
with :
31
22
go-version-file : ' ${{ github.workspace }}/new/go.mod'
32
23
33
- - name : Install dependencies
34
- run : go install golang.org/x/perf/cmd/benchstat@latest
24
+ - name : Get dependencies
25
+ run : go mod download
35
26
36
- - name : Run Benchmark (previous)
37
- timeout-minutes : 5
27
+ - name : Benchmark against GITHUB_BASE_REF
38
28
run : |
39
- cd previous
40
- go test -bench=. -benchmem -benchtime=100ms -count=10 ./... > benchmark.txt
41
-
42
- - name : Run Benchmark (new)
43
- timeout-minutes : 5
44
- run : |
45
- cd new
46
- go test -bench=. -benchmem -benchtime=100ms -count=10 ./... > benchmark.txt
47
-
48
- - name : Run Benchstat
49
- run : benchstat previous/benchmark.txt new/benchmark.txt
29
+ go install golang.org/x/perf/cmd/benchstat@latest
30
+ echo "New Commit:"
31
+ git log -1 --format="%H"
32
+ go test -bench=. -benchmem -benchtime=100ms -count=10 > /tmp/new.txt
33
+ git reset --hard HEAD
34
+ git checkout $GITHUB_BASE_REF
35
+ echo "Base Commit:"
36
+ git log -1 --format="%H"
37
+ go test -bench=. -benchmem -benchtime=100ms -count=10 > /tmp/old.txt
38
+ $GOBIN/benchstat /tmp/old.txt /tmp/new.txt
You can’t perform that action at this time.
0 commit comments