Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .github/workflows/detekt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
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 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
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 changes: 7 additions & 0 deletions cardinal-android/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

Expand Down Expand Up @@ -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)
Expand Down
12 changes: 12 additions & 0 deletions cardinal-android/app/detekt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
naming:
FunctionNaming:
ignoreAnnotated: [ 'Composable' ]
excludes: [ '**/cardinal/bottomsheet/**' ]

complexity:
LongParameterList:
active: true
ignoreDefaultParameters: true
CognitiveComplexMethod:
active: true
excludes: [ '**/cardinal/bottomsheet/**' ]
15 changes: 15 additions & 0 deletions cardinal-android/app/license.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
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/>.
Loading
Loading