diff options
author | Goooler <wangzongler@gmail.com> | 2023-04-26 20:38:36 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-26 14:38:36 +0200 |
commit | 43c33f63506f0d583a9a8f83ec5dc378f33b5ea7 (patch) | |
tree | 1e546610a6f8ae6512afedae50dcd8f408cc54da /build-logic/src/main/kotlin/org/jetbrains | |
parent | 1632ff37d0fcfe8e9db260b0aaf3b547533f5a08 (diff) | |
download | dokka-43c33f63506f0d583a9a8f83ec5dc378f33b5ea7.tar.gz dokka-43c33f63506f0d583a9a8f83ec5dc378f33b5ea7.tar.bz2 dokka-43c33f63506f0d583a9a8f83ec5dc378f33b5ea7.zip |
Execute unit tests in parallel (#2953)
Details: https://docs.gradle.org/7.6/userguide/performance.html#execute_tests_in_parallel
Diffstat (limited to 'build-logic/src/main/kotlin/org/jetbrains')
-rw-r--r-- | build-logic/src/main/kotlin/org/jetbrains/conventions/base-java.gradle.kts | 6 |
1 files changed, 6 insertions, 0 deletions
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 cff7eb3e..c5b90e81 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 @@ -22,6 +22,12 @@ java { tasks.withType<Test>().configureEach { useJUnitPlatform() + maxParallelForks = if (System.getenv("GITHUB_ACTIONS") != null) { + Runtime.getRuntime().availableProcessors() + } else { + (Runtime.getRuntime().availableProcessors() / 2).takeIf { it > 0 } ?: 1 + } + javaLauncher.set(javaToolchains.launcherFor { languageVersion.set(dokkaBuild.testJavaLauncherVersion) }) |