From 092e35e730e3574c7bd42fc5376de240dfb43bdd Mon Sep 17 00:00:00 2001 From: Marco Manino Date: Tue, 9 Jul 2024 10:05:53 +0200 Subject: [PATCH] Stable benchmarks (#120) --- .github/workflows/go.yaml | 11 ++++++++++- Makefile | 3 ++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml index 9d60d38b..9c9a3d85 100644 --- a/.github/workflows/go.yaml +++ b/.github/workflows/go.yaml @@ -5,6 +5,9 @@ on: branches: [master] pull_request: +env: + BENCH_COUNT: 7 + jobs: code-quality: name: Code Quality @@ -73,8 +76,14 @@ jobs: - name: go mod download run: go mod download + - name: Install Dqlite + run: | + sudo add-apt-repository -y ppa:dqlite/dev + sudo apt install libdqlite-dev + - name: Run benchmarks - run: make go.bench + run: | + go test -tags libsqlite3 -v -p 1 ./... -run "^$$" -bench . -benchmem -count $BENCH_COUNT build: name: Build k8s-dqlite diff --git a/Makefile b/Makefile index 2e8cef58..be021b13 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,6 @@ DQLITE_BUILD_SCRIPTS_DIR ?= $(shell pwd)/hack GO_SOURCES = $(shell find . -name '*.go') +BENCH_COUNT ?= 7 ## Development go.fmt: @@ -13,7 +14,7 @@ go.test: $(DQLITE_BUILD_SCRIPTS_DIR)/static-go-test.sh -v -p 1 ./... go.bench: - $(DQLITE_BUILD_SCRIPTS_DIR)/static-go-test.sh -v -p 1 ./... -run "^$$" -bench "Benchmark" -benchmem + $(DQLITE_BUILD_SCRIPTS_DIR)/static-go-test.sh -v -p 1 ./... -run "^$$" -bench "Benchmark" -benchmem -count $(BENCH_COUNT) ## Static Builds static: bin/static/k8s-dqlite bin/static/dqlite