Skip to content

Commit 03cd979

Browse files
authored
options moved from gradle.properties to gradle cmd in CI #1470 (#1472)
1 parent 22badb4 commit 03cd979

7 files changed

+45
-37
lines changed

.github/workflows/build-and-run-tests-from-branch.yml

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,23 @@ env:
1919
IMAGE_NAME: utbot_java_cli
2020
DOCKERFILE_PATH: docker/Dockerfile_java_cli
2121
# Environment variable setting gradle options.
22-
GRADLE_OPTS: "-XX:MaxHeapSize=2048m -Dorg.gradle.jvmargs='-XX:MaxHeapSize=2048m -XX:MaxPermSize=512m -Dorg.gradle.daemon=false' -Dorg.gradle.daemon=false"
22+
#
23+
# When configuring Gradle behavior you can use these methods,
24+
# listed in order of highest to lowest precedence (first one wins):
25+
# - Command-line flags such as --build-cache.
26+
# These have precedence over properties and environment variables.
27+
# - System properties such as systemProp.http.proxyHost=somehost.org
28+
# stored in a gradle.properties file in a root project directory.
29+
# - Gradle properties such as org.gradle.caching=true that are
30+
# typically stored in a gradle.properties file in a project
31+
# directory or in the GRADLE_USER_HOME.
32+
# - Environment variables such as GRADLE_OPTS sourced by the
33+
# environment that executes Gradle.
34+
#
35+
# read more at: https://docs.gradle.org/current/userguide/build_environment.html
36+
#
37+
# example of GRADLE_OPTS:
38+
# GRADLE_OPTS: "-XX:MaxHeapSize=2048m -Dorg.gradle.daemon=false -Dorg.gradle.parallel=false -Dkotlin.compiler.execution.strategy=in-process"
2339
PUSHGATEWAY_HOSTNAME: monitoring.utbot.org
2440
ELK_HOSTNAME: logs.utbot.org
2541
FILEBEAT_DIR: /tmp/filebeat
@@ -115,7 +131,7 @@ jobs:
115131
restore-keys: ${{ runner.os }}-gradle-framework
116132
- name: Run tests
117133
run: |
118-
gradle --build-cache --no-daemon :utbot-framework-test:test ${{ matrix.project.TESTS_TO_RUN }}
134+
gradle --no-daemon --build-cache --no-parallel -Dorg.gradle.jvmargs=-Xmx6g -Dkotlin.daemon.jvm.options=-Xmx4g :utbot-framework-test:test ${{ matrix.project.TESTS_TO_RUN }}
119135
120136
- name: Upload logs
121137
if: ${{ always() }}
@@ -191,13 +207,13 @@ jobs:
191207
id: first-project
192208
run: |
193209
cd ${{ matrix.projects.first }}
194-
gradle build --build-cache --no-daemon
210+
gradle build --no-daemon --build-cache --no-parallel -Dorg.gradle.jvmargs=-Xmx6g -Dkotlin.daemon.jvm.options=-Xmx4g
195211
196212
- name: Build project ${{ matrix.projects.second }}
197213
if: ${{ steps.first-project.outcome != 'cancelled' && steps.first-project.outcome != 'skipped' }}
198214
run: |
199215
cd ${{ matrix.projects.second }}
200-
gradle build --build-cache --no-daemon
216+
gradle build --no-daemon --build-cache --no-parallel -Dorg.gradle.jvmargs=-Xmx6g -Dkotlin.daemon.jvm.options=-Xmx4g
201217
202218
- name: Upload test report if tests have failed
203219
if: ${{ failure() }}
@@ -266,7 +282,7 @@ jobs:
266282
- name: Run tests
267283
run: |
268284
cd ${{ matrix.project }}
269-
gradle build --build-cache --no-daemon
285+
gradle build --no-daemon --build-cache --no-parallel -Dorg.gradle.jvmargs=-Xmx6g -Dkotlin.daemon.jvm.options=-Xmx4g
270286
271287
- name: Upload test report if tests have failed
272288
if: ${{ failure() }}

