@@ -2,38 +2,96 @@ name: Go
2
2
3
3
on :
4
4
push :
5
- branches : [master, v9]
5
+ branches : [master, v9, v9.7 ]
6
6
pull_request :
7
- branches : [master, v9]
7
+ branches : [master, v9, v9.7 ]
8
8
9
9
permissions :
10
10
contents : read
11
11
12
12
jobs :
13
- build :
14
- name : build
13
+
14
+ benchmark :
15
+ name : benchmark
15
16
runs-on : ubuntu-latest
16
17
strategy :
17
18
fail-fast : false
18
19
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.0-M05" # 8.0 milestone 5
22
+ - " 7.4.2" # should use redis stack 7.4
23
+ go-version :
24
+ - " 1.23.x"
25
+ - " 1.24.x"
28
26
29
27
steps :
30
28
- name : Set up ${{ matrix.go-version }}
31
- uses : actions/setup-go@v3
29
+ uses : actions/setup-go@v5
32
30
with :
33
31
go-version : ${{ matrix.go-version }}
34
32
35
33
- name : Checkout code
36
- uses : actions/checkout@v3
34
+ uses : actions/checkout@v4
35
+
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-M05"]="8.0-M05-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-M05" # 8.0 milestone 5
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 }}
91
+
92
+ - name : Upload to Codecov
93
+ uses : codecov/codecov-action@v5
94
+ with :
95
+ files : coverage.txt
96
+ token : ${{ secrets.CODECOV_TOKEN }}
37
97
38
- - name : Test
39
- run : make test
0 commit comments