-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build on latest Java, test through lowest possible - approach 2 #298
base: master
Are you sure you want to change the base?
Conversation
@@ -38,4 +39,5 @@ jobs: | |||
- name: Test cross Java versions compatibility | |||
run: | | |||
./gradlew --version | |||
./gradlew --stacktrace build compatTestJava${{ matrix.jdk }} | |||
./gradlew -q javaToolchains | |||
./gradlew --stacktrace -PnexusPublishPlugin.test.java=${{ matrix.testJdk }} build compatTestJava${{ matrix.jdk }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid "javaauto" in stutter, we could add testJdk matrix elements manually, adjusting "auto" version to a given JDK version.
Also a shell command could replace "auto" with a proper version.
However, I don't know which of this 3 options is best :-/
jdk: [11, 17] | ||
name: "OpenJDK ${{ matrix.jdk }}" | ||
jdk: [11, 17, 19] | ||
testJdk: [auto, 8] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we shouldn't have "fail-fast" disabled for that workflow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Java 21 can be used instead of 19 once #296 is merged.
@@ -261,6 +288,19 @@ tasks { | |||
withType<Test>().matching { it.name.startsWith("compatTest") }.configureEach { | |||
systemProperty("plugin.version", project.version) | |||
} | |||
named<Test>("test").configure { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is equivalent:
named<Test>("test").configure { | |
test { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that tasks.test {}
or project.test {}
just to make sure it's at the right level in the build.gradle.
@@ -174,7 +190,7 @@ kotlin.target.compilations.configureEach { | |||
compilerOptions.configure { | |||
// Gradle fully supports running on Java 8: https://docs.gradle.org/current/userguide/compatibility.html, | |||
// so we should allow users to do that too. | |||
jvmTarget = JvmTarget.fromTarget(JavaVersion.VERSION_1_8.toString()) | |||
jvmTarget = JvmTarget.fromTarget(project.java.targetCompatibility.toString()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider merging #300 then rebasing.
I'm yet to do a full review, thanks for looking @3flex ! |
This is a reworked variant of #254 (I really liked the approach with overriding javaLauncher for test @TWiStErRob! - originally I wanted to publish binaries locally and pass it to another jobs, which javaLauncher is much easier) with the following changes:
This is not as reliable as separate e2eTests executed with lower JDK, but the binaries are built with higher JDK and running tests leverages that binaries.
Downsides:
compatTestJavaauto
added)Maybe you will have an idea how to improve it further.