@@ -2,29 +2,27 @@ name: Go
22
33on :
44 push :
5- branches : [master, v9]
5+ branches : [master, v9, v9.7 ]
66 pull_request :
7- branches : [master, v9]
7+ branches : [master, v9, v9.7 ]
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.19.x, 1.20.x, 1.21.x]
20-
21- services :
22- redis :
23- image : redis/redis-stack-server:latest
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.0-M03" # 8.0 milestone 4
22+ - " 7.4.2" # should use redis stack 7.4
23+ go-version :
24+ - " 1.23.x"
25+ - " 1.24.x"
2826
2927 steps :
3028 - name : Set up ${{ matrix.go-version }}
@@ -35,11 +33,65 @@ jobs:
3533 - name : Checkout code
3634 uses : actions/checkout@v4
3735
38- - name : Test
39- run : make test
36+ - name : Setup Test environment
37+ env :
38+ REDIS_VERSION : ${{ matrix.redis-version }}
39+ CLIENT_LIBS_TEST_IMAGE : " redislabs/client-libs-test:${{ matrix.redis-version }}"
40+ run : |
41+ set -e
42+ redis_version_np=$(echo "$REDIS_VERSION" | grep -oP '^\d+.\d+')
43+
44+ # Mapping of redis version to redis testing containers
45+ declare -A redis_version_mapping=(
46+ ["8.0-M03"]="8.0-M04-pre"
47+ ["7.4.2"]="rs-7.4.0-v2"
48+ )
49+ if [[ -v redis_version_mapping[$REDIS_VERSION] ]]; then
50+ echo "REDIS_VERSION=${redis_version_np}" >> $GITHUB_ENV
51+ echo "REDIS_IMAGE=redis:${{ matrix.redis-version }}" >> $GITHUB_ENV
52+ echo "CLIENT_LIBS_TEST_IMAGE=redislabs/client-libs-test:${redis_version_mapping[$REDIS_VERSION]}" >> $GITHUB_ENV
53+ else
54+ echo "Version not found in the mapping."
55+ exit 1
56+ fi
57+ shell : bash
58+ - name : Set up Docker Compose environment with redis ${{ matrix.redis-version }}
59+ run : make docker.start
60+ shell : bash
61+ - name : Benchmark Tests
62+ env :
63+ RCE_DOCKER : " true"
64+ RE_CLUSTER : " false"
65+ run : make bench
66+ shell : bash
67+
68+ test-redis-ce :
69+ name : test-redis-ce
70+ runs-on : ubuntu-latest
71+ strategy :
72+ fail-fast : false
73+ matrix :
74+ redis-version :
75+ - " 8.0-M03" # 8.0 milestone 4
76+ - " 7.4.2" # should use redis stack 7.4
77+ - " 7.2.7" # should redis stack 7.2
78+ go-version :
79+ - " 1.23.x"
80+ - " 1.24.x"
81+
82+ steps :
83+ - name : Checkout code
84+ uses : actions/checkout@v4
85+
86+ - name : Run tests
87+ uses : ./.github/actions/run-tests
88+ with :
89+ go-version : ${{matrix.go-version}}
90+ redis-version : ${{ matrix.redis-version }}
4091
4192 - name : Upload to Codecov
42- uses : codecov/codecov-action@v4
93+ uses : codecov/codecov-action@v5
4394 with :
4495 files : coverage.txt
45- token : ${{ secrets.CODECOV_TOKEN }}
96+ token : ${{ secrets.CODECOV_TOKEN }}
97+
0 commit comments