-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci): add android and compose lint [WPB-9287] (#3021)
- Loading branch information
1 parent
8f8b582
commit 25f8a2f
Showing
11 changed files
with
8,635 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: "Code Analysis" | ||
|
||
on: [workflow_call] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
lint: | ||
runs-on: buildjet-4vcpu-ubuntu-2204 | ||
# 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 -Xmx2G"' | ||
DISABLE_ABOUT_LIBRARIES: TRUE | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive # Needed in order to fetch Kalium sources for building | ||
fetch-depth: 0 | ||
- name: Set up JDK 17 | ||
uses: buildjet/setup-java@v4 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
cache: gradle | ||
- name: Validate Gradle wrapper | ||
uses: gradle/wrapper-validation-action@5188e9b5527a0a094cee21e2fe9a8ca44b4629af | ||
|
||
- name: Run Linter | ||
run: | | ||
./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. | ||
run: | | ||
rm -f ~/.gradle/caches/modules-2/modules-2.lock | ||
rm -f ~/.gradle/caches/modules-2/gc.properties | ||
style: | ||
runs-on: buildjet-2vcpu-ubuntu-2204 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive # Needed in order to fetch Kalium sources for building | ||
fetch-depth: 0 | ||
- name: Set up JDK 17 | ||
uses: buildjet/setup-java@v4 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
cache: gradle | ||
- name: Validate Gradle wrapper | ||
uses: gradle/wrapper-validation-action@216d1ad2b3710bf005dc39237337b9673fd8fcd5 | ||
- name: Run Detekt | ||
run: | | ||
./gradlew detektAll | ||
- 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. | ||
run: | | ||
rm -f ~/.gradle/caches/modules-2/modules-2.lock | ||
rm -f ~/.gradle/caches/modules-2/gc.properties |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.