Skip to content

Commit

Permalink
improve benchmark action
Browse files Browse the repository at this point in the history
  • Loading branch information
BrendanChou committed May 16, 2024
1 parent f75f789 commit dab2c4a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 11 deletions.
33 changes: 23 additions & 10 deletions .github/workflows/protocol-benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,30 @@ jobs:
run:
working-directory: ./protocol
steps:
-
name: Check out repository code
- name: Check out repository code
uses: actions/checkout@v3
-
name: Setup Golang
- name: Setup Golang
uses: actions/setup-go@v3
with:
go-version: 1.22
-
name: Ensure `go.mod` is up to date
run: go mod tidy && git diff --exit-code
-
name: Run Benchmarks
run: make benchmark
- name: Run Benchmarks
run: make benchmark | tee benchmark_output.txt
- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
tool: 'go'
output-file-path: benchmark_output.txt
- name: Download previous benchmark data
uses: actions/cache@v4
with:
path: ./cache
key: ${{ runner.os }}-benchmark
- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
tool: 'go'
output-file-path: benchmark_output.txt
external-data-json-path: ./cache/benchmark-data.json
github-token: ${{ secrets.GITHUB_TOKEN }}
comment-on-alert: true
alert-comment-cc-users: '@brendanchou'
2 changes: 1 addition & 1 deletion protocol/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ test-unit-and-integration:
@VERSION=$(VERSION) go test -mod=readonly -tags='integration_test test_ledger_mock $(build_tags)' ./...

benchmark:
@VERSION=$(VERSION) go test -mod=readonly -tags='$(build_tags)' -run=^# -bench=. -count 5 -benchmem ./...
@VERSION=$(VERSION) go test -mod=readonly -tags='$(build_tags)' -run=^# -bench=. -benchtime=5s -benchmem ./...

test-container:
@SKIP_DISABLED=true VERSION=$(VERSION) go test -mod=readonly -tags='container_test $(build_tags)' ./...
Expand Down

0 comments on commit dab2c4a

Please sign in to comment.