diff --git a/.github/workflows/codestyle.yml b/.github/workflows/codestyle.yml index 41c9433dab6..a6c9399fa41 100644 --- a/.github/workflows/codestyle.yml +++ b/.github/workflows/codestyle.yml @@ -1,4 +1,4 @@ -name: "Check Codestyle" +name: "Code Analysis" on: [workflow_call] @@ -6,16 +6,41 @@ permissions: contents: read jobs: - static-code-analysis: + 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 @@ -33,9 +58,6 @@ jobs: - name: Run Detekt run: | ./gradlew detektAll - - 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.