From 54decbe937ddcb0e3a8922babdc5f1d805fd42c0 Mon Sep 17 00:00:00 2001 From: Ignat Beresnev Date: Wed, 12 Jul 2023 14:59:51 +0200 Subject: Set the correct testLauncher property in workflows (#3064) --- .github/workflows/tests-smoke.yml | 14 ++++++++++---- .github/workflows/tests-thorough.yml | 11 +++++++---- .../src/main/kotlin/org/jetbrains/DokkaBuildProperties.kt | 2 +- .../kotlin/org/jetbrains/conventions/base-java.gradle.kts | 1 - 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/.github/workflows/tests-smoke.yml b/.github/workflows/tests-smoke.yml index 1177c111..7d41412c 100644 --- a/.github/workflows/tests-smoke.yml +++ b/.github/workflows/tests-smoke.yml @@ -6,6 +6,9 @@ concurrency: group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' cancel-in-progress: true +env: + JAVA_TEST_VERSION: 11 + jobs: test-matrix: strategy: @@ -21,15 +24,18 @@ jobs: java-version: 17 cache: 'maven' - uses: gradle/gradle-build-action@v2 - env: - ORG_GRADLE_PROJECT_org.jetbrains.dokka.javaToolchain.test: 11 with: gradle-home-cache-cleanup: true - name: Run tests under Windows if: matrix.os == 'windows-latest' # Running tests with the Gradle daemon on windows agents leads to some very strange # JVM crashes for some reason. Most likely a problem of Gradle/GitHub/Windows server - run: ./gradlew clean test --stacktrace --no-daemon --no-parallel "-Dorg.gradle.jvmargs=-Xmx1g -XX:MaxMetaspaceSize=500m" + run: > + ./gradlew clean test --stacktrace --no-daemon --no-parallel + "-Dorg.gradle.jvmargs=-Xmx1g -XX:MaxMetaspaceSize=500m" + "-Porg.jetbrains.dokka.javaToolchain.testLauncher=${{ env.JAVA_TEST_VERSION }}" - name: Run tests under Ubuntu if: matrix.os != 'windows-latest' - run: ./gradlew clean test --stacktrace + run: > + ./gradlew clean test --stacktrace + "-Porg.jetbrains.dokka.javaToolchain.testLauncher=${{ env.JAVA_TEST_VERSION }}" diff --git a/.github/workflows/tests-thorough.yml b/.github/workflows/tests-thorough.yml index 7684277e..9c4679b2 100644 --- a/.github/workflows/tests-thorough.yml +++ b/.github/workflows/tests-thorough.yml @@ -22,15 +22,18 @@ jobs: java-version: 17 cache: 'maven' - uses: gradle/gradle-build-action@v2 - env: - ORG_GRADLE_PROJECT_org.jetbrains.dokka.javaToolchain.test: ${{ matrix.javaVersion }} with: gradle-home-cache-cleanup: true - name: Run tests under Windows if: matrix.os == 'windows-latest' # Running tests with the Gradle daemon on windows agents leads to some very strange # JVM crashes for some reason. Most likely a problem of Gradle/GitHub/Windows server - run: ./gradlew clean test --stacktrace --no-daemon --no-parallel "-Dorg.gradle.jvmargs=-Xmx1g -XX:MaxMetaspaceSize=500m" + run: > + ./gradlew clean test --stacktrace --no-daemon --no-parallel + "-Dorg.gradle.jvmargs=-Xmx1g -XX:MaxMetaspaceSize=500m" + "-Porg.jetbrains.dokka.javaToolchain.testLauncher=${{ matrix.javaVersion }}" - name: Run tests under Ubuntu/Macos if: matrix.os != 'windows-latest' - run: ./gradlew clean test --stacktrace + run: > + ./gradlew clean test --stacktrace + "-Porg.jetbrains.dokka.javaToolchain.testLauncher=${{ matrix.javaVersion }}" diff --git a/build-logic/src/main/kotlin/org/jetbrains/DokkaBuildProperties.kt b/build-logic/src/main/kotlin/org/jetbrains/DokkaBuildProperties.kt index 57e20acd..84eb626e 100644 --- a/build-logic/src/main/kotlin/org/jetbrains/DokkaBuildProperties.kt +++ b/build-logic/src/main/kotlin/org/jetbrains/DokkaBuildProperties.kt @@ -12,7 +12,7 @@ import javax.inject.Inject * This is an extension created by the [org.jetbrains.conventions.Base_gradle] convention plugin. * * Default values are set in the root `gradle.properties`, and can be overridden via - * [CLI args, system properties, and environment variables](https://docs.gradle.org/current/userguide/build_environment.html#sec:project_properties) + * [project properties](https://docs.gradle.org/current/userguide/build_environment.html#sec:project_properties) */ abstract class DokkaBuildProperties @Inject constructor( private val providers: ProviderFactory, diff --git a/build-logic/src/main/kotlin/org/jetbrains/conventions/base-java.gradle.kts b/build-logic/src/main/kotlin/org/jetbrains/conventions/base-java.gradle.kts index c5b90e81..a4ed0ede 100644 --- a/build-logic/src/main/kotlin/org/jetbrains/conventions/base-java.gradle.kts +++ b/build-logic/src/main/kotlin/org/jetbrains/conventions/base-java.gradle.kts @@ -27,7 +27,6 @@ tasks.withType().configureEach { } else { (Runtime.getRuntime().availableProcessors() / 2).takeIf { it > 0 } ?: 1 } - javaLauncher.set(javaToolchains.launcherFor { languageVersion.set(dokkaBuild.testJavaLauncherVersion) }) -- cgit