From ee553d66933de1ec9c0c13d1a7552cc33b7cd9f3 Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Wed, 3 Aug 2022 10:23:49 +0100 Subject: [PATCH] making use of gradle_opts environment var to attempt to limit the jvm environment and fix gradle crashing --- .github/workflows/build.yml | 10 ++++------ .github/workflows/nightly.yml | 6 ++---- .github/workflows/post-pr.yml | 6 ++---- .github/workflows/quality.yml | 10 ++++------ .github/workflows/tests.yml | 12 +++++------- 5 files changed, 17 insertions(+), 27 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1c0491fda4..a48af91fba 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,10 +7,8 @@ on: # Enrich gradle.properties for CI/CD env: - CI_GRADLE_ARG_PROPERTIES: > - -Porg.gradle.jvmargs=-Xmx4g - -Porg.gradle.parallel=false - --no-daemon + GRADLE_OPTS: -Dorg.gradle.jvmargs="-Xmx2560m -Dfile.encoding=UTF-8 -XX:+HeapDumpOnOutOfMemoryError" -Dkotlin.daemon.jvm.options="-Xmx2560m" -Dkotlin.incremental=false + CI_GRADLE_ARG_PROPERTIES: --stacktrace -PpreDexEnable=false --max-workers 4 --no-daemon jobs: debug: @@ -36,7 +34,7 @@ jobs: restore-keys: | ${{ runner.os }}-gradle- - name: Assemble ${{ matrix.target }} debug apk - run: ./gradlew assemble${{ matrix.target }}Debug $CI_GRADLE_ARG_PROPERTIES --stacktrace + run: ./gradlew assemble${{ matrix.target }}Debug $CI_GRADLE_ARG_PROPERTIES - name: Upload ${{ matrix.target }} debug APKs uses: actions/upload-artifact@v3 with: @@ -61,7 +59,7 @@ jobs: restore-keys: | ${{ runner.os }}-gradle- - name: Assemble GPlay unsigned apk - run: ./gradlew clean assembleGplayRelease $CI_GRADLE_ARG_PROPERTIES --stacktrace + run: ./gradlew clean assembleGplayRelease $CI_GRADLE_ARG_PROPERTIES - name: Upload Gplay unsigned APKs uses: actions/upload-artifact@v3 with: diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 36fd225674..6f2d55d318 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -6,10 +6,8 @@ on: - cron: "0 4 * * *" env: - CI_GRADLE_ARG_PROPERTIES: > - -Porg.gradle.jvmargs=-Xmx4g - -Porg.gradle.parallel=false - --no-daemon + GRADLE_OPTS: -Dorg.gradle.jvmargs="-Xmx2560m -Dfile.encoding=UTF-8 -XX:+HeapDumpOnOutOfMemoryError" -Dkotlin.daemon.jvm.options="-Xmx2560m" -Dkotlin.incremental=false + CI_GRADLE_ARG_PROPERTIES: --stacktrace -PpreDexEnable=false --max-workers 4 -Porg.gradle.parallel=false --no-daemon jobs: nightly: diff --git a/.github/workflows/post-pr.yml b/.github/workflows/post-pr.yml index a7f1d6f204..e7eb7dce99 100644 --- a/.github/workflows/post-pr.yml +++ b/.github/workflows/post-pr.yml @@ -10,10 +10,8 @@ on: # Enrich gradle.properties for CI/CD env: - CI_GRADLE_ARG_PROPERTIES: > - -Porg.gradle.jvmargs=-Xmx4g - -Porg.gradle.parallel=false - --no-daemon + GRADLE_OPTS: -Dorg.gradle.jvmargs="-Xmx2560m -Dfile.encoding=UTF-8 -XX:+HeapDumpOnOutOfMemoryError" -Dkotlin.daemon.jvm.options="-Xmx2560m" -Dkotlin.incremental=false + CI_GRADLE_ARG_PROPERTIES: --stacktrace -PpreDexEnable=false --max-workers 4 -Porg.gradle.parallel=false --no-daemon jobs: diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml index 56a7c8b97b..9f39e6895d 100644 --- a/.github/workflows/quality.yml +++ b/.github/workflows/quality.yml @@ -7,10 +7,8 @@ on: # Enrich gradle.properties for CI/CD env: - CI_GRADLE_ARG_PROPERTIES: > - -Porg.gradle.jvmargs=-Xmx4g - -Porg.gradle.parallel=false - --no-daemon + GRADLE_OPTS: -Dorg.gradle.jvmargs="-Xmx2560m -Dfile.encoding=UTF-8 -XX:+HeapDumpOnOutOfMemoryError" -Dkotlin.daemon.jvm.options="-Xmx2560m" -Dkotlin.incremental=false + CI_GRADLE_ARG_PROPERTIES: --stacktrace -PpreDexEnable=false --max-workers 4 -Porg.gradle.parallel=false --no-daemon jobs: check: @@ -51,8 +49,8 @@ jobs: - name: Run lint # Not always, if ktlint or detekt fail, avoid running the long lint check. run: | - ./gradlew lintGplayRelease --stacktrace $CI_GRADLE_ARG_PROPERTIES - ./gradlew lintFdroidRelease --stacktrace $CI_GRADLE_ARG_PROPERTIES + ./gradlew lintGplayRelease $CI_GRADLE_ARG_PROPERTIES + ./gradlew lintFdroidRelease $CI_GRADLE_ARG_PROPERTIES - name: Upload reports if: always() uses: actions/upload-artifact@v3 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2b9aa1a851..11048503d5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -7,10 +7,8 @@ on: # Enrich gradle.properties for CI/CD env: - CI_GRADLE_ARG_PROPERTIES: > - -Porg.gradle.jvmargs=-Xmx4g - -Porg.gradle.parallel=false - --no-daemon + GRADLE_OPTS: -Dorg.gradle.jvmargs="-Xmx2560m -Dfile.encoding=UTF-8 -XX:+HeapDumpOnOutOfMemoryError" -Dkotlin.daemon.jvm.options="-Xmx2560m" -Dkotlin.incremental=false + CI_GRADLE_ARG_PROPERTIES: --stacktrace -PpreDexEnable=false --max-workers 4 -Porg.gradle.parallel=false --no-daemon jobs: tests: @@ -67,9 +65,9 @@ jobs: disable-animations: true emulator-build: 7425822 script: | - ./gradlew unitTestsWithCoverage --stacktrace $CI_GRADLE_ARG_PROPERTIES - ./gradlew instrumentationTestsWithCoverage --stacktrace $CI_GRADLE_ARG_PROPERTIES - ./gradlew generateCoverageReport --stacktrace $CI_GRADLE_ARG_PROPERTIES + ./gradlew unitTestsWithCoverage $CI_GRADLE_ARG_PROPERTIES + ./gradlew instrumentationTestsWithCoverage $CI_GRADLE_ARG_PROPERTIES + ./gradlew generateCoverageReport $CI_GRADLE_ARG_PROPERTIES - run: ./gradlew sonarqube $CI_GRADLE_ARG_PROPERTIES if: always() # we may have failed a previous step and retried, that's OK env: