From 450f902e4d6125128b2f13978a4e3243a5ae5d15 Mon Sep 17 00:00:00 2001 From: Zongle Wang Date: Wed, 31 Jul 2024 11:50:51 -0400 Subject: [PATCH] Add more Java versions into test matrix --- .github/workflows/ci.yml | 4 +++- .../jengelman/gradle/plugins/shadow/ShadowPluginSpec.groovy | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a95da0095..ac0b62e8a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,13 +14,15 @@ jobs: strategy: matrix: os: [ ubuntu-latest, windows-latest ] + # Always test on the latest version and all LTS. + java: [ 11, 17, 21, 22 ] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - uses: actions/setup-java@v4 with: distribution: 'zulu' - java-version: 21 + java-version: ${{ matrix.java }} - uses: gradle/actions/setup-gradle@v3 with: gradle-home-cache-cleanup: true diff --git a/src/test/groovy/com/github/jengelman/gradle/plugins/shadow/ShadowPluginSpec.groovy b/src/test/groovy/com/github/jengelman/gradle/plugins/shadow/ShadowPluginSpec.groovy index 325babe64..c71b6c765 100644 --- a/src/test/groovy/com/github/jengelman/gradle/plugins/shadow/ShadowPluginSpec.groovy +++ b/src/test/groovy/com/github/jengelman/gradle/plugins/shadow/ShadowPluginSpec.groovy @@ -2,12 +2,14 @@ package com.github.jengelman.gradle.plugins.shadow import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar import com.github.jengelman.gradle.plugins.shadow.util.PluginSpecification +import org.gradle.api.JavaVersion import org.gradle.api.Project import org.gradle.api.artifacts.Configuration import org.gradle.api.plugins.JavaPlugin import org.gradle.testfixtures.ProjectBuilder import org.gradle.testkit.runner.BuildResult import spock.lang.Ignore +import spock.lang.IgnoreIf import spock.lang.Issue import spock.lang.Unroll @@ -52,6 +54,10 @@ class ShadowPluginSpec extends PluginSpecification { } + @IgnoreIf({ + // Gradle 8.3 doesn't support Java 21. + JavaVersion.current().majorVersion.toInteger() >= 21 + }) @Unroll def 'Compatible with Gradle #version'() { given: