aboutsummaryrefslogtreecommitdiff
path: root/build-logic/src/main/kotlin/org/jetbrains
diff options
context:
space:
mode:
authorGoooler <wangzongler@gmail.com>2023-04-26 20:38:36 +0800
committerGitHub <noreply@github.com>2023-04-26 14:38:36 +0200
commit43c33f63506f0d583a9a8f83ec5dc378f33b5ea7 (patch)
tree1e546610a6f8ae6512afedae50dcd8f408cc54da /build-logic/src/main/kotlin/org/jetbrains
parent1632ff37d0fcfe8e9db260b0aaf3b547533f5a08 (diff)
downloaddokka-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.kts6
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)
})