From 291a569e8bb68d7923fcdabaf271a1ee3fa23b53 Mon Sep 17 00:00:00 2001 From: Vitor Hugo Schwaab Date: Wed, 22 May 2024 12:48:18 +0200 Subject: [PATCH] ci: disable AboutLibraries when running lint checks --- .github/workflows/codestyle.yml | 15 ++++++--------- app/build.gradle.kts | 5 +++++ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/codestyle.yml b/.github/workflows/codestyle.yml index aac1387de4e..c006033be0c 100644 --- a/.github/workflows/codestyle.yml +++ b/.github/workflows/codestyle.yml @@ -9,9 +9,12 @@ jobs: static-code-analysis: runs-on: buildjet-2vcpu-ubuntu-2204 - # Add a bit more Metaspace size as it tends to fail on GH runner when running linter + # Add a bit more Metaspace size as it tends to fail on GH runner when running linter, + # Reduce a bit the memory allocation pool, as the 8GB set in gradle.properties is too much for CI + # AboutLibraries seems to go crazy when running lint checks. So we explicitly don't run it. env: - GRADLE_OPTS: -Dorg.gradle.jvmargs="-XX:MaxMetaspaceSize=1g" + GRADLE_OPTS: '-Dorg.gradle.jvmargs="-XX:MaxMetaspaceSize=1g -Xmx2G"' + DISABLE_ABOUT_LIBRARIES: TRUE steps: - name: Checkout @@ -31,14 +34,8 @@ jobs: run: | ./gradlew detektAll - name: Run Linter - # AboutLibraries seems to output tons of false warnings because of Kalium. - # Run it quietly first to clear up the logs. - # Then: - # For the app we need lintDevDebug. For the other modules we use lintDebug. run: | - ./gradlew collectDependencies -q --no-daemon - ./gradlew lintDebug --no-daemon - ./gradlew lintDevDebug --no-daemon + ./gradlew lint - name: Cleanup Gradle Cache # Remove some files from the Gradle cache, so they aren't cached by GitHub Actions. # Restoring these files from a GitHub Actions cache might cause problems for future builds. diff --git a/app/build.gradle.kts b/app/build.gradle.kts index e3f131194d9..0514dcb80a2 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -84,6 +84,11 @@ android { } } +aboutLibraries { + val isAboutLibrariesDisabled = System.getenv("DISABLE_ABOUT_LIBRARIES")?.equals("true", true) ?: false + registerAndroidTasks = !isAboutLibrariesDisabled +} + dependencies { implementation("com.wire.kalium:kalium-logic") implementation("com.wire.kalium:kalium-util")