Skip to content

Commit 3da93d7

Browse files
Added support for calling run-tests from other repositories (#3923)
* Added repository and ref to run-tests action * Added client-libs-test-image input to override client image tag Co-authored-by: petyaslavova <petya.slavova@redis.com>
1 parent 6df6566 commit 3da93d7

1 file changed

Lines changed: 20 additions & 3 deletions

File tree

.github/actions/run-tests/action.yml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,22 @@ inputs:
2222
description: 'Event loop to use'
2323
required: false
2424
default: 'asyncio'
25+
repository:
26+
description: 'Repository to checkout'
27+
required: false
28+
ref:
29+
description: 'Branch to checkout'
30+
required: false
31+
client-libs-test-image:
32+
description: 'Client libs test image tag'
33+
required: false
2534
runs:
2635
using: "composite"
2736
steps:
2837
- uses: actions/checkout@v4
38+
with:
39+
repository: ${{ inputs.repository }}
40+
ref: ${{ inputs.ref }}
2941

3042
- uses: actions/setup-python@v5
3143
with:
@@ -43,7 +55,8 @@ runs:
4355
- name: Setup Test environment
4456
env:
4557
REDIS_VERSION: ${{ inputs.redis-version }}
46-
CLIENT_LIBS_TEST_IMAGE_TAG: ${{ inputs.redis-version }}
58+
CLIENT_LIBS_TEST_IMAGE_TAG: ${{ inputs.client-libs-test-image || inputs.redis-version }}
59+
CLIENT_LIBS_TEST_STACK_IMAGE_TAG: ${{ inputs.client-libs-test-image }}
4760
run: |
4861
set -e
4962
@@ -78,7 +91,9 @@ runs:
7891
)
7992
8093
if [[ -v redis_stack_version_mapping[$REDIS_VERSION] ]]; then
81-
export CLIENT_LIBS_TEST_STACK_IMAGE_TAG=${redis_stack_version_mapping[$REDIS_VERSION]}
94+
if [[ -z "${CLIENT_LIBS_TEST_STACK_IMAGE_TAG}" ]]; then
95+
export CLIENT_LIBS_TEST_STACK_IMAGE_TAG=${redis_stack_version_mapping[$REDIS_VERSION]}
96+
fi
8297
echo "REDIS_MOD_URL=redis://127.0.0.1:6479/0" >> $GITHUB_ENV
8398
else
8499
echo "Version not found in the mapping."
@@ -94,7 +109,9 @@ runs:
94109
95110
else
96111
echo "Using redis CE for module tests"
97-
export CLIENT_LIBS_TEST_STACK_IMAGE_TAG=$REDIS_VERSION
112+
if [[ -z "${CLIENT_LIBS_TEST_STACK_IMAGE_TAG}" ]]; then
113+
export CLIENT_LIBS_TEST_STACK_IMAGE_TAG=$REDIS_VERSION
114+
fi
98115
echo "REDIS_MOD_URL=redis://127.0.0.1:6379" >> $GITHUB_ENV
99116
invoke devenv --endpoints all
100117
fi

0 commit comments

Comments
 (0)