@@ -2,38 +2,99 @@ name: Go
22
33on :
44 push :
5- branches : [master, v9]
5+ branches : [master, v9, v9.7, v9.8, 'ndyakov/*', 'ofekshenawa/*', 'htemelski-redis/*', 'ce/*' ]
66 pull_request :
7- branches : [master, v9]
7+ branches : [master, v9, v9.7, v9.8, 'ndyakov/*', 'ofekshenawa/*', 'htemelski-redis/*', 'ce/*' ]
88
99permissions :
1010 contents : read
1111
1212jobs :
13- build :
14- name : build
13+
14+ benchmark :
15+ name : benchmark
1516 runs-on : ubuntu-latest
1617 strategy :
1718 fail-fast : false
1819 matrix :
19- go-version : [1.18.x, 1.19.x]
20-
21- services :
22- redis :
23- image : redis
24- options : >-
25- --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5
26- ports :
27- - 6379:6379
20+ redis-version :
21+ - " 8.2.x" # Redis CE 8.2
22+ - " 8.0.x" # Redis CE 8.0
23+ - " 7.4.x" # Redis stack 7.4
24+ go-version :
25+ - " 1.23.x"
26+ - " 1.24.x"
2827
2928 steps :
3029 - name : Set up ${{ matrix.go-version }}
31- uses : actions/setup-go@v3
30+ uses : actions/setup-go@v5
3231 with :
3332 go-version : ${{ matrix.go-version }}
3433
3534 - name : Checkout code
36- uses : actions/checkout@v3
35+ uses : actions/checkout@v4
36+
37+ - name : Setup Test environment
38+ env :
39+ REDIS_VERSION : ${{ matrix.redis-version }}
40+ CLIENT_LIBS_TEST_IMAGE : " redislabs/client-libs-test:${{ matrix.redis-version }}"
41+ run : |
42+ set -e
43+ redis_version_np=$(echo "$REDIS_VERSION" | grep -oP '^\d+.\d+')
44+
45+ # Mapping of redis version to redis testing containers
46+ declare -A redis_version_mapping=(
47+ ["8.2.x"]="8.2-rc2-pre"
48+ ["8.0.x"]="8.0.2"
49+ ["7.4.x"]="rs-7.4.0-v5"
50+ )
51+ if [[ -v redis_version_mapping[$REDIS_VERSION] ]]; then
52+ echo "REDIS_VERSION=${redis_version_np}" >> $GITHUB_ENV
53+ echo "REDIS_IMAGE=redis:${{ matrix.redis-version }}" >> $GITHUB_ENV
54+ echo "CLIENT_LIBS_TEST_IMAGE=redislabs/client-libs-test:${redis_version_mapping[$REDIS_VERSION]}" >> $GITHUB_ENV
55+ else
56+ echo "Version not found in the mapping."
57+ exit 1
58+ fi
59+ shell : bash
60+ - name : Set up Docker Compose environment with redis ${{ matrix.redis-version }}
61+ run : make docker.start
62+ shell : bash
63+ - name : Benchmark Tests
64+ env :
65+ RCE_DOCKER : " true"
66+ RE_CLUSTER : " false"
67+ run : make bench
68+ shell : bash
69+
70+ test-redis-ce :
71+ name : test-redis-ce
72+ runs-on : ubuntu-latest
73+ strategy :
74+ fail-fast : false
75+ matrix :
76+ redis-version :
77+ - " 8.2.x" # Redis CE 8.2
78+ - " 8.0.x" # Redis CE 8.0
79+ - " 7.4.x" # Redis stack 7.4
80+ - " 7.2.x" # Redis stack 7.2
81+ go-version :
82+ - " 1.23.x"
83+ - " 1.24.x"
84+
85+ steps :
86+ - name : Checkout code
87+ uses : actions/checkout@v4
88+
89+ - name : Run tests
90+ uses : ./.github/actions/run-tests
91+ with :
92+ go-version : ${{matrix.go-version}}
93+ redis-version : ${{ matrix.redis-version }}
94+
95+ - name : Upload to Codecov
96+ uses : codecov/codecov-action@v5
97+ with :
98+ files : coverage.txt
99+ token : ${{ secrets.CODECOV_TOKEN }}
37100
38- - name : Test
39- run : make test
0 commit comments