Skip to content

Commit a65ce41

Browse files
Update PR CI to run on JDK 8, 17, 21, and 25
Modified .github/workflows/pr.yml to use a matrix strategy for testing across multiple JDK versions. Ensured that artifact generation, static analysis, and reporting steps are executed only for the default JDK 8 build. Retained legacy JDK 8 setup (with JavaFX) while using setup-java@v4 for newer JDKs.
1 parent 455d610 commit a65ce41

File tree

1 file changed

+27
-8
lines changed

1 file changed

+27
-8
lines changed

.github/workflows/pr.yml

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,28 @@ permissions:
3434
issues: write
3535

3636
jobs:
37-
build-linux-jdk8-fx:
37+
build-test:
3838

3939
runs-on: ubuntu-latest
40+
strategy:
41+
fail-fast: false
42+
matrix:
43+
java-version: [8, 17, 21, 25]
4044

4145
steps:
4246
- uses: actions/checkout@v1
4347
- name: Set up JDK 8
48+
if: matrix.java-version == 8
4449
uses: actions/setup-java@v1
4550
with:
4651
java-version: 1.8
4752
java-package: jdk+fx
53+
- name: Set up JDK
54+
if: matrix.java-version != 8
55+
uses: actions/setup-java@v4
56+
with:
57+
distribution: 'zulu'
58+
java-version: ${{ matrix.java-version }}
4859
- name: Cache Maven dependencies
4960
uses: actions/cache@v4
5061
with:
@@ -73,7 +84,7 @@ jobs:
7384
-Dcn1.binaries="${CN1_BINARIES}" \
7485
-pl codenameone-maven-plugin -am -Plocal-dev-javase test
7586
- name: Generate static analysis HTML summaries
76-
if: ${{ always() }}
87+
if: ${{ always() && matrix.java-version == 8 }}
7788
env:
7889
QUALITY_REPORT_TARGET_DIRS: maven/core-unittests/target
7990
QUALITY_REPORT_SERVER_URL: ${{ github.server_url }}
@@ -82,7 +93,7 @@ jobs:
8293
QUALITY_REPORT_GENERATE_HTML_ONLY: "1"
8394
run: python3 .github/scripts/generate-quality-report.py
8495
- name: Collect quality artifacts
85-
if: ${{ always() }}
96+
if: ${{ always() && matrix.java-version == 8 }}
8697
run: |
8798
set -euo pipefail
8899
mkdir -p quality-artifacts/static-analysis
@@ -110,14 +121,14 @@ jobs:
110121
echo "No quality artifacts were generated." > quality-artifacts/README.txt
111122
fi
112123
- name: Upload quality artifacts
113-
if: ${{ always() }}
124+
if: ${{ always() && matrix.java-version == 8 }}
114125
id: upload-quality-artifacts
115126
uses: actions/upload-artifact@v4
116127
with:
117128
name: quality-artifacts
118129
path: quality-artifacts
119130
- name: Publish quality report previews
120-
if: ${{ always() && github.server_url == 'https://github.com' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) }}
131+
if: ${{ always() && matrix.java-version == 8 && github.server_url == 'https://github.com' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) }}
121132
id: publish-quality-previews
122133
env:
123134
GITHUB_TOKEN: ${{ github.token }}
@@ -183,7 +194,7 @@ jobs:
183194
echo "jacoco_url=${preview_base}/coverage/index.html" >> "$GITHUB_OUTPUT"
184195
fi
185196
- name: Generate quality report summary
186-
if: ${{ always() }}
197+
if: ${{ always() && matrix.java-version == 8 }}
187198
env:
188199
QUALITY_REPORT_TARGET_DIRS: maven/core-unittests/target
189200
QUALITY_REPORT_SERVER_URL: ${{ github.server_url }}
@@ -199,13 +210,13 @@ jobs:
199210
JACOCO_HTML_URL: ${{ steps.publish-quality-previews.outputs.jacoco_url }}
200211
run: python3 .github/scripts/generate-quality-report.py
201212
- name: Upload quality report summary
202-
if: ${{ always() }}
213+
if: ${{ always() && matrix.java-version == 8 }}
203214
uses: actions/upload-artifact@v4
204215
with:
205216
name: quality-report
206217
path: quality-report.md
207218
- name: Publish quality report comment
208-
if: ${{ github.event_name == 'pull_request' }}
219+
if: ${{ github.event_name == 'pull_request' && matrix.java-version == 8 }}
209220
uses: actions/github-script@v7
210221
with:
211222
script: |
@@ -223,9 +234,11 @@ jobs:
223234
run: ant -noinput -buildfile Ports/CLDC11/build.xml jar
224235

225236
- name: Build Release
237+
if: matrix.java-version == 8
226238
run: ant -noinput -buildfile CodenameOne/build.xml weeklyLibUpdate
227239

228240
- name: Build JavaDocs
241+
if: matrix.java-version == 8
229242
run: |
230243
cd CodenameOne
231244
mkdir -p build
@@ -246,6 +259,7 @@ jobs:
246259
run: mvn -f vm/JavaAPI/pom.xml package
247260

248261
- name: Upload a Build Artifact
262+
if: matrix.java-version == 8
249263
uses: actions/upload-artifact@v4
250264
with:
251265
name: JavaAPI.jar
@@ -258,12 +272,14 @@ jobs:
258272
run: ant -noinput -buildfile Ports/CLDC11/build.xml jar
259273

260274
- name: Upload a Build Artifact
275+
if: matrix.java-version == 8
261276
uses: actions/upload-artifact@v4
262277
with:
263278
name: ByteCodeTranslator.jar
264279
path: vm/ByteCodeTranslator/target/ByteCodeTranslator-1.0-SNAPSHOT.jar
265280

266281
- name: Upload a Build Artifact
282+
if: matrix.java-version == 8
267283
uses: actions/upload-artifact@v4
268284
with:
269285
name: CLDC11.jar
@@ -273,9 +289,11 @@ jobs:
273289
run: ant -noinput -buildfile Ports/Android/build.xml jar
274290

275291
- name: Packaging Everything
292+
if: matrix.java-version == 8
276293
run: zip -j result.zip CodenameOne/javadocs.zip CodenameOne/dist/CodenameOne.jar CodenameOne/updatedLibs.zip Ports/JavaSE/dist/JavaSE.jar build/CodenameOneDist/CodenameOne/demos/CodenameOne_SRC.zip
277294

278295
- name: Copying Files to Server
296+
if: matrix.java-version == 8
279297
uses: marcodallasanta/[email protected]
280298
with:
281299
host: ${{ secrets.WP_HOST }}
@@ -284,6 +302,7 @@ jobs:
284302
local: result.zip
285303

286304
- name: Upload a Build Artifact
305+
if: matrix.java-version == 8
287306
uses: actions/upload-artifact@v4
288307
with:
289308
name: JavaSE.jar

0 commit comments

Comments
 (0)