Introduce reusable workflows#3673
Merged
Merged
Conversation
4 tasks
3094201 to
7b58b82
Compare
🛡️ Jit Security Scan Results✅ No security findings were detected in this PR
Security scan by Jit
|
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
This reverts commit 70f9fa4.
* 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.
6e2cb1c to
6e560a3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Make sure that:
mvn formatter:formattarget. Don’t submit any formatting related 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.ymlnow delegates to a new callable workflow (run-tests.yml) and adds aworkflow_dispatchinput to optionally run tests against a customclient-libs-testimage 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 viaCLIENT_LIBS_TEST_IMAGE/CLIENT_LIBS_TEST_IMAGE_TAG.Written by Cursor Bugbot for commit 6e560a3. This will update automatically on new commits. Configure here.