|
1 | 1 | name: 'Run NRedisStack tests' |
2 | 2 | description: 'Runs NRedisStack tests against different Redis versions and configurations' |
3 | | -inputs: |
| 3 | +inputs: |
4 | 4 | dotnet-version: |
5 | 5 | description: 'SDK version' |
6 | 6 | required: true |
7 | 7 | redis-version: |
8 | | - description: 'Redis version to test against' |
| 8 | + description: 'Redis version to test against (MAJOR.MINOR format, e.g., "7.4", "8.0")' |
9 | 9 | required: true |
10 | 10 | verify-nuget-package: |
11 | 11 | description: 'Verify Nuget package' |
@@ -36,45 +36,26 @@ runs: |
36 | 36 | - name: Setup Environment variables and run Redis |
37 | 37 | env: |
38 | 38 | REDIS_VERSION: ${{ inputs.redis-version }} |
39 | | - REDIS_IMAGE: "redis:${{ inputs.redis-version }}" |
40 | | - CLIENT_LIBS_TEST_IMAGE: "redislabs/client-libs-test:${{ inputs.redis-version }}" |
41 | 39 | run: | |
42 | 40 | set -e |
43 | | - |
| 41 | +
|
44 | 42 | echo "::group::Setup Environment variables and run Redis" |
45 | 43 | dotnet_major_minor_version=$(echo "${{ inputs.dotnet-version }}" | grep -oP '^\d+\.\d+') |
46 | 44 | echo "CLR_VERSION=net${dotnet_major_minor_version}" >> $GITHUB_ENV |
47 | 45 |
|
48 | | - redis_major_version=$(echo "$REDIS_VERSION" | grep -oP '^\d+') |
49 | | - echo "REDIS_MAJOR_VERSION=${redis_major_version}" >> $GITHUB_ENV |
50 | | - |
51 | | - if (( redis_major_version < 8 )); then |
52 | | - echo "Using redis-stack for module tests" |
53 | | - |
54 | | - # Mapping of redis version to stack version |
55 | | - declare -A redis_stack_version_mapping=( |
56 | | - ["7.4.1"]="rs-7.4.0-v5" |
57 | | - ["7.2.6"]="rs-7.2.0-v17" |
58 | | - ["6.2.16"]="rs-6.2.6-v17" |
59 | | - ) |
60 | | - |
61 | | - if [[ -v redis_stack_version_mapping[$REDIS_VERSION] ]]; then |
62 | | - export CLIENT_LIBS_TEST_IMAGE="redislabs/client-libs-test:${redis_stack_version_mapping[$REDIS_VERSION]}" |
63 | | - else |
64 | | - echo "Version not found in the mapping." |
65 | | - exit 1 |
66 | | - fi |
67 | | - |
68 | | - if (( redis_major_version < 7 )); then |
69 | | - export REDIS_EXTRA_ARGS="--tls-auth-clients optional --save ''" |
70 | | - fi |
71 | | -
|
72 | | - docker compose --profile all -f tests/dockers/docker-compose.yml up -d --build |
| 46 | + # Load environment variables from version-specific file |
| 47 | + ENV_FILE="tests/dockers/.env.v${REDIS_VERSION}" |
| 48 | + if [[ -f "$ENV_FILE" ]]; then |
| 49 | + echo "Loading environment from $ENV_FILE" |
| 50 | + set -a |
| 51 | + source "$ENV_FILE" |
| 52 | + set +a |
73 | 53 | else |
74 | | - echo "Using redis CE for module tests" |
75 | | - export CLIENT_LIBS_TEST_IMAGE="redislabs/client-libs-test:$REDIS_VERSION" |
76 | | - docker compose --profile all -f tests/dockers/docker-compose.yml up -d --build |
| 54 | + echo "Environment file not found: $ENV_FILE" |
| 55 | + exit 1 |
77 | 56 | fi |
| 57 | +
|
| 58 | + docker compose --profile all -f tests/dockers/docker-compose.yml up -d --build |
78 | 59 | echo "::endgroup::" |
79 | 60 | shell: bash |
80 | 61 |
|
|
0 commit comments