From 4e66ebf6fd19e8625d587a390491470d92a5c6f0 Mon Sep 17 00:00:00 2001 From: onobc Date: Thu, 20 Nov 2025 20:28:34 -0600 Subject: [PATCH] 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 --- .github/workflows/ci-pr.yml | 37 ++++++++++++++++++++++++++++++------ .github/workflows/deploy.yml | 11 +---------- pom.xml | 5 +++-- samples/pom.xml | 2 +- 4 files changed, 36 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci-pr.yml b/.github/workflows/ci-pr.yml index 53c3b890..3334e56b 100644 --- a/.github/workflows/ci-pr.yml +++ b/.github/workflows/ci-pr.yml @@ -15,23 +15,48 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Set up JDK 17 (0.x) - if: github.base_ref == '0.x' + - name: Set up JDK 25 + uses: actions/setup-java@v4 + with: + java-version: '25' + distribution: 'liberica' + cache: maven + - name: Build, test, and run samples using Java 25 w/ target=17 + run: | + ./mvnw -B clean install + + - name: Set up JDK 17 uses: actions/setup-java@v4 with: java-version: '17' distribution: 'temurin' cache: maven - - name: Set up JDK 25 (main) - if: github.base_ref == 'main' + - name: Run samples built w/ Java 25 w/ target=17 using Java 17 + run: | + pushd samples > /dev/null + ../mvnw test \ + -Dmaven-checkstyle-plugin.config.location=../src/checkstyle + popd > /dev/null + + - name: Set up JDK 25 uses: actions/setup-java@v4 with: java-version: '25' distribution: 'liberica' cache: maven - - name: Build and test + - name: Build and run samples using Java 25 w/ target=25 run: | - ./mvnw -B clean install + pushd samples > /dev/null + ../mvnw clean install \ + -pl '!grpc-server-kotlin' \ + -Dmaven-checkstyle-plugin.config.location=../src/checkstyle \ + -Djava.version=25 + ../mvnw clean install \ + -pl 'grpc-server-kotlin' \ + -Dmaven-checkstyle-plugin.config.location=../src/checkstyle \ + -Djava.version=24 + popd > /dev/null + - name: Capture Test Results if: failure() uses: actions/upload-artifact@v4 diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 85074d6d..35e29546 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -3,7 +3,7 @@ name: Deploy Jars on: push: - branches: [ main, 0.x ] + branches: [ main ] jobs: build: @@ -13,16 +13,7 @@ jobs: if: ${{ github.repository == 'spring-projects/spring-grpc' }} steps: - - uses: actions/checkout@v4 - - name: Set up JDK 17 (0.x) - if: github.ref != 'refs/heads/main' - uses: actions/setup-java@v4 - with: - java-version: '17' - distribution: 'temurin' - cache: maven - name: Set up JDK 25 (main) - if: github.ref == 'refs/heads/main' uses: actions/setup-java@v4 with: java-version: '25' diff --git a/pom.xml b/pom.xml index 744479a8..9da4321e 100644 --- a/pom.xml +++ b/pom.xml @@ -118,6 +118,7 @@ 0.0.43 false false + src/checkstyle true true true @@ -165,9 +166,9 @@ validate true - src/checkstyle/checkstyle.xml + ${maven-checkstyle-plugin.config.location}/checkstyle.xml - config_loc=src/checkstyle + config_loc=${maven-checkstyle-plugin.config.location} ${disable.checkstyle.checks} ${maven-checkstyle-plugin.includeTestSourceDirectory} diff --git a/samples/pom.xml b/samples/pom.xml index 4e34e68e..467ef468 100644 --- a/samples/pom.xml +++ b/samples/pom.xml @@ -16,11 +16,11 @@ Parent Demo + grpc-server grpc-client grpc-oauth2 grpc-reactive grpc-secure - grpc-server grpc-server-kotlin grpc-server-netty-shaded grpc-tomcat