.github/workflows/build-and-run-tests.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ env:
1414
REGISTRY: ghcr.io
1515
IMAGE_NAME: utbot_java_cli
1616
DOCKERFILE_PATH: docker/Dockerfile_java_cli
17-
# Environment variable setting gradle options.
18-
GRADLE_OPTS: "-XX:MaxHeapSize=2048m -Dorg.gradle.jvmargs='-XX:MaxHeapSize=2048m -XX:MaxPermSize=512m -Dorg.gradle.daemon=false' -Dorg.gradle.daemon=false"
1917

2018
jobs:
2119
build-and-run-tests:
@@ -43,7 +41,7 @@ jobs:
4341
- name: Build UTBot Java CLI
4442
run: |
4543
cd utbot-cli
46-
gradle build --no-daemon -x test -PsemVer=${{ env.VERSION }}
44+
gradle build --no-daemon --build-cache --no-parallel -Dorg.gradle.jvmargs=-Xmx2g -Dkotlin.daemon.jvm.options=-Xmx4g -x test -PsemVer=${{ env.VERSION }}
4745
- name: Set docker tag
4846
run:
4947
# "You can make an environment variable available to any subsequent steps in a workflow job by

.github/workflows/public-rider-plugin.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@ on:
3131
- alpha
3232
- beta
3333

34-
env:
35-
# Environment variable setting gradle options.
36-
GRADLE_OPTS: "-XX:MaxHeapSize=2048m -Dorg.gradle.jvmargs='-XX:MaxHeapSize=2048m -XX:MaxPermSize=512m -Dorg.gradle.daemon=false' -Dorg.gradle.daemon=false"
37-
3834
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
3935
jobs:
4036
# This workflow contains a single job called "greet"
@@ -75,7 +71,7 @@ jobs:
7571

7672
- name: Build UTBot Rider plugin
7773
run: |
78-
gradle clean :utbot-rider:buildPlugin --no-daemon -PsemVer=${{ env.VERSION }} -PincludeRiderInBuild=true
74+
gradle clean :utbot-rider:buildPlugin --no-daemon --build-cache --no-parallel -Dorg.gradle.jvmargs=-Xmx2g -Dkotlin.daemon.jvm.options=-Xmx4g -PsemVer=${{ env.VERSION }} -PincludeRiderInBuild=true
7975
cd utbot-rider/build/distributions
8076
unzip utbot-rider-${{ env.VERSION }}.zip
8177
rm utbot-rider-${{ env.VERSION }}.zip

.github/workflows/publish-on-github-packages.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ on:
77
type: string
88
required: true
99
description: "commit SHA: e.g. cab4799c"
10-
11-
env:
12-
# Environment variable setting gradle options.
13-
GRADLE_OPTS: "-XX:MaxHeapSize=2048m -Dorg.gradle.jvmargs='-XX:MaxHeapSize=2048m -XX:MaxPermSize=512m -Dorg.gradle.daemon=false' -Dorg.gradle.daemon=false"
1410

1511
jobs:
1612
build-and-run-tests:

.github/workflows/publish-plugin-and-cli-from-branch.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@ on:
4040
- alpha
4141
- beta
4242

43-
env:
44-
# Environment variable setting gradle options.
45-
GRADLE_OPTS: "-XX:MaxHeapSize=2048m -Dorg.gradle.jvmargs='-XX:MaxHeapSize=2048m -XX:MaxPermSize=512m -Dorg.gradle.daemon=false' -Dorg.gradle.daemon=false"
46-
4743
jobs:
4844
publish_plugin_and_cli:
4945
runs-on: ubuntu-20.04
@@ -79,7 +75,7 @@ jobs:
7975

