diff --git a/.ci/Jenkinsfile b/.ci/Jenkinsfile index 93a1fe0..3a7d6f3 100644 --- a/.ci/Jenkinsfile +++ b/.ci/Jenkinsfile @@ -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 { diff --git a/.ci/bench.sh b/.ci/bench.sh new file mode 100755 index 0000000..47511ad --- /dev/null +++ b/.ci/bench.sh @@ -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