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
16 changes: 16 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## What's new 👀

Please include a summary of the changes and the related issue.

## Jira Ticket

https://

## How to test

- Step 1:
- Step 2:

## Proof Of Work 📹

TODO: Screenshots, GIFs, etc.
66 changes: 66 additions & 0 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Android CI

on:
push:
branches:
- develop
pull_request:
branches:
- develop
- 'release/*'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

permissions:
contents: read
pull-requests: write

env:
MIN_COVERAGE_ALL: ${{ vars.MIN_COVERAGE_ALL || 60 }}
MIN_COVERAGE_CHANGED_FILE: ${{ vars.MIN_COVERAGE_CHANGED_FILE || 60 }}

jobs:
android-ci:
name: Lint & Coverage
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: gradle

- name: Make gradlew executable
run: chmod +x gradlew

# Run detekt
- name: Run Lint
run: ./gradlew lint

# Run assembleUat
# - name: Run AssembleUat
# run: ./gradlew assembleDebug
#
# Kover ONLY on PRs
- name: Run Kover Coverage
if: github.event_name == 'pull_request'
run: ./gradlew composeApp:koverXmlReportDebug

# Post Coverage Comment only for PRs
- name: Post Coverage Comment
if: github.event_name == 'pull_request'
uses: mi-kas/kover-report@v1
with:
path: composeApp/build/reports/kover/reportDebug.xml
token: ${{ secrets.GITHUB_TOKEN }}
title: Code Coverage
update-comment: true
min-coverage-overall: ${{ env.MIN_COVERAGE_ALL }}
min-coverage-changed-files: ${{ env.MIN_COVERAGE_CHANGED_FILE }}
coverage-counter-type: LINE
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ fun Project.configureIosFramework(
val kmp = extensions.getByType<KotlinMultiplatformExtension>()
kmp.apply {
listOf(
iosX64(),
iosArm64(),
iosSimulatorArm64()
).forEach { iosTarget ->
Expand Down
42 changes: 41 additions & 1 deletion composeApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ plugins {
alias(libs.plugins.ksp)
alias(libs.plugins.kotlinCocoapods)
alias(libs.plugins.buildkonfig)
alias(libs.plugins.kotlinx.kover)
}

// ----- iOS: read Xcode configuration (Debug/UAT/Staging/Release) -----
Expand Down Expand Up @@ -112,4 +113,43 @@ android {

dependencies {
debugImplementation(compose.uiTooling)
}
}

dependencies {
kover(projects.core.coreKtx)
kover(projects.core.data)
kover(projects.core.designsystem)
kover(projects.gituser)
}

kover {
reports {
filters {
includes {
classes("*ViewModel")
classes("*UseCase")
classes("*UseCase")
classes("*Mapper")
classes("*MapperImpl")
classes("*Mapping")
classes("*Repository")
classes("*RepositoryImpl")
classes("*Util")
classes("*Helper")
classes("*HelperImpl")
classes("*Formatter")
classes("*FormatterImpl")
classes("*Converter")
classes("*ConverterImpl")
classes("*UiState")
classes("*Event")
classes("*Builder")
classes("*Controller")
classes("*Data")
classes("*Analytic")
classes("*Analytics")
classes("*AnalyticManager")
}
}
}
}
1 change: 1 addition & 0 deletions core/core-ktx/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ plugins {
alias(libs.plugins.nowinandroid.kmp.library)
alias(libs.plugins.nowinandroid.kmp.library.compose)
alias(libs.plugins.kotlinSerialization)
alias(libs.plugins.kotlinx.kover)
}

kotlin {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ package leegroup.module.core.util

import kotlinx.serialization.SerializationException
import kotlinx.serialization.json.Json
import kotlinx.serialization.json.JsonPrimitive
import kotlinx.serialization.json.buildJsonObject
import kotlinx.serialization.json.decodeFromJsonElement
import kotlinx.serialization.json.encodeToJsonElement
import kotlinx.serialization.json.jsonObject
import kotlinx.serialization.json.jsonPrimitive
Expand Down Expand Up @@ -34,4 +37,19 @@ object JsonUtil {
val jsonObject = json.encodeToJsonElement(value).jsonObject
return jsonObject.mapValues { it.value.jsonPrimitive.content }
}

inline fun <reified T> decodeFromMap(value: Map<String, Any>): T? {
return try {
val jsonObject = buildJsonObject {
value.forEach { (key, v) ->
put(key, JsonPrimitive(v.toString()))
}
}
json.decodeFromJsonElement<T>(jsonObject)
} catch (ex: SerializationException) {
null
} catch (ex: IllegalArgumentException) {
null
}
}
}
Loading