Skip to content

Commit e581955

Browse files
committed
ci: optimize test workflow by separating runtimehints from engine matrix
This change improves the CI workflow's efficiency by splitting the testing into specialized jobs: 1. Runtime hints tests now only permutate on JDK versions, not Redis/Valkey engine types or versions, since these tests validate Java runtime behavior for native image compilation rather than Redis-specific functionality. 2. Removed unnecessary Redis/Valkey installation steps and server version parameter from runtime hints tests. 3. Baseline tests continue to run the full matrix permutation across JDK versions and Redis/Valkey engine combinations. This approach significantly reduces CI execution time and resource usage while maintaining complete test coverage, following the pattern established in the Jenkins pipeline which also runs runtime hints tests with a single Redis version. Signed-off-by: ikolomi <ikolomin@amazon.com>
1 parent 67b472a commit e581955

1 file changed

Lines changed: 58 additions & 11 deletions

File tree

.github/workflows/ci.yml

Lines changed: 58 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,17 @@ on:
1313
workflow_dispatch:
1414

1515
jobs:
16-
generate-tests-matrix:
16+
generate-test-matrices:
1717
runs-on: ubuntu-latest
1818
outputs:
19-
matrix: ${{ steps.set-tests-matrix.outputs.matrix }}
19+
full-matrix: ${{ steps.set-full-matrix.outputs.full-matrix }}
20+
jdk-matrix: ${{ steps.set-jdk-matrix.outputs.jdk-matrix }}
2021
steps:
2122
- name: Checkout code
2223
uses: actions/checkout@v4
2324

24-
- name: Read and expand tests-matrix.json
25-
id: set-tests-matrix
25+
- name: Read and expand full tests-matrix.json
26+
id: set-full-matrix
2627
run: |
2728
jq -n '
2829
[inputs[] |
@@ -40,17 +41,25 @@ jobs:
4041
)
4142
]
4243
' .github/workflows/tests-matrix.json > tests-matrix-expanded.json
43-
echo "matrix=$(cat tests-matrix-expanded.json | jq -c .)" >> $GITHUB_OUTPUT
44+
echo "full-matrix=$(cat tests-matrix-expanded.json | jq -c .)" >> $GITHUB_OUTPUT
4445
45-
ci-tests:
46-
needs: generate-tests-matrix
46+
- name: Extract JDK versions only
47+
id: set-jdk-matrix
48+
run: |
49+
jq -n '
50+
[inputs[].["openjdk-versions"][] | { jdk: . }]
51+
' .github/workflows/tests-matrix.json > jdk-matrix-expanded.json
52+
echo "jdk-matrix=$(cat jdk-matrix-expanded.json | jq -c .)" >> $GITHUB_OUTPUT
53+
54+
ci-baseline-tests:
55+
needs: generate-test-matrices
4756
runs-on: ubuntu-latest
4857
timeout-minutes: 30
4958
strategy:
5059
fail-fast: false
5160
matrix:
52-
include: ${{ fromJson(needs.generate-tests-matrix.outputs.matrix) }}
53-
name: Test JDK ${{ matrix.jdk }} with ${{ matrix.engine }} ${{ matrix.version }}
61+
include: ${{ fromJson(needs.generate-test-matrices.outputs.full-matrix) }}
62+
name: Baseline test with JDK ${{ matrix.jdk }} and ${{ matrix.engine }} ${{ matrix.version }}
5463

5564
steps:
5665
- name: Checkout
@@ -90,12 +99,50 @@ jobs:
9099
-Dredis.server.version=${{ matrix.redis-version || matrix.valkey-version }} \
91100
-U -B
92101
93-
- name: Test baseline
102+
ci-runtimehints-tests:
103+
needs: generate-test-matrices
104+
runs-on: ubuntu-latest
105+
timeout-minutes: 30
106+
strategy:
107+
fail-fast: false
108+
matrix:
109+
include: ${{ fromJson(needs.generate-test-matrices.outputs.jdk-matrix) }}
110+
name: Test runtime hints with JDK ${{ matrix.jdk }}
111+
112+
steps:
113+
- name: Checkout
114+
uses: actions/checkout@v4
115+
116+
- name: Set up JDK
117+
uses: actions/setup-java@v4
118+
with:
119+
java-version: ${{ matrix.jdk }}
120+
distribution: "temurin"
121+
122+
- name: Cache Maven dependencies
123+
uses: actions/cache@v4
124+
with:
125+
path: ~/.m2/repository
126+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
127+
restore-keys: |
128+
${{ runner.os }}-maven-
129+
130+
# Runtime hints tests still need a Redis instance, but can use a single version
131+
- name: Install Redis
132+
uses: ./.github/workflows/actions/install-engine
133+
with:
134+
engine-type: "valkey"
135+
engine-tag: "8.0.3" # Use oldest valkey version for runtime hints tests
136+
137+
- name: Start Valkey
138+
run: |
139+
make start
140+
141+
- name: Test runtimehints
94142
run: |
95143
./mvnw -s settings.xml \
96144
-Ddevelocity.storage.directory=$HOME/.develocity-root \
97145
-Dmaven.repo.local=$HOME/.m2/spring-data-redis \
98146
test -Pruntimehints \
99147
-DrunLongTests=false \
100-
-Dredis.server.version=${{ matrix.redis-version || matrix.valkey-version }} \
101148
-U -B

0 commit comments

Comments
 (0)