Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test against Valkey in CI. #187

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 57 additions & 19 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,59 @@ jobs:
strategy:
fail-fast: false
matrix:
redis:
- 6.2.13
- 7.2.0
rust:
- stable
- beta
- nightly
- 1.65.0
config:
[
# Different DB cases:
{
rust: stable,
db-org: redis,
db-name: redis,
db-version: 6.2.13
},
{
rust: stable,
db-org: redis,
db-name: redis,
db-version: 7.2.4
},
{
rust: stable,
db-org: valkey-io,
db-name: valkey,
db-version: 7.2.6
},

# Different rust cases
{
rust: beta,
db-org: valkey-io,
db-name: valkey,
db-version: 7.2.6
},
{
rust: nightly,
db-org: valkey-io,
db-name: valkey,
db-version: 7.2.6
},
{
rust: 1.65.0,
db-org: valkey-io,
db-name: valkey,
db-version: 7.2.6
}
]

steps:

- name: Cache redis
- name: Cache DB
id: cache-redis
uses: actions/cache@v4
with:
path: |
~/redis-cli
~/redis-server
key: ${{ runner.os }}-${{ matrix.redis }}-redis
key: ${{ runner.os }}-${{ matrix.config.db-name }}-${{ matrix.config.db-version }}

- name: Cache RedisJSON
id: cache-redisjson
Expand All @@ -46,13 +80,17 @@ jobs:
/tmp/librejson.so
key: ${{ runner.os }}-redisjson

- name: Install redis
- name: Install DB
if: steps.cache-redis.outputs.cache-hit != 'true'
run: |
sudo apt-get update
wget https://github.com/redis/redis/archive/${{ matrix.redis }}.tar.gz;
tar -xzvf ${{ matrix.redis }}.tar.gz;
pushd redis-${{ matrix.redis }} && BUILD_TLS=yes make && sudo mv src/redis-server src/redis-cli $HOME && popd;
wget https://github.com/${{ matrix.config.db-org }}/${{ matrix.config.db-name }}/archive/${{ matrix.config.db-version }}.tar.gz;
tar -xzvf ${{ matrix.config.db-version }}.tar.gz;
pushd ${{ matrix.config.db-name }}-${{ matrix.config.db-version }} &&
BUILD_TLS=yes make install &&
sudo mv src/${{ matrix.config.db-name }}-server $HOME/redis-server &&
sudo mv src/${{ matrix.config.db-name }}-cli $HOME/redis-cli &&
popd;
echo $PATH

- name: set PATH
Expand All @@ -62,7 +100,7 @@ jobs:
- name: Install Rust
uses: dtolnay/rust-toolchain/@master
with:
toolchain: ${{ matrix.rust }}
toolchain: ${{ matrix.config.rust }}
components: rustfmt

- uses: Swatinem/rust-cache@v2
Expand All @@ -73,7 +111,7 @@ jobs:
run: make test

- name: Checkout RedisJSON
if: steps.cache-redisjson.outputs.cache-hit != 'true' && matrix.redis != '6.2.13'
if: steps.cache-redisjson.outputs.cache-hit != 'true' && matrix.config.db-version != '6.2.13'
uses: actions/checkout@v4
with:
repository: "RedisJSON/RedisJSON"
Expand All @@ -94,7 +132,7 @@ jobs:
# This shouldn't cause issues in the future so long as no profiles or patches
# are applied to the workspace Cargo.toml file
- name: Compile RedisJSON
if: steps.cache-redisjson.outputs.cache-hit != 'true' && matrix.redis != '6.2.13'
if: steps.cache-redisjson.outputs.cache-hit != 'true' && matrix.config.db-version != '6.2.13'
run: |
cp ./Cargo.toml ./Cargo.toml.actual
echo $'\nexclude = [\"./__ci/redis-json\"]' >> Cargo.toml
Expand All @@ -104,10 +142,10 @@ jobs:
rm -rf ./__ci/redis-json

- name: Run module-specific tests
if: matrix.redis != '6.2.13'
if: matrix.config.db-version != '6.2.13'
run: make test-module
env:
REDIS_VERSION: ${{ matrix.redis }}
REDIS_VERSION: ${{ matrix.config.db-version }}

- name: Check features
run: |
Expand Down