@@ -18,25 +18,59 @@ jobs:
18
18
strategy :
19
19
fail-fast : false
20
20
matrix :
21
- redis :
22
- - 6.2.13
23
- - 7.2.0
24
- rust :
25
- - stable
26
- - beta
27
- - nightly
28
- - 1.65.0
21
+ config :
22
+ [
23
+ # Different DB cases:
24
+ {
25
+ rust : stable,
26
+ db-org : redis,
27
+ db-name : redis,
28
+ db-version : 6.2.13
29
+ },
30
+ {
31
+ rust : stable,
32
+ db-org : redis,
33
+ db-name : redis,
34
+ db-version : 7.2.4
35
+ },
36
+ {
37
+ rust : stable,
38
+ db-org : valkey-io,
39
+ db-name : valkey,
40
+ db-version : 7.2.6
41
+ },
42
+
43
+ # Different rust cases
44
+ {
45
+ rust : beta,
46
+ db-org : redis,
47
+ db-name : redis,
48
+ db-version : 7.2.4
49
+ },
50
+ {
51
+ rust : nightly,
52
+ db-org : redis,
53
+ db-name : redis,
54
+ db-version : 7.2.4
55
+ },
56
+ {
57
+ rust : 1.65.0,
58
+ db-org : redis,
59
+ db-name : redis,
60
+ db-version : 7.2.4
61
+ }
62
+ ]
29
63
30
64
steps :
31
65
32
- - name : Cache redis
66
+ - name : Cache DB
33
67
id : cache-redis
34
68
uses : actions/cache@v4
35
69
with :
36
70
path : |
37
71
~/redis-cli
38
72
~/redis-server
39
- key : ${{ runner.os }}-${{ matrix.redis }}-redis
73
+ key : ${{ runner.os }}-${{ matrix.config.db-name }}-${{ matrix.config.db-version }}
40
74
41
75
- name : Cache RedisJSON
42
76
id : cache-redisjson
@@ -46,13 +80,17 @@ jobs:
46
80
/tmp/librejson.so
47
81
key : ${{ runner.os }}-redisjson
48
82
49
- - name : Install redis
83
+ - name : Install DB
50
84
if : steps.cache-redis.outputs.cache-hit != 'true'
51
85
run : |
52
86
sudo apt-get update
53
- wget https://github.com/redis/redis/archive/${{ matrix.redis }}.tar.gz;
54
- tar -xzvf ${{ matrix.redis }}.tar.gz;
55
- pushd redis-${{ matrix.redis }} && BUILD_TLS=yes make && sudo mv src/redis-server src/redis-cli $HOME && popd;
87
+ wget https://github.com/${{ matrix.config.db-org }}/${{ matrix.config.db-name }}/archive/${{ matrix.config.db-version }}.tar.gz;
88
+ tar -xzvf ${{ matrix.config.db-version }}.tar.gz;
89
+ pushd ${{ matrix.config.db-name }}-${{ matrix.config.db-version }} &&
90
+ BUILD_TLS=yes make install &&
91
+ sudo mv src/${{ matrix.config.db-name }}-server $HOME/redis-server &&
92
+ sudo mv src/${{ matrix.config.db-name }}-cli $HOME/redis-cli &&
93
+ popd;
56
94
echo $PATH
57
95
58
96
- name : set PATH
62
100
- name : Install Rust
63
101
uses : dtolnay/rust-toolchain/@master
64
102
with :
65
- toolchain : ${{ matrix.rust }}
103
+ toolchain : ${{ matrix.config. rust }}
66
104
components : rustfmt
67
105
68
106
- uses : Swatinem/rust-cache@v2
73
111
run : make test
74
112
75
113
- name : Checkout RedisJSON
76
- if : steps.cache-redisjson.outputs.cache-hit != 'true' && matrix.redis != '6.2.13'
114
+ if : steps.cache-redisjson.outputs.cache-hit != 'true' && matrix.config.db-version != '6.2.13'
77
115
uses : actions/checkout@v4
78
116
with :
79
117
repository : " RedisJSON/RedisJSON"
94
132
# This shouldn't cause issues in the future so long as no profiles or patches
95
133
# are applied to the workspace Cargo.toml file
96
134
- name : Compile RedisJSON
97
- if : steps.cache-redisjson.outputs.cache-hit != 'true' && matrix.redis != '6.2.13'
135
+ if : steps.cache-redisjson.outputs.cache-hit != 'true' && matrix.config.db-version != '6.2.13'
98
136
run : |
99
137
cp ./Cargo.toml ./Cargo.toml.actual
100
138
echo $'\nexclude = [\"./__ci/redis-json\"]' >> Cargo.toml
@@ -104,10 +142,10 @@ jobs:
104
142
rm -rf ./__ci/redis-json
105
143
106
144
- name : Run module-specific tests
107
- if : matrix.redis != '6.2.13'
145
+ if : matrix.config.db-version != '6.2.13'
108
146
run : make test-module
109
147
env :
110
- REDIS_VERSION : ${{ matrix.redis }}
148
+ REDIS_VERSION : ${{ matrix.config.db-version }}
111
149
112
150
- name : Check features
113
151
run : |
0 commit comments