8076
- name: Build UTBot IntelliJ IDEA plugin
8177
run: |
82-
gradle clean buildPlugin --no-daemon -PsemVer=${{ env.VERSION }}
78+
gradle clean buildPlugin --no-daemon --build-cache --no-parallel -Dorg.gradle.jvmargs=-Xmx2g -Dkotlin.daemon.jvm.options=-Xmx4g -PsemVer=${{ env.VERSION }}
8379
cd utbot-intellij/build/distributions
8480
unzip utbot-intellij-${{ env.VERSION }}.zip
8581
rm utbot-intellij-${{ env.VERSION }}.zip
@@ -93,7 +89,7 @@ jobs:
9389
- name: Build UTBot CLI
9490
run: |
9591
cd utbot-cli
96-
gradle clean build --no-daemon -PsemVer=${{ env.VERSION }}
92+
gradle clean build --no-daemon --build-cache --no-parallel -Dorg.gradle.jvmargs=-Xmx2g -Dkotlin.daemon.jvm.options=-Xmx4g -PsemVer=${{ env.VERSION }}
9793
9894
- name: Archive UTBot CLI
9995
uses: actions/upload-artifact@v3

.github/workflows/run-chosen-tests-from-branch.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ on:
2828
description: "{package-name}.{class-name-optional}.{test-name-optional}"
2929

3030
env:
31-
# Environment variable setting gradle options.
32-
GRADLE_OPTS: "-XX:MaxHeapSize=2048m -Dorg.gradle.jvmargs='-XX:MaxHeapSize=2048m -XX:MaxPermSize=512m -Dorg.gradle.daemon=false' -Dorg.gradle.daemon=false"
3331
PUSHGATEWAY_HOSTNAME: monitoring.utbot.org
3432

3533
jobs:
@@ -51,7 +49,7 @@ jobs:
5149
5250
- name: Run chosen tests
5351
run: |
54-
gradle :${{ github.event.inputs.project-name }}:test --no-daemon --tests ${{ github.event.inputs.tests-bunch-name }}
52+
gradle :${{ github.event.inputs.project-name }}:test --no-daemon --build-cache --no-parallel -Dorg.gradle.jvmargs=-Xmx2g -Dkotlin.daemon.jvm.options=-Xmx4g --tests ${{ github.event.inputs.tests-bunch-name }}
5553
5654
- name: Upload ${{ github.event.inputs.project-name }} tests report if tests have failed
5755
if: ${{ failure() }}

gradle.properties

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -75,16 +75,24 @@ openblasVersion=0.3.10-1.5.4
7575
arpackNgVersion=3.7.0-1.5.4
7676

7777
# configuration for build server
78-
org.gradle.daemon=false
79-
org.gradle.parallel=false
80-
org.gradle.jvmargs="-XX:MaxHeapSize=6144m"
81-
kotlin.compiler.execution.strategy=in-process
82-
org.gradle.caching=false
78+
#
79+
# the following options are passed to gradle command explicitly (see appropriate workflow):
80+
# --build-cache (the same as org.gradle.caching=true)
81+
# --no-daemon (the same as org.gradle.daemon=false)
82+
#
83+
# read about options precedence at: https://docs.gradle.org/current/userguide/build_environment.html
84+
org.gradle.jvmargs="-Xmx6g"
8385

8486
# configuration for local compilation - much faster
85-
#org.gradle.daemon=true
86-
#kotlin.daemon.jvm.options=-Xmx4g
87-
#org.gradle.parallel=true
88-
#org.gradle.caching=true
89-
#org.gradle.workers.max=8
90-
#org.gradle.jvmargs="-XX:MaxHeapSize=6144m"
87+
# overriden by some parameters in CI, read below about each option
88+
#
89+
# overrided by --no-daemon
90+
org.gradle.daemon=true
91+
# overrided by -Dkotlin.daemon.jvm.options=-Xmx4g
92+
kotlin.daemon.jvm.options=-Xmx4g
93+
# overrided by --no-parallel
94+
org.gradle.parallel=true
95+
# not overrided, we use cache in CI as well
96+
org.gradle.caching=true
97+
# there is no need to override the option below because parallel execution is disabled by --no-parallel
98+
org.gradle.workers.max=8

0 commit comments

Comments
 (0)