| 1 |
name: 'Run go-redis tests' |
| 2 |
description: 'Runs go-redis tests against different Redis versions and configurations' |
| 3 |
inputs: |
| 4 |
go-version: |
| 5 |
description: 'Go version to use for running tests' |
| 6 |
default: '1.23' |
| 7 |
redis-version: |
| 8 |
description: 'Redis version to test against' |
| 9 |
required: true |
| 10 |
runs: |
| 11 |
using: "composite" |
| 12 |
steps: |
| 13 |
- name: Set up ${{ inputs.go-version }} |
| 14 |
uses: actions/setup-go@v5 |
| 15 |
with: |
| 16 |
go-version: ${{ inputs.go-version }} |
| 17 |
|
| 18 |
- name: Setup Test environment |
| 19 |
env: |
| 20 |
REDIS_VERSION: ${{ inputs.redis-version }} |
| 21 |
run: | |
| 22 |
set -e |
| 23 |
redis_version_np=$(echo "$REDIS_VERSION" | grep -oP '^\d+.\d+') |
| 24 |
|
| 25 |
# Mapping of redis version to redis testing containers |
| 26 |
declare -A redis_version_mapping=( |
| 27 |
["8.4.x"]="8.4.0" |
| 28 |
["8.2.x"]="8.2.1-pre" |
| 29 |
["8.0.x"]="8.0.2" |
| 30 |
) |
| 31 |
|
| 32 |
if [[ -v redis_version_mapping[$REDIS_VERSION] ]]; then |
| 33 |
echo "REDIS_VERSION=${redis_version_np}" >> $GITHUB_ENV |
| 34 |
echo "REDIS_IMAGE=redis:${REDIS_VERSION}" >> $GITHUB_ENV |
| 35 |
echo "CLIENT_LIBS_TEST_IMAGE=redislabs/client-libs-test:${redis_version_mapping[$REDIS_VERSION]}" >> $GITHUB_ENV |
| 36 |
else |
| 37 |
echo "Version not found in the mapping." |
| 38 |
exit 1 |
| 39 |
fi |
| 40 |
sleep 10 # wait for redis to start |
| 41 |
shell: bash |
| 42 |
- name: Set up Docker Compose environment with redis ${{ inputs.redis-version }} |
| 43 |
run: | |
| 44 |
make docker.start |
| 45 |
shell: bash |
| 46 |
- name: Run tests |
| 47 |
env: |
| 48 |
RCE_DOCKER: "true" |
| 49 |
RE_CLUSTER: "false" |
| 50 |
run: | |
| 51 |
make test.ci |
| 52 |
shell: bash |