Skip to content

Commit 32926fc

Browse files
committed
Run Maven samples w/ both 25 and 17
This commit updates both ci-pr.yml and deploy.yml to build and test w/ Java 25 and run Maven samples w/ Java 17. See #290 Signed-off-by: onobc <[email protected]>
1 parent c1b2846 commit 32926fc

File tree

3 files changed

+41
-17
lines changed

3 files changed

+41
-17
lines changed

.github/workflows/ci-pr.yml

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,30 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- uses: actions/checkout@v4
18-
- name: Set up JDK 17 (0.x)
19-
if: github.base_ref == '0.x'
20-
uses: actions/setup-java@v4
21-
with:
22-
java-version: '17'
23-
distribution: 'temurin'
24-
cache: maven
25-
- name: Set up JDK 25 (main)
26-
if: github.base_ref == 'main'
18+
- name: Set up JDK 25
2719
uses: actions/setup-java@v4
2820
with:
2921
java-version: '25'
3022
distribution: 'liberica'
3123
cache: maven
32-
- name: Build and test
24+
- name: Build, test, and run samples (Java 25)
3325
run: |
3426
./mvnw -B clean install
27+
28+
- name: Set up JDK 17
29+
uses: actions/setup-java@v4
30+
with:
31+
java-version: '17'
32+
distribution: 'temurin'
33+
cache: maven
34+
- name: Run samples w/ Java 17
35+
run: |
36+
pushd samples > /dev/null
37+
../mvnw clean install \
38+
-Dmaven-checkstyle-plugin.config.location=../src/checkstyle \
39+
-Djava.version=17
40+
popd > /dev/null
41+
3542
- name: Capture Test Results
3643
if: failure()
3744
uses: actions/upload-artifact@v4

.github/workflows/deploy.yml

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
name: Deploy Jars
44
on:
55
push:
6-
branches: [ main, 0.x ]
6+
branches: [ main ]
77

88
jobs:
99
build:
@@ -14,15 +14,31 @@ jobs:
1414

1515
steps:
1616
- uses: actions/checkout@v4
17-
- name: Set up JDK 17 (0.x)
18-
if: github.ref != 'refs/heads/main'
17+
- name: Set up JDK 25
18+
uses: actions/setup-java@v4
19+
with:
20+
java-version: '25'
21+
distribution: 'liberica'
22+
cache: maven
23+
- name: Build, test, and run samples (Java 25)
24+
run: |
25+
./mvnw -B clean install
26+
27+
- name: Set up JDK 17
1928
uses: actions/setup-java@v4
2029
with:
2130
java-version: '17'
2231
distribution: 'temurin'
2332
cache: maven
24-
- name: Set up JDK 25 (main)
25-
if: github.ref == 'refs/heads/main'
33+
- name: Run samples w/ Java 17
34+
run: |
35+
pushd samples > /dev/null
36+
../mvnw clean install \
37+
-Dmaven-checkstyle-plugin.config.location=../src/checkstyle \
38+
-Djava.version=17
39+
popd > /dev/null
40+
41+
- name: Set up JDK 25
2642
uses: actions/setup-java@v4
2743
with:
2844
java-version: '25'

pom.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@
118118
<spring-javaformat-checkstyle.version>0.0.43</spring-javaformat-checkstyle.version>
119119
<disable.format.checks>false</disable.format.checks>
120120
<disable.checkstyle.checks>false</disable.checkstyle.checks>
121+
<maven-checkstyle-plugin.config.location>src/checkstyle</maven-checkstyle-plugin.config.location>
121122
<maven-checkstyle-plugin.failsOnError>true</maven-checkstyle-plugin.failsOnError>
122123
<maven-checkstyle-plugin.failOnViolation>true</maven-checkstyle-plugin.failOnViolation>
123124
<maven-checkstyle-plugin.includeTestSourceDirectory>true</maven-checkstyle-plugin.includeTestSourceDirectory>
@@ -165,9 +166,9 @@
165166
<phase>validate</phase>
166167
<inherited>true</inherited>
167168
<configuration>
168-
<configLocation>src/checkstyle/checkstyle.xml</configLocation>
169+
<configLocation>${maven-checkstyle-plugin.config.location}/checkstyle.xml</configLocation>
169170
<propertyExpansion>
170-
config_loc=src/checkstyle
171+
config_loc=${maven-checkstyle-plugin.config.location}
171172
</propertyExpansion>
172173
<skip>${disable.checkstyle.checks}</skip>
173174
<includeTestSourceDirectory>${maven-checkstyle-plugin.includeTestSourceDirectory}</includeTestSourceDirectory>

0 commit comments

Comments
 (0)