Skip to content

Commit d750cad

Browse files
committed
java matrix build
1 parent 6c5dc2f commit d750cad

3 files changed

Lines changed: 24 additions & 45 deletions

File tree

‎.github/workflows/maven-tests.yml‎

Lines changed: 20 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,24 @@ env:
1717
permissions:
1818
contents: read
1919

20+
concurrency:
21+
group: maven-tests-${{ github.ref }}
22+
cancel-in-progress: true
23+
2024
jobs:
21-
test:
22-
name: Test (JDK ${{ matrix.java }})
25+
build:
26+
name: Build and Test (JDK ${{ matrix.java }})
2327
runs-on: ubuntu-latest
2428
strategy:
2529
fail-fast: false
2630
matrix:
2731
java:
2832
- '8'
33+
- '17'
34+
- '18'
35+
- '19'
36+
- '20'
37+
- '21'
2938

3039
steps:
3140
- name: Checkout
@@ -38,8 +47,8 @@ jobs:
3847
java-version: ${{ matrix.java }}
3948
cache: maven
4049

41-
- name: Run tests
42-
run: mvn -B -ntp test
50+
- name: Build and run tests
51+
run: mvn -B -ntp verify
4352

4453
- name: Upload surefire reports
4554
if: always()
@@ -49,27 +58,12 @@ jobs:
4958
path: target/surefire-reports
5059
if-no-files-found: warn
5160

52-
package:
53-
name: Package (JDK ${{ matrix.java }})
54-
runs-on: ubuntu-latest
55-
needs: test
56-
strategy:
57-
fail-fast: false
58-
matrix:
59-
java:
60-
- '8'
61-
62-
steps:
63-
- name: Checkout
64-
uses: actions/checkout@v4
65-
66-
- name: Set up JDK
67-
uses: actions/setup-java@v4
61+
- name: Upload packaged jars
62+
if: success() && (matrix.java == '8' || matrix.java == '21')
63+
uses: actions/upload-artifact@v4
6864
with:
69-
distribution: temurin
70-
java-version: ${{ matrix.java }}
71-
cache: maven
72-
73-
- name: Build package
74-
run: mvn -B -ntp package -DskipTests
65+
name: java-code-tracer-jars-jdk-${{ matrix.java }}
66+
path: |
67+
target/*.jar
68+
if-no-files-found: error
7569

‎README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ This is a deliberate choice — the primary target is legacy and monolithic syst
103103

104104
It runs fine on newer JVMs (11, 17, 21, …) without any changes.
105105

106+
The GitHub Actions build validates the project on JDK 8 and on JDK 17 through 21.
107+
106108
## Build
107109

108110
```bash

‎pom.xml‎

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
<properties>
1313
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1414
<java.version>8</java.version>
15-
<maven.compiler.source>${java.version}</maven.compiler.source>
16-
<maven.compiler.target>${java.version}</maven.compiler.target>
15+
<maven.compiler.release>${java.version}</maven.compiler.release>
1716
<maven.surefire.plugin.version>3.2.5</maven.surefire.plugin.version>
1817
<maven.compiler.plugin.version>3.13.0</maven.compiler.plugin.version>
1918
<maven.assembly.plugin.version>3.7.1</maven.assembly.plugin.version>
@@ -32,22 +31,7 @@
3231
</license>
3332
</licenses>
3433

35-
<repositories>
36-
<repository>
37-
<id>Sonatype-public</id>
38-
<name>SnakeYAML repository</name>
39-
<url>http://oss.sonatype.org/content/groups/public/</url>
40-
</repository>
41-
</repositories>
42-
4334
<dependencies>
44-
<dependency>
45-
<groupId>com.sun</groupId>
46-
<artifactId>tools</artifactId>
47-
<version>1.6.0</version>
48-
<scope>system</scope>
49-
<systemPath>${java.home}/../lib/tools.jar</systemPath>
50-
</dependency>
5135
<dependency>
5236
<groupId>org.yaml</groupId>
5337
<artifactId>snakeyaml</artifactId>
@@ -97,8 +81,7 @@
9781
<artifactId>maven-compiler-plugin</artifactId>
9882
<version>${maven.compiler.plugin.version}</version>
9983
<configuration>
100-
<source>${maven.compiler.source}</source>
101-
<target>${maven.compiler.target}</target>
84+
<release>${maven.compiler.release}</release>
10285
</configuration>
10386
</plugin>
10487

0 commit comments

Comments
 (0)