diff --git a/.github/workflows/gradle-pr-build.yml b/.github/workflows/gradle-pr-build.yml index 0a4d015ae7..ae9f99bac0 100644 --- a/.github/workflows/gradle-pr-build.yml +++ b/.github/workflows/gradle-pr-build.yml @@ -2,7 +2,6 @@ name: PR Build on: pull_request: - branches: [ master ] jobs: build: @@ -15,23 +14,16 @@ jobs: - uses: actions/setup-java@v3 with: distribution: 'zulu' - java-version: 8 + java-version: 17 - uses: gradle/gradle-build-action@v2 - name: Build with release Kotlin version run: ./gradlew clean build ktlint - - name: Upload dependency verification report - uses: actions/upload-artifact@v3 - if: failure() - with: - name: Build artifacts - path: '**/build/**/dependency-verification-report.html' - if-no-files-found: warn - name: Upload test results uses: actions/upload-artifact@v3 if: failure() with: name: Test artifacts - path: '**/tests/**/*.html' + path: 'ktlint/build/reports/tests/**' if-no-files-found: warn - name: Build with dev Kotlin version run: ./gradlew -PkotlinDev clean build ktlint diff --git a/.github/workflows/gradle-snapshot-build.yml b/.github/workflows/gradle-snapshot-build.yml index 48c52f7326..0143f948a5 100644 --- a/.github/workflows/gradle-snapshot-build.yml +++ b/.github/workflows/gradle-snapshot-build.yml @@ -17,7 +17,7 @@ jobs: - uses: actions/setup-java@v3 with: distribution: 'zulu' - java-version: 8 + java-version: 17 - uses: gradle/gradle-build-action@v2 - name: Publish snapshot to Maven run: ./gradlew clean publishMavenPublicationToMavenCentralRepository --no-daemon --no-parallel diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index db80e5b329..093da25547 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -2,12 +2,6 @@ plugins { `kotlin-dsl` } -java { - toolchain { - languageVersion.set(JavaLanguageVersion.of(8)) - } -} - repositories { mavenCentral() } diff --git a/buildSrc/src/main/kotlin/ToolchainForTests.kt b/buildSrc/src/main/kotlin/ToolchainForTests.kt index 39a0145bcc..98f69babd6 100644 --- a/buildSrc/src/main/kotlin/ToolchainForTests.kt +++ b/buildSrc/src/main/kotlin/ToolchainForTests.kt @@ -9,12 +9,11 @@ val Project.javaToolchains: JavaToolchainService fun Project.addAdditionalJdkVersionTests() { // Tests should be run on all supported LTS versions of the JDK. For example, see https://endoflife.date/java - addJdkVersionTests("testOnJdk11", 11) - addJdkVersionTests("testOnJdk17", 17) + arrayOf(8, 11, 17).forEach(::addJdkVersionTests) } -private fun Project.addJdkVersionTests(taskName: String, jdkVersion: Int) { - val jdkVersionTests = tasks.register(taskName) { +private fun Project.addJdkVersionTests(jdkVersion: Int) { + val jdkVersionTests = tasks.register("testOnJdk$jdkVersion") { javaLauncher.set( javaToolchains.launcherFor { languageVersion.set(JavaLanguageVersion.of(jdkVersion)) diff --git a/gradle.properties b/gradle.properties index a8b15ece81..bd3551e826 100644 --- a/gradle.properties +++ b/gradle.properties @@ -15,7 +15,7 @@ POM_DEVELOPER_ID=pinterest POM_DEVELOPER_NAME=Pinterest, Inc. # Gradle properties -org.gradle.jvmargs=-Xmx768m +org.gradle.jvmargs=-Xmx4g org.gradle.parallel=true org.gradle.caching=true org.gradle.vfs.watch=true