Skip to content

Commit

Permalink
ci: disable AboutLibraries when running lint checks
Browse files Browse the repository at this point in the history
  • Loading branch information
vitorhugods committed May 22, 2024
1 parent e18ac47 commit 7b9d2be
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
15 changes: 6 additions & 9 deletions .github/workflows/codestyle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down
5 changes: 5 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 7b9d2be

Please sign in to comment.