Skip to content

Commit ee68fc0

Browse files
committed
4.x: build.gradle to use all available cores on CI
1 parent 8800ece commit ee68fc0

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

build.gradle

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,11 @@ if (!isCI) {
176176

177177
test {
178178
maxHeapSize = "1200m"
179-
maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1
179+
if (System.getenv("CI") != null) {
180+
maxParallelForks = Runtime.runtime.availableProcessors()
181+
} else {
182+
maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1
183+
}
180184
useJUnitPlatform()
181185
}
182186

@@ -193,7 +197,11 @@ tasks.register('testNG', Test) {
193197
useTestNG()
194198

195199
maxHeapSize = "1200m"
196-
maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1
200+
if (System.getenv("CI") != null) {
201+
maxParallelForks = Runtime.runtime.availableProcessors()
202+
} else {
203+
maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1
204+
}
197205
// maxParallelForks = 1
198206

199207
// Ensure JUnit-compatible XML output in the standard location

0 commit comments

Comments
 (0)