From 5c24e080590b5bdaec0eecb8c461ed88d39b97dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolf-Martell=20Montw=C3=A9?= Date: Mon, 18 Sep 2023 16:25:22 +0200 Subject: [PATCH 1/3] Split workflow run into multiple steps --- .github/workflows/android.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index d3e2769cd2a..d5ad12ac691 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -28,4 +28,11 @@ jobs: distribution: temurin java-version: 17 - uses: gradle/gradle-build-action@v2 - - run: ./gradlew assembleDebug detekt spotlessCheck testsOnCi + - name: Build + run: ./gradlew assembleDebug + - name: Detekt + run: ./gradlew detekt + - name: Spotless + run: ./gradlew spotlessCheck + - name: Tests + run: ./gradlew testsOnCi From 713ff9ea3bb62cd97f8508dd7097e241d9abf875 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolf-Martell=20Montw=C3=A9?= Date: Mon, 18 Sep 2023 15:49:14 +0200 Subject: [PATCH 2/3] Fix memory issues, taken from NowInAndroid example App --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index d90d2679b5a..555e9e3b429 100644 --- a/gradle.properties +++ b/gradle.properties @@ -12,7 +12,7 @@ android.defaults.buildfeatures.shaders=false # Gradle ## Ensure important default jvmargs aren't overwritten. See https://github.com/gradle/gradle/issues/19750 -org.gradle.jvmargs=-Xmx4G -Xms1G -XX:MaxMetaspaceSize=1536M -Dfile.encoding=UTF-8 -XX:+UseParallelGC -XX:+HeapDumpOnOutOfMemoryError +org.gradle.jvmargs=-Xmx6g -XX:MaxMetaspaceSize=1g -Dfile.encoding=UTF-8 -XX:+UseParallelGC -XX:+HeapDumpOnOutOfMemoryError org.gradle.parallel=true From d142bbef9619fb3b0ef91e148d977805683b141c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolf-Martell=20Montw=C3=A9?= Date: Mon, 18 Sep 2023 17:13:58 +0200 Subject: [PATCH 3/3] Add ci gradle.properties and move quality checks to the start --- .github/ci-gradle.properties | 6 ++++++ .github/workflows/android.yml | 21 ++++++++++++++++----- 2 files changed, 22 insertions(+), 5 deletions(-) create mode 100644 .github/ci-gradle.properties diff --git a/.github/ci-gradle.properties b/.github/ci-gradle.properties new file mode 100644 index 00000000000..7de8afc3ae2 --- /dev/null +++ b/.github/ci-gradle.properties @@ -0,0 +1,6 @@ +org.gradle.daemon=false +org.gradle.parallel=true +org.gradle.workers.max=2 + +kotlin.incremental=false +kotlin.compiler.execution.strategy=in-process diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index d5ad12ac691..8ace88da189 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -21,18 +21,29 @@ jobs: build: runs-on: ubuntu-latest + timeout-minutes: 90 + steps: - uses: actions/checkout@v4 + + - name: Copy CI gradle.properties + run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties + - uses: actions/setup-java@v3 with: distribution: temurin java-version: 17 + - uses: gradle/gradle-build-action@v2 + + - name: Quality - Spotless + run: ./gradlew spotlessCheck + + - name: Quality - Detekt + run: ./gradlew detekt + - name: Build run: ./gradlew assembleDebug - - name: Detekt - run: ./gradlew detekt - - name: Spotless - run: ./gradlew spotlessCheck - - name: Tests + + - name: Test run: ./gradlew testsOnCi