Skip to content

Introduce reusable workflows#3673

Merged
a-TODO-rov merged 8 commits into
mainfrom
test-reusable-workflows
Mar 13, 2026
Merged

Introduce reusable workflows#3673
a-TODO-rov merged 8 commits into
mainfrom
test-reusable-workflows

Conversation

@a-TODO-rov
Copy link
Copy Markdown
Contributor

@a-TODO-rov a-TODO-rov commented Feb 18, 2026

Make sure that:

  • You have read the contribution guidelines.
  • You have created a feature request first to discuss your contribution intent. Please reference the feature request ticket number in the pull request.
  • You applied code formatting rules using the mvn formatter:format target. Don’t submit any formatting related changes.
  • You submit test cases (unit or integration tests) that back your changes.

Note

Medium Risk
Medium risk because it restructures the GitHub Actions test pipeline and changes how the Docker-based Redis test environment is provisioned/cleaned up, which could cause CI regressions if inputs or compose args are wrong.

Overview
CI is refactored into a reusable workflow. integration.yml now delegates to a new callable workflow (run-tests.yml) and adds a workflow_dispatch input to optionally run tests against a custom client-libs-test image tag (with a separate job path when provided).

Test environment setup/teardown is updated. The Makefile now exports REDIS_ENV_WORK_DIR, centralizes docker-compose env file/command construction, adds a containerized workdir cleanup step, waits/pulls quietly on startup, stops via the same computed compose command, and passes domain-socket JVM args to Maven; docker-compose image selection is parameterized via CLIENT_LIBS_TEST_IMAGE/CLIENT_LIBS_TEST_IMAGE_TAG.

Written by Cursor Bugbot for commit 6e560a3. This will update automatically on new commits. Configure here.

@jit-ci
Copy link
Copy Markdown

jit-ci Bot commented Mar 9, 2026

🛡️ Jit Security Scan Results

CRITICAL HIGH MEDIUM

✅ No security findings were detected in this PR


Security scan by Jit

@a-TODO-rov a-TODO-rov marked this pull request as ready for review March 13, 2026 09:18
Peter-Sh and others added 8 commits March 13, 2026 11:18
These changes are to enable running nightly tests against Redis unstable
builds and custom builds.

The PR follows the same idea as in Jedis: redis/jedis#4425

Main changes

* Created a new reusable action `.github/actions/run-tests/action.yml`
that is intended to be run by workflows in this and external
repositories.
* Moved all the steps from `integration.yml` to the new action, with
modifications allowing the use of a custom image tag instead of a
baked-in version.

What was changed in `integration.yml`:

* Uses the run-tests action to run the tests
* Allows running tests against a custom image tag (this is indicated in
the run-name, if used)

Docker Compose

* Added the `CLIENT_LIBS_TEST_IMAGE_TAG` variable to Docker Compose.
  I'm using a separate `CLIENT_LIBS_TEST_IMAGE_TAG` variable to clearly
  separate regular versions set with REDIS_VERSION from image tags.
* Added the `CLIENT_LIBS_TEST_IMAGE` variable, it's not directly used in
  Makefile or workflows, but is supported in run-tests action. Added it for
  consitency with Jedis which originally has the ability to use different
  image url.

Changes to `Makefile`

* Added direct setting of `domainsocket` and `sentineldomainsocket` properties
  when invoking maven because `TestSettings.java` didn't respect
  REDIS_ENV_WORK_DIR value and always tried to open sockets using relative
  paths

* If `CLIENT_LIBS_TEST_IMAGE_TAG` is present, then the `version` argument
is ignored.

Changes to the workflow logic

* `CLIENT_LIBS_TEST_IMAGE_TAG`, along with `CLIENT_LIBS_TEST_IMAGE`, is
passed to `make start` if any or both are present. Then Docker Compose
gets them from the environment.

```
make start CLIENT_LIBS_TEST_IMAGE=redislabsdev/client-libs-test CLIENT_LIBS_TEST_IMAGE_TAG=custom-1235-debian-amd64
```

run-tests action allows setting a different image name using
`CLIENT_LIBS_TEST_IMAGE` (not used in `integration.yml`).

setup-maven action was updated from `1.8.0` to `1.19.0` to allow disabling
secondary checkout using `checkout-enabled` option and avoid incorrect
chekouts when using run-tests externally

Minor changes
* Docker Compose is started with `--quiet-pull` to reduce noise.
* Docker Compose is started with the `--wait` option, which is a more
correct way to wait for readiness.
* `make stop` is used instead `docker-compose stop` for consistency with
  `make start` and to enable any tear-down logic inluded in Makefile
* Remove REDIS_ENV_CONF_DIR - it's not used

* Explicitly export REDIS_ENV_WORK_DIR in Makefile

This makes REDIS_ENV_WORK_DIR value defined in Makefile to be used
instead of default value from .env when running make with empty REDIS_ENV_WORK_DIR

* Add cleanup service to avoid permission issues for non-root users

* Consistent docker compose arguments for start and stop

Define COMPOSE_ENV variable containing all env var definitions to run
docker compose
Use it in both start and stop targets to always have consistent
arguments, e.g.: env files, custom env files
Use same make args when calling start and stop in the workflow

* Use quiet-pull when running cleanup

* Fix comment

* Don't use 777, quiet-pull for cleanup in start target

* Allow tests to put truststore files into work dir

* Remove cleanup from stop target
This reverts commit e3a8d21.
@a-TODO-rov a-TODO-rov force-pushed the test-reusable-workflows branch from 6e2cb1c to 6e560a3 Compare March 13, 2026 09:18
@a-TODO-rov a-TODO-rov changed the title Test reusable workflows Introduce reusable workflows Mar 13, 2026
@a-TODO-rov a-TODO-rov merged commit 9f47bc9 into main Mar 13, 2026
16 of 19 checks passed
@a-TODO-rov a-TODO-rov deleted the test-reusable-workflows branch March 13, 2026 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants