Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 66c95594 authored by Ellen Poe's avatar Ellen Poe Committed by GitHub
Browse files

Merge pull request #203 from ellenhp/ellenhp/detekt

Add detekt and refactor failures
parents 48d25972 30a8f164
Loading
Loading
Loading
Loading
+60 −0
Original line number Diff line number Diff line
name: Android CI

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

jobs:
  detekt:
    runs-on: ubuntu-latest
    concurrency:
      group: ${{ github.workflow }}-${{ github.ref }}-android-detekt
      cancel-in-progress: true

    steps:
    - uses: actions/checkout@v4
      with:
        submodules: true
        lfs: true

    - name: Cache Gradle dependencies
      uses: actions/cache@v4
      with:
        path: |
          ~/.gradle/caches
          ~/.gradle/wrapper
          cardinal-android/.gradle
        key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
        restore-keys: |
          ${{ runner.os }}-gradle-

    - name: Configure Gradle for CI
      run: |
        mkdir -p ~/.gradle
        echo "org.gradle.daemon=false" >> ~/.gradle/gradle.properties
        echo "org.gradle.parallel=true" >> ~/.gradle/gradle.properties
        echo "org.gradle.configureondemand=true" >> ~/.gradle/gradle.properties
        echo "org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=1g -XX:+HeapDumpOnOutOfMemoryError" >> ~/.gradle/gradle.properties

    - name: Build with Gradle
      working-directory: cardinal-android
      run: |
        touch local.properties
        ./gradlew detekt
      env:
        ANDROID_HOME: ${{ env.ANDROID_HOME }}
        ANDROID_NDK_HOME: ${{ env.ANDROID_NDK_HOME }}
        ANDROID_NDK_ROOT: ${{ env.ANDROID_NDK_ROOT }}
        NDK_HOME: ${{ env.NDK_HOME }}

    - name: Upload build logs on failure
      if: failure()
      uses: actions/upload-artifact@v4
      with:
        name: build-logs
        path: |
          cardinal-android/app/build/reports/
          ~/.gradle/daemon/*/daemon-*.out.log
        retention-days: 3
+1 −0
Original line number Diff line number Diff line
The following individuals and organizations have contributed code to Cardinal Maps (add your name here if you make a PR!):

Ellen Poe
E Foundation
+7 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ plugins {
    alias(libs.plugins.ksp)
    alias(libs.plugins.hilt)
    alias(libs.plugins.cargo.ndk)
    alias(libs.plugins.detekt)
    kotlin("plugin.serialization") version "2.2.10"
}

@@ -155,6 +156,12 @@ cargoNdk {
    extraCargoBuildArguments = arrayListOf("-p", "cardinal-geocoder")
}

detekt {
    parallel = true
    config.setFrom("detekt.yml")
    allRules = true
}

dependencies {
    implementation(libs.maplibre.compose)
    implementation(libs.maplibre.compose.material3)
+12 −0
Original line number Diff line number Diff line
naming:
  FunctionNaming:
    ignoreAnnotated: [ 'Composable' ]
    excludes: [ '**/cardinal/bottomsheet/**' ]

complexity:
  LongParameterList:
    active: true
    ignoreDefaultParameters: true
  CognitiveComplexMethod:
    active: true
    excludes: [ '**/cardinal/bottomsheet/**' ]
+15 −0
Original line number Diff line number Diff line
  Cardinal Maps
  Copyright (C) $originalComment.match("Copyright \(c\) (\d+)", 1, "-", "$today.year")$today.year Cardinal Maps Authors

  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program.  If not, see <https://www.gnu.org/licenses/>.
 No newline at end of file
Loading