Skip to content

Commit 825896d

Browse files
committed
Gradle: Enable Parallel Execution by default
Signed-off-by: Fabio Di Fabio <[email protected]>
1 parent 66d4f58 commit 825896d

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

.github/workflows/pre-review.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ concurrency:
1414
cancel-in-progress: true
1515

1616
env:
17-
GRADLE_OPTS: "-Xmx6g -Dorg.gradle.parallel=true"
17+
GRADLE_OPTS: "-Xmx6g -Dorg.gradle.parallel=true -Dorg.gradle.caching=true"
1818
total-runners: 14
1919

2020
jobs:
@@ -79,7 +79,6 @@ jobs:
7979
env:
8080
GRADLEW_UNIT_TEST_ARGS: ${{matrix.gradle_args}}
8181
runs-on: ubuntu-22.04
82-
needs: [spotless, gradle-wrapper, repolint]
8382
permissions:
8483
checks: write
8584
statuses: write
@@ -104,7 +103,7 @@ jobs:
104103
with:
105104
cache-disabled: true
106105
- name: List unit tests
107-
run: ./gradlew test --test-dry-run -Dorg.gradle.parallel=true -Dorg.gradle.caching=true
106+
run: ./gradlew test --test-dry-run
108107
- name: Extract current test list
109108
run: mkdir tmp; find . -type f -name TEST-*.xml | xargs -I{} bash -c "xmlstarlet sel -t -v '/testsuite/@name' '{}'; echo '{}' | sed 's#\./\(.*\)/build/test-results/.*# \1#'" | tee tmp/currentTests.list
110109
- name: Get unit test reports
@@ -136,7 +135,7 @@ jobs:
136135
name: testList-${{ matrix.runner_index }}.txt
137136
path: testList.txt
138137
- name: run unit tests
139-
run: cat testList.txt | xargs -P 1 ./gradlew -Dorg.gradle.parallel=true -Dorg.gradle.caching=true
138+
run: bash testList.txt
140139
- name: Remove downloaded test results
141140
run: rm -rf tmp/junit-xml-reports-downloaded
142141
- name: Upload Unit Test Results

.github/workflows/splitTestsByTime.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,10 @@ do
120120
done
121121

122122
# return the requests index, without quotes to drop the last trailing space
123+
echo "./gradlew"
123124
for module_dir in "${module_list[@]}"
124125
do
125126
module_test_task=":${module_dir//\//:}:test"
126127
module_tests=$( echo "${group_by_module[$module_dir]% }" | sed -e 's/^\| / --tests /g' )
127-
echo "$module_test_task $module_tests"
128+
echo -n " $module_test_task $module_tests"
128129
done

gradle.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ org.gradle.welcome=never
77
# Optional, skip dependency verification for dev/debug builds
88
# org.gradle.dependency.verification=lenient
99

10-
10+
# Enable Parallel Execution by default
11+
org.gradle.parallel=true
1112
# Set exports/opens flags required by Google Java Format and ErrorProne plugins. (JEP-396)
1213
org.gradle.jvmargs=-Xmx4g \
1314
--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \

0 commit comments

Comments
 (0)