Skip to content

Commit

Permalink
Merge branch 'main' into healthconnectonfhir
Browse files Browse the repository at this point in the history
  • Loading branch information
vishnuravi authored Jun 3, 2024
2 parents d277d90 + a0cb8c6 commit c3f5871
Show file tree
Hide file tree
Showing 106 changed files with 1,343 additions and 289 deletions.
102 changes: 0 additions & 102 deletions .github/workflows/android.yml

This file was deleted.

46 changes: 46 additions & 0 deletions .github/workflows/build-test-analyze.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build, Test and Analyze

on:
workflow_dispatch:
workflow_call:

jobs:
buildtestandanalyze:
name: Build, Test and Analyze
runs-on: ubuntu-latest
timeout-minutes: 120
permissions: # needed for CodeQL steps
security-events: write
packages: read
actions: read
contents: read

steps:
- name: Checkout code
uses: actions/[email protected]
- name: Initialize CodeQL # CodeQL init should happen before project build!
uses: github/codeql-action/init@v3
with:
languages: java-kotlin
build-mode: manual
- name: Set up JDK 17
uses: actions/[email protected]
with:
distribution: 'temurin'
java-version: '17'
cache: gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Build and test
run: ./gradlew build
- name: Perform CodeQL Analysis # CodeQL analysis needs project build!
uses: github/codeql-action/analyze@v3
with:
category: "/language:java-kotlin"
- name: Upload JaCoCo report to Codecov
uses: codecov/codecov-action@v4
with:
files: '**/build/reports/jacoco/jacocoCoverageReport/jacocoCoverageReport.xml'
flags: unittests
name: codecov-coverage
token: ${{ secrets.CODECOV_TOKEN }}
49 changes: 49 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Main

on:
push:
branches: [ "main" ]

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

jobs:
buildtestandanalyze:
uses: ./.github/workflows/build-test-analyze.yml
secrets: inherit

uploadartifacts:
name: Archive production artifacts
runs-on: ubuntu-latest
needs: buildtestandanalyze
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: app
path: app/build/outputs/apk/release/app-release-unsigned.apk

dokka:
runs-on: ubuntu-latest
needs: buildtestandanalyze
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Set up JDK 17
uses: actions/[email protected]
with:
distribution: 'temurin'
java-version: '17'
cache: gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Run Dokka with Gradle
run: ./gradlew dokkaHtmlMultiModule
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: build/dokka/htmlMultiModule
32 changes: 32 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Pull Request

on:
pull_request:
branches: [ "main" ]

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

jobs:
detekt:
name: Detekt review
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/[email protected]
with:
fetch-depth: 1
ref: ${{ github.head_ref }}
- name: Detekt PR Check
uses: alaegin/[email protected]
with:
reviewdog_reporter: github-pr-check
github_token: ${{ secrets.github_token }}
fail_on_error: true
detekt_config: internal/detekt-config.yml

buildtestandanalyze:
uses: ./.github/workflows/build-test-analyze.yml
secrets: inherit

7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[![Android CI](https://github.com/Basler182/Spezi/actions/workflows/android.yml/badge.svg)](https://github.com/StanfordSpezi/SpeziKt/actions/workflows/android.yml)
[![pages-build-deployment](https://github.com/Basler182/SpeziKt/actions/workflows/pages/pages-build-deployment/badge.svg?branch=gh-pages)](https://github.com/Basler182/SpeziKt/actions/workflows/pages/pages-build-deployment)
[![Main](https://github.com/StanfordSpezi/SpeziKt/actions/workflows/main.yml/badge.svg)](https://github.com/StanfordSpezi/SpeziKt/actions/workflows/main.yml)
[![Github Pages](https://github.com/StanfordSpezi/SpeziKt/actions/workflows/pages/pages-build-deployment/badge.svg?branch=gh-pages)](https://github.com/StanfordSpezi/SpeziKt/actions/workflows/pages/pages-build-deployment)
[![Codecov](https://codecov.io/gh/StanfordSpezi/SpeziKt/branch/main/graph/badge.svg)](https://app.codecov.io/gh/StanfordSpezi/SpeziKt)

# Spezi
Kotlin & Android Version of the Stanford Spezi Framework
Expand All @@ -11,4 +12,4 @@ Spezi is a collection of modules that can be used to build Android applications
### Modules

- **Design System**: Provides a cohesive user interface and user experience
components. [Read More](./core/design/README.md)
components. [Read More](./core/design/README.md)
2 changes: 1 addition & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ dependencies {
implementation(libs.hilt.navigation.compose)

implementation(project(":core:bluetooth"))
}
}

This file was deleted.

2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@
</activity>
</application>

</manifest>
</manifest>
4 changes: 2 additions & 2 deletions app/src/main/kotlin/edu/stanford/spezi/app/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ class MainActivity : ComponentActivity() {
super.onCreate(savedInstanceState)
setContent {
SpeziTheme {
BluetoothScreen()
BluetoothScreen()
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ class MainApplication : Application() {

SpeziLogger.setLoggingEnabled(enabled = BuildConfig.DEBUG)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@ class BluetoothViewModel @Inject internal constructor(
object EnableBluetooth : Event
data class RequestPermissions(val permissions: List<String>) : Event
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ class BluetoothUiStateMapper @Inject constructor() {
}

private fun format(value: Number?): String = String.format(Locale.US, "%.2f", value)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ data class DeviceUiModel(
val address: String,
val measurementsCount: Int,
val summary: String,
)
)
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ private fun AdditionalInfo(uiState: BluetoothUiState) {
Text(text = text)
}


@Composable
fun DeviceComposable(device: DeviceUiModel) {
ElevatedCard(modifier = Modifier.fillMaxWidth()) {
Expand Down Expand Up @@ -102,4 +101,4 @@ private fun BluetoothEvents(events: Flow<BluetoothViewModel.Event>) {
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -189,4 +189,4 @@ class BluetoothViewModelTest {
uiStateMapper = uiStateMapper
)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,4 @@ class BluetoothUiStateMapperTest {
const val WEIGHT = 4.56
const val ADDRESS = "some device address"
}
}
}
2 changes: 1 addition & 1 deletion build-logic/convention/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ gradlePlugin {
conventionPlugin(id = "hilt", className = "HiltConventionPlugin")
conventionPlugin(id = "library", className = "SpeziLibraryConventionPlugin")
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ internal fun DependencyHandler.debugImplementation(dependency: Any) {

internal fun DependencyHandler.androidTestImplementation(dependency: Any) {
add("androidTestImplementation", dependency)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ internal fun Project.commonExtensions(configBlock: CommonExtension<*,*,*,*,*,*>.
isLibrary() -> extension<LibraryExtension>(configBlock)
else -> error("commonExtensions was called before setting the module type plugin")
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ enum class PluginId(val id: String) {
HILT(id = "com.google.dagger.hilt.android"),
KSP(id = "com.google.devtools.ksp"),
COMPOSE_COMPILER("org.jetbrains.kotlin.plugin.compose")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ class HiltConventionPlugin : Plugin<Project> {
enableAggregatingTask = true
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ abstract class SpeziAbstractConfigPlugin(private val modulePlugin: PluginId) : P
testImplementation(project(":core:testing"))
}
}
}
}
Loading

0 comments on commit c3f5871

Please sign in to comment.