Skip to content

Commit 5249796

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

File tree

4 files changed

+36
-19
lines changed

4 files changed

+36
-19
lines changed

.github/workflows/ci-pr.yml

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,48 @@ 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'
18+
- name: Set up JDK 25
19+
uses: actions/setup-java@v4
20+
with:
21+
java-version: '25'
22+
distribution: 'liberica'
23+
cache: maven
24+
- name: Build, test, and run samples using Java 25 w/ target=17
25+
run: |
26+
./mvnw -B clean install
27+
28+
- name: Set up JDK 17
2029
uses: actions/setup-java@v4
2130
with:
2231
java-version: '17'
2332
distribution: 'temurin'
2433
cache: maven
25-
- name: Set up JDK 25 (main)
26-
if: github.base_ref == 'main'
34+
- name: Run samples built w/ Java 25 w/ target=17 using Java 17
35+
run: |
36+
pushd samples > /dev/null
37+
../mvnw test \
38+
-Dmaven-checkstyle-plugin.config.location=../src/checkstyle
39+
popd > /dev/null
40+
41+
- name: Set up JDK 25
2742
uses: actions/setup-java@v4
2843
with:
2944
java-version: '25'
3045
distribution: 'liberica'
3146
cache: maven
32-
- name: Build and test
47+
- name: Build and run samples using Java 25 w/ target=25
3348
run: |
34-
./mvnw -B clean install
49+
pushd samples > /dev/null
50+
../mvnw clean install \
51+
-pl '!grpc-server-kotlin' \
52+
-Dmaven-checkstyle-plugin.config.location=../src/checkstyle \
53+
-Djava.version=25
54+
../mvnw clean install \
55+
-pl 'grpc-server-kotlin' \
56+
-Dmaven-checkstyle-plugin.config.location=../src/checkstyle \
57+
-Djava.version=24
58+
popd > /dev/null
59+
3560
- name: Capture Test Results
3661
if: failure()
3762
uses: actions/upload-artifact@v4

.github/workflows/deploy.yml

Lines changed: 1 addition & 10 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:
@@ -13,16 +13,7 @@ jobs:
1313
if: ${{ github.repository == 'spring-projects/spring-grpc' }}
1414

1515
steps:
16-
- uses: actions/checkout@v4
17-
- name: Set up JDK 17 (0.x)
18-
if: github.ref != 'refs/heads/main'
19-
uses: actions/setup-java@v4
20-
with:
21-
java-version: '17'
22-
distribution: 'temurin'
23-
cache: maven
2416
- name: Set up JDK 25 (main)
25-
if: github.ref == 'refs/heads/main'
2617
uses: actions/setup-java@v4
2718
with:
2819
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>

samples/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
<name>Parent Demo</name>
1717

1818
<modules>
19+
<module>grpc-server</module>
1920
<module>grpc-client</module>
2021
<module>grpc-oauth2</module>
2122
<module>grpc-reactive</module>
2223
<module>grpc-secure</module>
23-
<module>grpc-server</module>
2424
<module>grpc-server-kotlin</module>
2525
<module>grpc-server-netty-shaded</module>
2626
<module>grpc-tomcat</module>

0 commit comments

Comments
 (0)