From 5b9497f53d5c80a57d8b8057716917963858b7f2 Mon Sep 17 00:00:00 2001 From: Simon Massey Date: Sun, 27 Jul 2025 17:41:09 +0100 Subject: [PATCH 1/2] feat: Implement multi-JDK CI build strategy - Add Java 21 job to test core library compatibility - Add Java 24 job to test full project including API tracker - Separate cache keys for different JDK versions - Validates Java 21 promise while enabling Java 24 tooling Closes #9 --- .github/workflows/maven.yml | 38 ++++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index e7d3ea5..d31aee2 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -8,10 +8,33 @@ on: types: [opened, synchronize, reopened] jobs: - build: + test-java21: + name: Test Core Library (Java 21) runs-on: ubuntu-latest - name: Build with JDK 24 + + steps: + - uses: actions/checkout@v4 + + - name: Set up JDK 21 + uses: actions/setup-java@v4 + with: + java-version: '21' + distribution: 'oracle' + + - name: Cache Maven dependencies + uses: actions/cache@v4 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-java21-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2-java21 + + - name: Test core library (Java 21) + run: mvn clean test -pl json-java21 + test-java24: + name: Test with Tooling (Java 24) + runs-on: ubuntu-latest + steps: - uses: actions/checkout@v4 @@ -25,11 +48,8 @@ jobs: uses: actions/cache@v4 with: path: ~/.m2 - key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} - restore-keys: ${{ runner.os }}-m2 - - - name: Build with Maven - run: mvn clean compile + key: ${{ runner.os }}-m2-java24-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2-java24 - - name: Package JAR - run: mvn package \ No newline at end of file + - name: Test full project (Java 24) + run: mvn clean test \ No newline at end of file From e53c43ee1c8d72faeb03a46f44fecf8838fcd4d0 Mon Sep 17 00:00:00 2001 From: Simon Massey Date: Sun, 27 Jul 2025 17:55:36 +0100 Subject: [PATCH 2/2] ci fixes --- .github/workflows/daily-api-tracker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/daily-api-tracker.yml b/.github/workflows/daily-api-tracker.yml index 5541a76..fdee9ca 100644 --- a/.github/workflows/daily-api-tracker.yml +++ b/.github/workflows/daily-api-tracker.yml @@ -27,8 +27,8 @@ jobs: key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} restore-keys: ${{ runner.os }}-m2 - - name: Build project - run: mvn clean compile -DskipTests + - name: Build and test project + run: mvn clean install - name: Run API Tracker run: |