Make Gretty aware of Gradle Java Toolchain (v3.x) #620
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: ['push', 'pull_request'] | |
env: | |
PRIVATE_REPO: "${{ github.workspace }}/build/githubActionGrettyPrivateRepository" | |
jobs: | |
build: | |
name: Build Gretty | |
runs-on: ubuntu-latest | |
env: | |
JDK_VERSION: "11" | |
GRADLE_VERSION: "6.9.4" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK ${{ env.JDK_VERSION }} | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: ${{ env.JDK_VERSION }} | |
- name: Build with Gradle ${{ env.GRADLE_VERSION }} | |
run: | | |
set -e | |
./gradlew --no-daemon wrapper --gradle-version $GRADLE_VERSION --distribution-type all | |
./gradlew --no-daemon --warning-mode all -PprivateRepoDir=$PRIVATE_REPO build | |
set +e | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: gretty-private-repository | |
path: ${{ env.PRIVATE_REPO }} | |
test: | |
name: Gradle ${{ matrix.gradle }} on Java ${{ matrix.java }}${{ matrix.toolchainJavaVersion && format(' (Java {0} Container)', matrix.toolchainJavaVersion) || '' }} | |
runs-on: ubuntu-latest | |
needs: build | |
strategy: | |
matrix: | |
include: | |
- java: 8 | |
gradle: '6.9.4' | |
container: "['jetty9.3','jetty9.4','tomcat85','tomcat9']" | |
- java: 8 | |
gradle: '6.9.4' | |
container: "['jetty9.3','jetty9.4','tomcat85','tomcat9']" | |
toolchainJavaVersion: 21 | |
- java: 11 | |
gradle: '6.9.4' | |
container: "['jetty9.3','jetty9.4','jetty10','tomcat85','tomcat9']" | |
- java: 11 | |
gradle: '6.9.4' | |
container: "['jetty9.3','jetty9.4','jetty10','tomcat85','tomcat9']" | |
toolchainJavaVersion: 21 | |
- java: 17 | |
gradle: '7.6.4' | |
container: "['jetty9.3','jetty9.4','jetty10','tomcat85','tomcat9']" | |
properties: '-Pspock_version=2.3-groovy-3.0 -PgebVersion=5.1' | |
- java: 17 | |
gradle: '7.6.4' | |
container: "['jetty9.3','jetty9.4','jetty10','tomcat85','tomcat9']" | |
toolchainJavaVersion: 21 | |
properties: '-Pspock_version=2.3-groovy-3.0 -PgebVersion=5.1' | |
# TODO: add a JDK-21 build but fix the following issue before that: | |
# groovy.lang.MissingPropertyException: Could not set unknown property 'classifier' for task ':libs:gretty:javadocJar' of type org.gradle.api.tasks.bundling.Jar | |
# https://github.com/gretty-gradle-plugin/gretty/actions/runs/7788654990/job/21238688742 | |
env: | |
TEST_ALL_CONTAINERS: ${{ matrix.container }} | |
GRADLE_VERSION: ${{ matrix.gradle }} | |
EXTRA_PROPERTIES: ${{ matrix.properties }} | |
TOOLCHAIN_JAVA_ARGS: "${{ matrix.toolchainJavaVersion && format('-PtoolchainJavaVersion={0}', matrix.toolchainJavaVersion) || '' }}" | |
GRADLE_TEST_TASK: "${{ matrix.toolchainJavaVersion && 'testAllJavaToolchain' || 'testAll' }}" | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: gretty-private-repository | |
path: ${{ env.PRIVATE_REPO }} | |
# Begin workaround: because the current Gradle wrapper does not support Java 17, | |
# we use JDK 15 to bootstrap the appropriate Gradle version, and then proceed | |
# to use a recent version of Gradle and Java. | |
- name: Set up JDK 15 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: 15 | |
- name: Bootstrap Gradle version | |
run: ./gradlew --no-daemon wrapper --gradle-version $GRADLE_VERSION --distribution-type all | |
# end workaround | |
- name: Set up JDK ${{ matrix.java }} | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: ${{ matrix.java }} | |
- name: Set up Gradle ${{ matrix.gradle }} | |
run: ./gradlew --no-daemon wrapper --gradle-version $GRADLE_VERSION --distribution-type all | |
- name: Run Integration Tests | |
run: | | |
../gradlew --no-daemon \ | |
--warning-mode all \ | |
-PprivateRepoDir=$PRIVATE_REPO \ | |
$EXTRA_PROPERTIES $TOOLCHAIN_JAVA_ARGS \ | |
-PgeckoDriverPlatform=linux64 \ | |
-PtestAllContainers=$TEST_ALL_CONTAINERS \ | |
$GRADLE_TEST_TASK | |
working-directory: integrationTests |