@@ -26,19 +26,15 @@ concurrency:
2626 cancel-in-progress : true
2727
2828# Java Version Strategy:
29- # - BUILD: Requires Java 17+ (JUnit 6 dependency)
30- # - RUNTIME: Supports Java 11+ (javac.version=11 produces Java 11 bytecode)
31- #
32- # The 'build' job verifies bytecode compilation for both Java 11 and 17 targets.
33- # The 'runtime-java11' job verifies the built artifacts actually run on Java 11.
34- # The 'tests' job runs on JDK 17 (required by JUnit 6) with the default
35- # javac.version=11 bytecode target for backward compatibility.
29+ # - Requires Java 17+ to build, test, and run (Hadoop 3.5+ client + JUnit 6).
30+ # - Default bytecode: javac.version=17 (see default.properties).
31+ # - CI exercises Eclipse Temurin JDK 17 and JDK 21 on Ubuntu (and tests on macOS).
3632
3733jobs :
3834 javadoc :
3935 strategy :
4036 matrix :
41- java : ['17']
37+ java : ['17', '21' ]
4238 os : [ubuntu-latest]
4339 runs-on : ${{ matrix.os }}
4440 steps :
6157 rat :
6258 strategy :
6359 matrix :
64- java : ['17']
60+ java : ['17', '21' ]
6561 os : [ubuntu-latest]
6662 runs-on : ${{ matrix.os }}
6763 steps :
@@ -112,22 +108,21 @@ jobs:
112108 if : steps.filter.outputs.openapi == 'true'
113109 run : ./node_modules/.bin/lint-openapi openapi.yaml
114110
115- # Build verification with Java bytecode target matrix
116- # Verifies bytecode compatibility for both Java 11 and Java 17 targets
111+ # Build verification on JDK 17 and 21 (bytecode target Java 17)
117112 build :
118113 strategy :
119114 fail-fast : false
120115 matrix :
121- javac-version : ['11 ', '17 ']
116+ java : ['17 ', '21 ']
122117 os : [ubuntu-latest]
123118 runs-on : ${{ matrix.os }}
124- name : build (javac.version= ${{ matrix.javac-version }})
119+ name : build (jdk ${{ matrix.java }}, javac.version=17 )
125120 steps :
126121 - uses : actions/checkout@v5
127- - name : Set up JDK 17
122+ - name : Set up JDK ${{ matrix.java }}
128123 uses : actions/setup-java@v5
129124 with :
130- java-version : ' 17 '
125+ java-version : ${{ matrix.java }}
131126 distribution : ' temurin'
132127 - name : Cache Ivy dependencies
133128 uses : actions/cache@v4
@@ -136,14 +131,13 @@ jobs:
136131 key : ${{ runner.os }}-ivy-${{ hashFiles('ivy/ivy.xml', 'src/plugin/**/ivy.xml') }}
137132 restore-keys : |
138133 ${{ runner.os }}-ivy-
139- - name : Build with javac.version=${{ matrix.javac-version }}
140- run : ant clean runtime -Djavac.version=${{ matrix.javac-version }} -buildfile build.xml
134+ - name : Build with javac.version=17
135+ run : ant clean runtime -Djavac.version=17 -buildfile build.xml
141136 - name : Verify bytecode version
142137 run : |
143- # Extract and verify the bytecode version of compiled classes
144- # Java 11 = major version 55, Java 17 = major version 61
145- EXPECTED_VERSION=${{ matrix.javac-version == '11' && '55' || '61' }}
146- echo "Expected major version: $EXPECTED_VERSION (Java ${{ matrix.javac-version }})"
138+ # Java 17 = major version 61
139+ EXPECTED_VERSION=61
140+ echo "Expected major version: $EXPECTED_VERSION (Java 17 bytecode)"
147141
148142 # Find a real class file (exclude package-info.class which may have different version)
149143 cd build/classes
@@ -162,17 +156,21 @@ jobs:
162156 exit 1
163157 fi
164158
165- # Verify runtime compatibility on Java 11
166- # This ensures the built artifacts can actually run on Java 11
167- runtime-java11 :
159+ # Smoke-test runtime on the same JDK used to build (17 and 21)
160+ runtime-smoke :
168161 needs : build
162+ strategy :
163+ fail-fast : false
164+ matrix :
165+ java : ['17', '21']
169166 runs-on : ubuntu-latest
167+ name : runtime-smoke (jdk ${{ matrix.java }})
170168 steps :
171169 - uses : actions/checkout@v5
172- - name : Set up JDK 17 for building
170+ - name : Set up JDK ${{ matrix.java }}
173171 uses : actions/setup-java@v5
174172 with :
175- java-version : ' 17 '
173+ java-version : ${{ matrix.java }}
176174 distribution : ' temurin'
177175 - name : Cache Ivy dependencies
178176 uses : actions/cache@v4
@@ -181,38 +179,31 @@ jobs:
181179 key : ${{ runner.os }}-ivy-${{ hashFiles('ivy/ivy.xml', 'src/plugin/**/ivy.xml') }}
182180 restore-keys : |
183181 ${{ runner.os }}-ivy-
184- - name : Build with Java 11 target
185- run : ant clean runtime -Djavac.version=11 -buildfile build.xml
186- - name : Set up JDK 11 for runtime verification
187- uses : actions/setup-java@v5
188- with :
189- java-version : ' 11'
190- distribution : ' temurin'
191- - name : Verify runtime on Java 11
182+ - name : Build with javac.version=17
183+ run : ant clean runtime -Djavac.version=17 -buildfile build.xml
184+ - name : Verify runtime on JDK ${{ matrix.java }}
192185 run : |
193- echo "Verifying Nutch can run on Java 11 ..."
186+ echo "Verifying Nutch on JDK ${{ matrix.java }} ..."
194187 java -version
195188 cd runtime/local
196- # Actually load Java classes by running showproperties
197- # This invokes org.apache.nutch.tools.ShowProperties and verifies the JAR loads
198189 bin/nutch showproperties | head -20
199- echo "Java 11 runtime verification complete"
190+ echo "Runtime smoke test complete"
200191
201- # Tests run on JDK 17 (required by JUnit 6) with default javac.version=11
202- # Java 11 runtime compatibility is verified by the runtime-java11 job
203192 tests :
204193 strategy :
205194 fail-fast : false
206195 matrix :
196+ java : ['17', '21']
207197 os : [ubuntu-latest, macos-latest]
208198 runs-on : ${{ matrix.os }}
199+ name : tests (jdk ${{ matrix.java }}, ${{ matrix.os }})
209200 timeout-minutes : 45
210201 steps :
211202 - uses : actions/checkout@v5
212- - name : Set up JDK 17
203+ - name : Set up JDK ${{ matrix.java }}
213204 uses : actions/setup-java@v5
214205 with :
215- java-version : ' 17 '
206+ java-version : ${{ matrix.java }}
216207 distribution : ' temurin'
217208 - name : Cache Ivy dependencies
218209 uses : actions/cache@v4
@@ -266,9 +257,9 @@ jobs:
266257 fi
267258 - name : Upload Test Report
268259 uses : actions/upload-artifact@v4
269- if : always() && matrix.os == 'ubuntu-latest' && steps.check_tests.outputs.has_results == 'true'
260+ if : always() && matrix.os == 'ubuntu-latest' && matrix.java == '17' && steps.check_tests.outputs.has_results == 'true'
270261 with :
271- name : junit-test-results-${{ matrix.os }}
262+ name : junit-test-results-${{ matrix.os }}-jdk${{ matrix.java }}
272263 path : |
273264 ./build/test/TEST-*.xml
274265 ./build/**/test/TEST-*.xml
@@ -277,7 +268,7 @@ jobs:
277268 uses : actions/upload-artifact@v4
278269 if : always() && matrix.os == 'ubuntu-latest'
279270 with :
280- name : coverage-data
271+ name : coverage-data-ubuntu-jdk${{ matrix.java }}
281272 path : ./build/coverage/*.exec
282273 retention-days : 1
283274 if-no-files-found : ignore
0 commit comments