Skip to content

Commit 0005c1b

Browse files
authored
CI: Add Support for Valkey 6.2, 7.0 and 7.2 (#1711)
- Transitioned the engine building process to be sourced from the Valkey repository. - Introduced compatibility with the following engine versions: Valkey and Redis 6.2 Valkey and Redis 7.0 Valkey and Redis 7.2 (first stable release of Valkey 7.2.5.) - Engine Installation Checks: Added check that the engine is installed with the requested version. - Moved the engine version matrix to a JSON file for better management and readability. - Fixed Object Encoding tests to expect quicklist on versions < 7.2 instead of 7.0 - Fixed C# and Java version parsing from redis-server -v output to support also Valkey's output - Updated the README file with the supported versions & engine typ
1 parent 09d4bf4 commit 0005c1b

File tree

20 files changed

+279
-100
lines changed

20 files changed

+279
-100
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[
2+
{
3+
"type": "valkey",
4+
"version": "7.2.5"
5+
},
6+
{
7+
"type": "valkey",
8+
"version": "redis-7.0.15"
9+
},
10+
{
11+
"type": "valkey",
12+
"version": "redis-6.2.14"
13+
}
14+
]

.github/workflows/build-node-wrapper/action.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ inputs:
2929
description: "Specified target for rust toolchain, ex. x86_64-apple-darwin"
3030
type: string
3131
required: true
32+
engine-version:
33+
description: "Engine version to install"
34+
required: true
35+
type: string
3236
publish:
3337
description: "Enable building the wrapper in release mode"
3438
required: false
@@ -56,6 +60,7 @@ runs:
5660
os: ${{ inputs.os }}
5761
target: ${{ inputs.target }}
5862
github-token: ${{ inputs.github-token }}
63+
engine-version: ${{ inputs.engine-version }}
5964

6065
- name: Create package.json file
6166
uses: ./.github/workflows/node-create-package-file

.github/workflows/build-python-wrapper/action.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ inputs:
1313
description: "Specified target for rust toolchain, ex. x86_64-apple-darwin"
1414
type: string
1515
required: true
16+
engine-version:
17+
description: "Engine version to install"
18+
required: true
19+
type: string
1620
publish:
1721
description: "Enable building the wrapper in release mode"
1822
required: false
@@ -34,6 +38,7 @@ runs:
3438
os: ${{ inputs.os }}
3539
target: ${{ inputs.target }}
3640
github-token: ${{ inputs.github-token }}
41+
engine-version: ${{ inputs.engine-version }}
3742

3843
- name: Install Python software dependencies
3944
shell: bash

.github/workflows/csharp.yml

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@ on:
99
- submodules/**
1010
- .github/workflows/csharp.yml
1111
- .github/workflows/install-shared-dependencies/action.yml
12-
- .github/workflows/install-redis/action.yml
1312
- .github/workflows/test-benchmark/action.yml
1413
- .github/workflows/lint-rust/action.yml
14+
- .github/workflows/install-valkey/action.yml
1515
pull_request:
1616
paths:
1717
- csharp/**
1818
- glide-core/src/**
1919
- submodules/**
2020
- .github/workflows/csharp.yml
2121
- .github/workflows/install-shared-dependencies/action.yml
22-
- .github/workflows/install-redis/action.yml
2322
- .github/workflows/test-benchmark/action.yml
2423
- .github/workflows/lint-rust/action.yml
24+
- .github/workflows/install-valkey/action.yml
2525

2626
permissions:
2727
contents: read
@@ -31,14 +31,26 @@ concurrency:
3131
cancel-in-progress: true
3232

3333
jobs:
34+
load-engine-matrix:
35+
runs-on: ubuntu-latest
36+
outputs:
37+
matrix: ${{ steps.load-engine-matrix.outputs.matrix }}
38+
steps:
39+
- name: Checkout
40+
uses: actions/checkout@v4
41+
42+
- name: Load the engine matrix
43+
id: load-engine-matrix
44+
shell: bash
45+
run: echo "matrix=$(jq -c . < .github/json_matrices/engine-matrix.json)" >> $GITHUB_OUTPUT
46+
3447
run-tests:
48+
needs: load-engine-matrix
3549
timeout-minutes: 25
3650
strategy:
3751
fail-fast: false
3852
matrix:
39-
redis:
40-
- 6.2.14
41-
- 7.2.3
53+
engine: ${{ fromJson(needs.load-engine-matrix.outputs.matrix) }}
4254
dotnet:
4355
- '6.0'
4456
- '8.0'
@@ -61,13 +73,6 @@ jobs:
6173
with:
6274
submodules: recursive
6375

64-
- name: Install redis
65-
# TODO: make this step macos compatible: https://github.com/aws/glide-for-redis/issues/781
66-
if: ${{ matrix.host.OS == 'ubuntu' }}
67-
uses: ./.github/workflows/install-redis
68-
with:
69-
redis-version: ${{ matrix.redis }}
70-
7176
- name: Set up dotnet ${{ matrix.dotnet }}
7277
uses: actions/setup-dotnet@v4
7378
with:
@@ -79,6 +84,7 @@ jobs:
7984
os: ${{ matrix.host.OS }}
8085
target: ${{ matrix.host.TARGET }}
8186
github-token: ${{ secrets.GITHUB_TOKEN }}
87+
engine-version: ${{ matrix.engine.version }}
8288

8389
- name: Format
8490
working-directory: ./csharp

.github/workflows/go.yml

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,41 @@ on:
88
- submodules/**
99
- go/**
1010
- .github/workflows/go.yml
11+
- .github/workflows/install-shared-dependencies/action.yml
12+
- .github/workflows/test-benchmark/action.yml
13+
- .github/workflows/lint-rust/action.yml
14+
- .github/workflows/install-valkey/action.yml
1115
pull_request:
1216
paths:
1317
- glide-core/src/**
1418
- submodules/**
1519
- go/**
1620
- .github/workflows/go.yml
17-
21+
- .github/workflows/install-shared-dependencies/action.yml
22+
- .github/workflows/test-benchmark/action.yml
23+
- .github/workflows/lint-rust/action.yml
24+
- .github/workflows/install-valkey/action.yml
1825
concurrency:
1926
group: go-${{ github.head_ref || github.ref }}
2027
cancel-in-progress: true
2128

2229

2330
jobs:
31+
load-engine-matrix:
32+
runs-on: ubuntu-latest
33+
outputs:
34+
matrix: ${{ steps.load-engine-matrix.outputs.matrix }}
35+
steps:
36+
- name: Checkout
37+
uses: actions/checkout@v4
38+
39+
- name: Load the engine matrix
40+
id: load-engine-matrix
41+
shell: bash
42+
run: echo "matrix=$(jq -c . < .github/json_matrices/engine-matrix.json)" >> $GITHUB_OUTPUT
43+
2444
build-and-test-go-client:
45+
needs: load-engine-matrix
2546
timeout-minutes: 35
2647
strategy:
2748
# Run all jobs
@@ -30,9 +51,7 @@ jobs:
3051
go:
3152
- '1.18.10'
3253
- '1.22.0'
33-
redis:
34-
- 6.2.14
35-
- 7.2.3
54+
engine: ${{ fromJson(needs.load-engine-matrix.outputs.matrix) }}
3655
host:
3756
- {
3857
OS: ubuntu,
@@ -64,13 +83,7 @@ jobs:
6483
os: ${{ matrix.host.OS }}
6584
target: ${{ matrix.host.TARGET }}
6685
github-token: ${{ secrets.GITHUB_TOKEN }}
67-
68-
- name: Install redis
69-
# TODO: make this step macos compatible: https://github.com/aws/glide-for-redis/issues/781
70-
if: ${{ matrix.os == 'ubuntu-latest' }}
71-
uses: ./.github/workflows/install-redis
72-
with:
73-
redis-version: ${{ matrix.redis }}
86+
engine-version: ${{ matrix.engine.version }}
7487

7588
- name: Install tools for Go ${{ matrix.go }}
7689
working-directory: ./go
@@ -127,11 +140,7 @@ jobs:
127140
os: "amazon-linux"
128141
target: "x86_64-unknown-linux-gnu"
129142
github-token: ${{ secrets.GITHUB_TOKEN }}
130-
131-
- name: Create a symbolic Link for redis6 binaries
132-
run: |
133-
ln -s /usr/bin/redis6-server /usr/bin/redis-server
134-
ln -s /usr/bin/redis6-cli /usr/bin/redis-cli
143+
engine-version: "7.2.5"
135144

136145
- name: Install Go
137146
run: |

.github/workflows/install-shared-dependencies/action.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ inputs:
2121
- aarch64-apple-darwin
2222
- aarch64-unknown-linux-musl
2323
- x86_64-unknown-linux-musl
24+
engine-version:
25+
description: "Engine version to install"
26+
required: true
27+
type: string
28+
2429
github-token:
2530
description: "GITHUB_TOKEN, GitHub App installation access token"
2631
required: true
@@ -36,7 +41,7 @@ runs:
3641
run: |
3742
brew update
3843
brew upgrade || true
39-
brew install git gcc pkgconfig openssl redis coreutils
44+
brew install git gcc pkgconfig openssl coreutils
4045
4146
- name: Install software dependencies for Ubuntu GNU
4247
shell: bash
@@ -52,17 +57,23 @@ runs:
5257
apk update
5358
wget -O - https://sh.rustup.rs | sh -s -- -y
5459
source "$HOME/.cargo/env"
55-
apk add protobuf-dev musl-dev make gcc redis envsubst
60+
apk add protobuf-dev musl-dev make gcc envsubst openssl libressl-dev
5661
5762
- name: Install software dependencies for Amazon-Linux
5863
shell: bash
5964
if: "${{ inputs.os == 'amazon-linux' }}"
6065
run: |
61-
yum install -y gcc pkgconfig openssl openssl-devel which curl redis6 gettext --allowerasing
66+
yum install -y gcc pkgconfig openssl openssl-devel which curl gettext --allowerasing
6267
6368
- name: Install Rust toolchain and protoc
6469
if: "${{ !contains(inputs.target, 'musl') }}"
6570
uses: ./.github/workflows/install-rust-and-protoc
6671
with:
6772
target: ${{ inputs.target }}
6873
github-token: ${{ inputs.github-token }}
74+
75+
- name: Install Valkey
76+
uses: ./.github/workflows/install-valkey
77+
with:
78+
engine-version: ${{ inputs.engine-version }}
79+
target: ${{ inputs.target }}
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Install Valkey
2+
3+
inputs:
4+
engine-version:
5+
description: "Engine version to install"
6+
required: true
7+
type: string
8+
target:
9+
description: "Specified target toolchain, ex. x86_64-unknown-linux-gnu"
10+
type: string
11+
required: true
12+
options:
13+
- x86_64-unknown-linux-gnu
14+
- aarch64-unknown-linux-gnu
15+
- x86_64-apple-darwin
16+
- aarch64-apple-darwin
17+
- aarch64-unknown-linux-musl
18+
- x86_64-unknown-linux-musl
19+
20+
env:
21+
CARGO_TERM_COLOR: always
22+
VALKEY_MIN_VERSION: "7.2.5"
23+
24+
runs:
25+
using: "composite"
26+
27+
steps:
28+
- name: Cache Valkey
29+
# TODO: remove the musl ARM64 limitation when https://github.com/actions/runner/issues/801 is resolved
30+
if: ${{ inputs.target != 'aarch64-unknown-linux-musl' }}
31+
uses: actions/cache@v4
32+
id: cache-valkey
33+
with:
34+
path: |
35+
~/valkey
36+
key: valkey-${{ inputs.engine-version }}-${{ inputs.target }}
37+
38+
- name: Build Valkey
39+
if: ${{ steps.cache-valkey.outputs.cache-hit != 'true' }}
40+
shell: bash
41+
run: |
42+
echo "Building valkey ${{ inputs.engine-version }}"
43+
cd ~
44+
rm -rf valkey
45+
git clone https://github.com/valkey-io/valkey.git
46+
cd valkey
47+
git checkout ${{ inputs.engine-version }}
48+
make BUILD_TLS=yes
49+
50+
- name: Install Valkey
51+
shell: bash
52+
run: |
53+
cd ~/valkey
54+
if command -v sudo &> /dev/null
55+
then
56+
echo "sudo command exists"
57+
sudo make install
58+
else
59+
echo "sudo command does not exist"
60+
make install
61+
fi
62+
echo 'export PATH=/usr/local/bin:$PATH' >>~/.bash_profile
63+
64+
- name: Verify Valkey installation and symlinks
65+
shell: bash
66+
run: |
67+
# In Valkey releases, the engine is built with symlinks from valkey-server and valkey-cli
68+
# to redis-server and redis-cli. This step ensures that the engine is properly installed
69+
# with the expected version and that Valkey symlinks are correctly created.
70+
EXPECTED_VERSION=`echo ${{ inputs.engine-version }} | sed -e "s/^redis-//"`
71+
INSTALLED_VER=$(redis-server -v)
72+
if [[ $INSTALLED_VER != *"${EXPECTED_VERSION}"* ]]; then
73+
echo "Wrong version has been installed. Expected: $EXPECTED_VERSION, Installed: $INSTALLED_VER"
74+
exit 1
75+
else
76+
echo "Successfully installed the server: $INSTALLED_VER"
77+
fi
78+

0 commit comments

Comments
 (0)