...
1name: 'Run go-redis tests'
2description: 'Runs go-redis tests against different Redis versions and configurations'
3inputs:
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
10runs:
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 CLIENT_LIBS_TEST_IMAGE: "redislabs/client-libs-test:${{ inputs.redis-version }}"
22 run: |
23 set -e
24 redis_version_np=$(echo "$REDIS_VERSION" | grep -oP '^\d+.\d+')
25
26 # Mapping of redis version to redis testing containers
27 declare -A redis_version_mapping=(
28 ["8.2.x"]="8.2.1-pre"
29 ["8.0.x"]="8.0.2"
30 ["7.4.x"]="rs-7.4.0-v5"
31 ["7.2.x"]="rs-7.2.0-v17"
32 )
33
34 if [[ -v redis_version_mapping[$REDIS_VERSION] ]]; then
35 echo "REDIS_VERSION=${redis_version_np}" >> $GITHUB_ENV
36 echo "REDIS_IMAGE=redis:${{ inputs.redis-version }}" >> $GITHUB_ENV
37 echo "CLIENT_LIBS_TEST_IMAGE=redislabs/client-libs-test:${redis_version_mapping[$REDIS_VERSION]}" >> $GITHUB_ENV
38 else
39 echo "Version not found in the mapping."
40 exit 1
41 fi
42 sleep 10 # wait for redis to start
43 shell: bash
44 - name: Set up Docker Compose environment with redis ${{ inputs.redis-version }}
45 run: |
46 make docker.start
47 shell: bash
48 - name: Run tests
49 env:
50 RCE_DOCKER: "true"
51 RE_CLUSTER: "false"
52 run: |
53 make test.ci
54 shell: bash
View as plain text