Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run benchmark against main in PRs #855

Merged
merged 5 commits into from
May 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .drone/drone.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,23 @@ local docker(arch, depends_on=[]) =
],
} + constraints.pullRequest + constraints.mainPush,

pipeline('benchmark against main') {
node: {
// To ensure that benchmarks are accurate, run this build on a node that doesn't do parallel builds.
type: 'no-parallel',
},
steps: [
go('benchmark', [
'go test -bench=. -benchmem -count=6 -run=^$ ./... | tee bench-pr.txt',
'git fetch origin main',
'git checkout main',
'go test -bench=. -benchmem -count=6 -run=^$ ./... | tee bench-main.txt',
'go install golang.org/x/perf/cmd/...@latest',
'benchstat bench-main.txt bench-pr.txt',
]),
],
} + constraints.pullRequest,

pipeline('release') {
steps: [
go('fetch-tags', ['git fetch origin --tags']),
Expand Down
26 changes: 25 additions & 1 deletion .drone/drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,30 @@ volumes:
- name: gopath
temp: {}
---
kind: pipeline
name: benchmark against main
node:
type: no-parallel
steps:
- commands:
- go test -bench=. -benchmem -count=6 -run=^$ ./... | tee bench-pr.txt
- git fetch origin main
- git checkout main
- go test -bench=. -benchmem -count=6 -run=^$ ./... | tee bench-main.txt
- go install golang.org/x/perf/cmd/...@latest
- benchstat bench-main.txt bench-pr.txt
image: golang:1.19
name: benchmark
volumes:
- name: gopath
path: /go
trigger:
ref:
- refs/pull/*/head
volumes:
- name: gopath
temp: {}
---
depends_on:
- check
kind: pipeline
Expand Down Expand Up @@ -282,6 +306,6 @@ kind: secret
name: dockerhub_password
---
kind: signature
hmac: adbd6c28d92efbf2968766102c5abe0bbad5a4af1c76e84ada59b2c5cf9c958d
hmac: 2cd20dcbb7e3f252b5379266c5dab621d1c379ae0ceac878be66974b3cae3b79

...