Skip to content

Commit

Permalink
ci: add micro-benchmark (#123)
Browse files Browse the repository at this point in the history
  • Loading branch information
v1v authored Aug 31, 2022
1 parent 377731d commit 0032ed4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .ci/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,20 @@ pipeline {
}
}
}
stage('Microbench') {
options { skipDefaultCheckout() }
steps {
deleteDir()
unstash 'source'
withGoEnv(){
dir("${BASE_DIR}"){
sh(label: 'bench', script: '.ci/bench.sh')
sendBenchmarks(file: 'bench.out', index: 'benchmark-go-libaudit', useGoBench: true)
generateGoBenchmarkDiff(file: 'bench.out', filter: 'exclude')
}
}
}
}
}
post {
cleanup {
Expand Down
7 changes: 7 additions & 0 deletions .ci/bench.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash
set -euxo pipefail

go get -d -t ./...
go mod download

go test -count=5 -benchmem -run=XXX -benchtime=100ms -bench='.*' -v $(go list ./... | grep -v /vendor/) | tee bench.out

0 comments on commit 0032ed4

Please sign in to comment.