ci(java): run Java 11 and 17 builds in parallel with matrix strategy

Split the Java 17 workflow into a matrix for Java 11 and Java 17.
Run Checkstyle once in a dedicated Java 17 job and skip the lifecycle-bound Checkstyle execution in the matrix builds to avoid redundant work.

Closes #1331.
This commit is contained in:
Divyanshu Singh
2026-10-29 18:33:13 +08:00
committed by GitHub
parent a065b4b9c6
commit 005a9a353a
+22 -3
View File
@@ -28,9 +28,9 @@ permissions:
contents: read
jobs:
build-java:
style-check:
runs-on: ubuntu-24.04
name: Build
name: Style Check
defaults:
run:
working-directory: ./java
@@ -45,5 +45,24 @@ jobs:
cache: "maven"
- name: Java Style Check
run: ./mvnw checkstyle:check
build-java:
runs-on: ubuntu-24.04
name: Build (Java ${{ matrix.java-version }})
strategy:
matrix:
java-version: [11, 17]
defaults:
run:
working-directory: ./java
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Set up Java ${{ matrix.java-version }}
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: ${{ matrix.java-version }}
cache: "maven"
- name: Build and install
run: ./mvnw clean install
run: ./mvnw clean install -Dcheckstyle.skip=true