Add Java 21 support for running tests (#622)

This commit adds a Gradle property 'testToolchain' that when set will
configure the Java toolchain plugin accordingly.

Additionally:
-------------
* Replace the custom toolchain plugin with the vanilla one provided by
  Gradle

* Move the Java conventions from Java plugin to Groovy script

* [CI] Add Java 21 to check-samples.yml
This commit is contained in:
Chris Bono
2024-03-22 10:51:10 -05:00
committed by GitHub
parent eefff55c9f
commit 19957ac619
7 changed files with 37 additions and 176 deletions

View File

@@ -39,7 +39,11 @@ jobs:
needs: [prerequisites]
strategy:
matrix:
springBootVersion: [ "${{ needs.prerequisites.outputs.boot_version }}" ]
include:
- javaVersion: 17
springBootVersion: "${{ needs.prerequisites.outputs.boot_version }}"
- javaVersion: 21
springBootVersion: "${{ needs.prerequisites.outputs.boot_version }}"
runs-on: ubuntu-latest
if: needs.prerequisites.outputs.runjobs
steps:
@@ -50,6 +54,7 @@ jobs:
LOCAL_REPOSITORY_PATH: ${{ github.workspace }}/build/publications/repos
VERSION: ${{ needs.prerequisites.outputs.project_version }}
BOOT_VERSION: ${{ matrix.springBootVersion }}
JAVA_VERSION: ${{ matrix.javaVersion }}
run: |
./gradlew publishMavenJavaPublicationToLocalRepository
./gradlew \
@@ -57,5 +62,6 @@ jobs:
-PlocalRepositoryPath="$LOCAL_REPOSITORY_PATH" \
-PspringPulsarVersion="$VERSION" \
-PspringBootVersion="$BOOT_VERSION" \
-PtestToolchain="$JAVA_VERSION" \
-PsampleTests \
:runAllSampleTests