Skip to content

Commit

Permalink
MM-102 KMP dependencies setup (#2729)
Browse files Browse the repository at this point in the history
  • Loading branch information
itsPronay authored Jan 8, 2025
1 parent fefc6ec commit 00214ac
Show file tree
Hide file tree
Showing 45 changed files with 1,620 additions and 360 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/master_dev_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: Workflow for master/development branches

on:
pull_request:
branches:
- 'development'
- 'master'
push:
branches:
- 'development'
Expand Down
105 changes: 105 additions & 0 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: Workflow for master/development branches

on:
pull_request:
branches:
- 'kmp-impl'
push:
branches:
- 'kmp-impl'

concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read
pull-requests: write

jobs:
setup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17
- uses: gradle/actions/setup-gradle@v4

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

checks:
needs: setup
runs-on: ubuntu-latest
strategy:
matrix:
check: [ build_logic, spotless, detekt ]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17
- name: Run ${{ matrix.check }}
id: run_check
run: |
if [ "${{ matrix.check }}" = "build_logic" ]; then
./gradlew check -p build-logic
elif [ "${{ matrix.check }}" = "spotless" ]; then
./gradlew spotlessCheck --no-configuration-cache --no-daemon
elif [ "${{ matrix.check }}" = "detekt" ]; then
./gradlew detekt
fi
- name: Upload Detekt Reports
if: ${{ matrix.check == 'detekt' && steps.run_check.outcome == 'success' }}
uses: actions/upload-artifact@v4
with:
name: detekt-reports
path: |
**/build/reports/detekt/detekt.md
dependency_guard:
needs: setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17

- name: Check Dependency Guard
id: dependencyguard_verify
continue-on-error: true
run: ./gradlew dependencyGuard

- name: Prevent updating Dependency Guard baselines if this is a fork
id: checkfork_dependencyguard
if: steps.dependencyguard_verify.outcome == 'failure' && github.event.pull_request.head.repo.full_name != github.repository
run: |
echo "::error::Dependency Guard failed, please update baselines with: ./gradlew dependencyGuardBaseline" && exit 1
# Runs if previous job failed
- name: Generate new Dependency Guard baselines if verification failed and it's a PR
id: dependencyguard_baseline
if: steps.dependencyguard_verify.outcome == 'failure' && github.event_name == 'pull_request'
run: |
./gradlew dependencyGuardBaseline
- name: Push new Dependency Guard baselines if available
uses: stefanzweifel/git-auto-commit-action@v5
if: steps.dependencyguard_baseline.outcome == 'success'
with:
file_pattern: '**/dependencies/*.txt'
disable_globbing: true
commit_message: "🤖 Updates baselines for Dependency Guard"
17 changes: 11 additions & 6 deletions androidApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
*
* See https://github.com/openMF/mobile-mobile/blob/master/LICENSE.md
*/
import org.mifos.mobile.MifosBuildType
import org.mifos.mobile.dynamicVersion

plugins {
alias(libs.plugins.mifos.android.application)
alias(libs.plugins.mifos.android.application.compose)
alias(libs.plugins.mifos.android.application.flavors)
alias(libs.plugins.mifos.android.hilt)
alias(libs.plugins.mifos.android.application.firebase)
id("com.google.android.gms.oss-licenses-plugin")
alias(libs.plugins.roborazzi)
}

android {
Expand Down Expand Up @@ -45,11 +45,16 @@ android {
}

buildTypes {
debug {
applicationIdSuffix = MifosBuildType.DEBUG.applicationIdSuffix
}

release {
isDebuggable = false
isMinifyEnabled = true
isShrinkResources = true
signingConfig = signingConfigs.getByName("release")
applicationIdSuffix = MifosBuildType.RELEASE.applicationIdSuffix
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
}
}
Expand All @@ -61,10 +66,10 @@ android {
}

dependencyGuard {
configuration("releaseRuntimeClasspath"){
modules = true
tree = true
}
configuration("demoDebugRuntimeClasspath")
configuration("demoReleaseRuntimeClasspath")
configuration("prodDebugRuntimeClasspath")
configuration("prodReleaseRuntimeClasspath")
}

dependencies {
Expand Down
Loading

0 comments on commit 00214ac

Please sign in to comment.