diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index af880d919..67fae420b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,7 +25,9 @@ jobs: uses: docker/setup-buildx-action@v2 - uses: actions/setup-java@v3 with: - java-version: 11 + java-version: | + 17 + 11 distribution: 'zulu' cache: 'gradle' - name: Prepare build variables diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index ccb1d4f90..c10a1b585 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -19,7 +19,9 @@ jobs: uses: docker/setup-buildx-action@v2 - uses: actions/setup-java@v3 with: - java-version: 11 + java-version: | + 17 + 11 distribution: 'zulu' cache: 'gradle' - name: Prepare build variables diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 297d0f389..0b2a1b70a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,7 +23,9 @@ jobs: uses: docker/setup-buildx-action@v2 - uses: actions/setup-java@v3 with: - java-version: 11 + java-version: | + 17 + 11 distribution: 'zulu' cache: 'gradle' - name: Assemble release info diff --git a/build.gradle b/build.gradle index 17197cad8..5f5a793f0 100644 --- a/build.gradle +++ b/build.gradle @@ -73,6 +73,17 @@ subprojects { useJUnitPlatform() } + tasks.withType(JavaCompile).configureEach { + javaCompiler = javaToolchains.compilerFor { + languageVersion = JavaLanguageVersion.of(11) + } + } + tasks.withType(Test).configureEach { + javaLauncher = javaToolchains.launcherFor { + languageVersion = JavaLanguageVersion.of(17) + } + } + tasks.withType(JavaExec) { if (System.getProperty('DEBUG', 'false') == 'true') { jvmArgs '-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8188' diff --git a/igor-monitor-travis/src/test/groovy/com/netflix/spinnaker/igor/travis/client/logparser/ArtifactParserTest.groovy b/igor-monitor-travis/src/test/groovy/com/netflix/spinnaker/igor/travis/client/logparser/ArtifactParserTest.groovy index 348b814aa..9ae948af8 100644 --- a/igor-monitor-travis/src/test/groovy/com/netflix/spinnaker/igor/travis/client/logparser/ArtifactParserTest.groovy +++ b/igor-monitor-travis/src/test/groovy/com/netflix/spinnaker/igor/travis/client/logparser/ArtifactParserTest.groovy @@ -44,7 +44,7 @@ class ArtifactParserTest extends Specification { then: artifacts.first().fileName == "some-package-1.2.3-4.noarch.rpm" artifacts.last().fileName == "another-package-4.3.2.deb" - artifacts.size == 2 + artifacts.size() == 2 } def "make sure we only have one unique entry for each artifact"() { @@ -59,7 +59,7 @@ class ArtifactParserTest extends Specification { then: artifacts.first().fileName == "some-package-1.2.3-4.noarch.rpm" - artifacts.size == 1 + artifacts.size() == 1 } def "get multiple artifactory deb from log using default regexes"() { diff --git a/igor-web/src/main/groovy/com/netflix/spinnaker/igor/wercker/WerckerBuildMonitor.groovy b/igor-web/src/main/groovy/com/netflix/spinnaker/igor/wercker/WerckerBuildMonitor.groovy index 8fcbd527f..3d06e103f 100644 --- a/igor-web/src/main/groovy/com/netflix/spinnaker/igor/wercker/WerckerBuildMonitor.groovy +++ b/igor-web/src/main/groovy/com/netflix/spinnaker/igor/wercker/WerckerBuildMonitor.groovy @@ -147,14 +147,14 @@ class WerckerBuildMonitor extends CommonPollingMonitor allBuilds = allRuns.findAll { it?.startedAt?.fastTime > cursor } + List allBuilds = allRuns.findAll { it?.startedAt?.getTime() > cursor } if (!cursor && !igorProperties.spinnaker.build.handleFirstBuilds) { cache.setLastPollCycleTimestamp(master, pipeline, lastBuildStamp) return @@ -203,7 +203,7 @@ class WerckerBuildMonitor extends CommonPollingMonitor builds = service.getBuilds('myteam/mypipeline/myjob', 1421717251402) then: - builds.size == 3 + builds.size() == 3 builds[0].id == '49-id' builds[1].id == '48.1-id' builds[2].id == '47-id' diff --git a/igor-web/src/test/groovy/com/netflix/spinnaker/igor/scm/bitbucket/CommitControllerSpec.groovy b/igor-web/src/test/groovy/com/netflix/spinnaker/igor/scm/bitbucket/CommitControllerSpec.groovy index 035dd66b2..9ec523785 100644 --- a/igor-web/src/test/groovy/com/netflix/spinnaker/igor/scm/bitbucket/CommitControllerSpec.groovy +++ b/igor-web/src/test/groovy/com/netflix/spinnaker/igor/scm/bitbucket/CommitControllerSpec.groovy @@ -98,7 +98,7 @@ class CommitControllerSpec extends Specification { List commitsResponse = controller.compareCommits(projectKey, repositorySlug, controllerParams) then: - commitsResponse.size == 2 + commitsResponse.size() == 2 with(commitsResponse[0]) { displayId == "1234512" diff --git a/igor-web/src/test/groovy/com/netflix/spinnaker/igor/scm/github/CommitControllerSpec.groovy b/igor-web/src/test/groovy/com/netflix/spinnaker/igor/scm/github/CommitControllerSpec.groovy index a56047867..5a0081e9a 100644 --- a/igor-web/src/test/groovy/com/netflix/spinnaker/igor/scm/github/CommitControllerSpec.groovy +++ b/igor-web/src/test/groovy/com/netflix/spinnaker/igor/scm/github/CommitControllerSpec.groovy @@ -91,7 +91,7 @@ class CommitControllerSpec extends Specification { List commitsResponse = controller.compareCommits(projectKey, repositorySlug, ['to': toCommit, 'from': fromCommit]) then: - commitsResponse.size == 2 + commitsResponse.size() == 2 with(commitsResponse[0]) { displayId == "12345123" diff --git a/igor-web/src/test/groovy/com/netflix/spinnaker/igor/scm/gitlab/CommitControllerSpec.groovy b/igor-web/src/test/groovy/com/netflix/spinnaker/igor/scm/gitlab/CommitControllerSpec.groovy index 2b2b0477b..0932848e6 100644 --- a/igor-web/src/test/groovy/com/netflix/spinnaker/igor/scm/gitlab/CommitControllerSpec.groovy +++ b/igor-web/src/test/groovy/com/netflix/spinnaker/igor/scm/gitlab/CommitControllerSpec.groovy @@ -94,7 +94,7 @@ class CommitControllerSpec extends Specification { List commitsResponse = controller.compareCommits(projectKey, repositorySlug, ['to': toCommit, 'from': fromCommit]) then: - commitsResponse.size == 2 + commitsResponse.size() == 2 with(commitsResponse[0]) { displayId == "12345123" diff --git a/igor-web/src/test/groovy/com/netflix/spinnaker/igor/scm/stash/CommitControllerSpec.groovy b/igor-web/src/test/groovy/com/netflix/spinnaker/igor/scm/stash/CommitControllerSpec.groovy index 5d9cd598f..66fad058a 100644 --- a/igor-web/src/test/groovy/com/netflix/spinnaker/igor/scm/stash/CommitControllerSpec.groovy +++ b/igor-web/src/test/groovy/com/netflix/spinnaker/igor/scm/stash/CommitControllerSpec.groovy @@ -87,7 +87,7 @@ class CommitControllerSpec extends Specification { List commitsResponse = controller.compareCommits(projectKey, repositorySlug, ['to': toCommit, 'from': fromCommit]) then: - commitsResponse.size == 2 + commitsResponse.size() == 2 commitsResponse[0].displayId == "12345" commitsResponse[0].id == "1234512345123451234512345" commitsResponse[0].authorDisplayName == "Joe Coder" diff --git a/igor-web/src/test/groovy/com/netflix/spinnaker/igor/wercker/WerckerServiceSpec.groovy b/igor-web/src/test/groovy/com/netflix/spinnaker/igor/wercker/WerckerServiceSpec.groovy index f1f6e0cd1..1a9556a40 100644 --- a/igor-web/src/test/groovy/com/netflix/spinnaker/igor/wercker/WerckerServiceSpec.groovy +++ b/igor-web/src/test/groovy/com/netflix/spinnaker/igor/wercker/WerckerServiceSpec.groovy @@ -45,7 +45,7 @@ class WerckerServiceSpec extends Specification { ] expect: - service.jobs.size == 3 + service.jobs.size() == 3 service.jobs.contains('x/foo/myApp2/myPipeX') }