Skip to content

Commit 5b9497f

Browse files
committed
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
1 parent 0cb586c commit 5b9497f

File tree

1 file changed

+29
-9
lines changed

1 file changed

+29
-9
lines changed

.github/workflows/maven.yml

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,33 @@ on:
88
types: [opened, synchronize, reopened]
99

1010
jobs:
11-
build:
11+
test-java21:
12+
name: Test Core Library (Java 21)
1213
runs-on: ubuntu-latest
13-
name: Build with JDK 24
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Set up JDK 21
19+
uses: actions/setup-java@v4
20+
with:
21+
java-version: '21'
22+
distribution: 'oracle'
23+
24+
- name: Cache Maven dependencies
25+
uses: actions/cache@v4
26+
with:
27+
path: ~/.m2
28+
key: ${{ runner.os }}-m2-java21-${{ hashFiles('**/pom.xml') }}
29+
restore-keys: ${{ runner.os }}-m2-java21
30+
31+
- name: Test core library (Java 21)
32+
run: mvn clean test -pl json-java21
1433

34+
test-java24:
35+
name: Test with Tooling (Java 24)
36+
runs-on: ubuntu-latest
37+
1538
steps:
1639
- uses: actions/checkout@v4
1740

@@ -25,11 +48,8 @@ jobs:
2548
uses: actions/cache@v4
2649
with:
2750
path: ~/.m2
28-
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
29-
restore-keys: ${{ runner.os }}-m2
30-
31-
- name: Build with Maven
32-
run: mvn clean compile
51+
key: ${{ runner.os }}-m2-java24-${{ hashFiles('**/pom.xml') }}
52+
restore-keys: ${{ runner.os }}-m2-java24
3353

34-
- name: Package JAR
35-
run: mvn package
54+
- name: Test full project (Java 24)
55+
run: mvn clean test

0 commit comments

Comments
 (0)