Download JDK for windows build (#851)

Don't use the system Java on Windows builds, instead download them from Adoptium.

Also:

* Fail job if curl returns a 4xx status code
* Add java version to `GradleJob`
This commit is contained in:
Daniel Chao
2024-12-19 09:23:04 -08:00
committed by Dan Chao
parent 639cc2430e
commit 3ece353e0c
7 changed files with 123 additions and 58 deletions
-20
View File
@@ -17,29 +17,9 @@ extends "GradleJob.pkl"
import "package://pkg.pkl-lang.org/pkl-pantry/com.circleci.v2@1.1.2#/Config.pkl"
javaVersion: "17.0"|"21.0"
os = "linux"
steps {
new Config.RunStep {
name = "gradle check"
command = "./gradlew \(module.gradleArgs) check"
}
}
job {
when (os == "linux") {
docker {
new {
image = "cimg/openjdk:\(javaVersion)"
}
}
}
when (os == "windows") {
machine {
image = "windows-server-2022-gui:current"
}
resource_class = "windows.large"
}
}