File tree Expand file tree Collapse file tree 2 files changed +32
-4
lines changed Expand file tree Collapse file tree 2 files changed +32
-4
lines changed Original file line number Diff line number Diff line change 3535 with :
3636 files : coverage.txt
3737 token : ${{ secrets.CODECOV_TOKEN }}
38+
39+ benchmark :
40+ name : benchmark
41+ runs-on : ubuntu-latest
42+ strategy :
43+ fail-fast : false
44+ matrix :
45+ go-version : [1.21.x, 1.23.x]
46+
47+ steps :
48+ - name : Set up ${{ matrix.go-version }}
49+ uses : actions/setup-go@v5
50+ with :
51+ go-version : ${{ matrix.go-version }}
52+
53+ - name : Checkout code
54+ uses : actions/checkout@v4
55+
56+ - name : Benchmark Tests
57+ run : make bench
58+
3859
3960 test-redis-ce :
4061 name : test-redis-ce
Original file line number Diff line number Diff line change 11GO_MOD_DIRS := $(shell find . -type f -name 'go.mod' -exec dirname {} \; | sort)
22export REDIS_MAJOR_VERSION := 7
33
4- test : testdeps
4+ redisstackdocker.start :
55 docker start go-redis-redis-stack || docker run -d --name go-redis-redis-stack -p 6379:6379 -e REDIS_ARGS=" --enable-debug-command yes --enable-module-command yes" redis/redis-stack-server:latest
6+
7+ redisstackdocker.stop :
8+ docker stop go-redis-redis-stack
9+
10+ test : testdeps
11+ $(MAKE ) redisstackdocker.start
612 $(eval GO_VERSION := $(shell go version | cut -d " " -f 3 | cut -d. -f2) )
713 set -e; for dir in $( GO_MOD_DIRS) ; do \
814 if echo " $$ {dir}" | grep -q " ./example" && [ " $( GO_VERSION) " = " 19" ]; then \
@@ -14,19 +20,20 @@ test: testdeps
1420 go mod tidy -compat=1.18 && \
1521 go test && \
1622 go test ./... -short -race && \
17- go test ./... -run=NONE -bench=. -benchmem && \
1823 env GOOS=linux GOARCH=386 go test && \
1924 go test -coverprofile=coverage.txt -covermode=atomic ./... && \
2025 go vet); \
2126 done
2227 cd internal/customvet && go build .
2328 go vet -vettool ./internal/customvet/customvet
24- docker stop go-redis-redis-stack
29+ $( MAKE ) redisstackdocker. stop
2530
2631testdeps : testdata/redis/src/redis-server
2732
28- bench : testdeps
33+ bench :
34+ $(MAKE ) redisstackdocker.start
2935 go test ./... -test.run=NONE -test.bench=. -test.benchmem
36+ $(MAKE ) redisstackdocker.stop
3037
3138.PHONY : all test testdeps bench fmt
3239
You can’t perform that action at this time.
0 commit comments