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
20 changes: 20 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4

[*.{kt,kts}]
max_line_length = 120
ij_kotlin_allow_trailing_comma = true
ij_kotlin_allow_trailing_comma_on_call_site = true
ktlint_code_style = ktlint_official
ktlint_standard_filename = disabled
ktlint_standard_function-naming = disabled
ktlint_function_naming_ignore_when_annotated_with = Composable

[*.{yml,yaml,json,toml}]
indent_size = 2
40 changes: 10 additions & 30 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,13 @@
## Status
READY/IN DEVELOPMENT/HOLD
## Summary
<!-- BLUF: what changes and why, in one or two sentences. -->

## Migrations
YES | NO
## Changes
- `<file_path>`: <details>

## Description
A few sentences describing the overall goals of the pull request's commits.
## Tests
- Unit tests: <executed / failed>, coverage <percent>
- ktlint / detekt / Android lint: clean
- apiCheck: <passes | library.api regenerated>
- Example app build: <passes | not applicable — no public API change>

## Related PRs
List related PRs against other branches:

branch PR
other_pr_production link
other_pr_master link
Todos
Tests
Documentation

## Deploy Notes
Notes regarding deployment the contained body of work. These should note any db migrations, etc.

## Steps to Test or Reproduce
Outline the steps to test or reproduce the PR here.

git pull --prune
git checkout <feature_branch>

## Impacted Areas in Application
Small description about what will be changed in the app if this PR will be merged

## List general components of the application that this PR will affect:
The direct changes inside the app made by this PR
Refs: #<issue>
81 changes: 81 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: CI

on:
pull_request:
branches: [ master ]
push:
branches: [ master ]

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

permissions:
contents: read

jobs:
release-guard:
name: Version / Changelog
runs-on: ubuntu-26.04
steps:
- uses: actions/checkout@v7
- name: Top CHANGELOG.md entry matches the release manifest
run: |
version=$(jq -r '."."' .release-please-manifest.json)
header=$(grep -m1 '^## ' CHANGELOG.md)
echo "manifest: $version, changelog: $header"
[[ "$header" =~ ^"## [$version] - "[0-9]{2}\.[0-9]{2}\.[0-9]{4}\.$ ]] || {
echo "::error file=CHANGELOG.md,line=1::Expected '## [$version] - dd.MM.yyyy.', got '$header'"
exit 1
}

build:
name: Lint, test, API check, build
runs-on: ubuntu-26.04
steps:
- uses: actions/checkout@v7
- uses: actions/setup-java@v6
with:
distribution: corretto
java-version: 17
- uses: gradle/actions/setup-gradle@v6
# Samsung's license forbids redistributing the SDK, so the real AAR lives in the private repository
# kvs-coder/samsung-health-sdk, read with a read-only deploy key. Without the key (fork PRs), the build uses
# the samsung-health-data-stub module written from the SDK's API reference.
- name: Provide the Samsung Health Data SDK
env:
SAMSUNG_HEALTH_SDK_DEPLOY_KEY: ${{ secrets.SAMSUNG_HEALTH_SDK_DEPLOY_KEY }}
run: |
if [ -z "$SAMSUNG_HEALTH_SDK_DEPLOY_KEY" ]; then
echo "::warning::SAMSUNG_HEALTH_SDK_DEPLOY_KEY is not set; building against the SDK stub"
exit 0
fi
key="$RUNNER_TEMP/samsung-health-sdk-key"
printf '%s\n' "$SAMSUNG_HEALTH_SDK_DEPLOY_KEY" > "$key"
chmod 600 "$key"
GIT_SSH_COMMAND="ssh -i $key -o IdentitiesOnly=yes -o StrictHostKeyChecking=accept-new" \
git clone --depth 1 git@github.com:kvs-coder/samsung-health-sdk.git "$RUNNER_TEMP/samsung-health-sdk"
rm -f "$key"
mkdir -p library/libs
cp "$RUNNER_TEMP"/samsung-health-sdk/samsung-health-data-api-*.aar library/libs/
ls library/libs
- name: Lint
run: ./gradlew ktlintCheck detekt :library:lintDebug
- name: Test with coverage gate
run: ./gradlew :library:testDebugUnitTest :library:koverXmlReport :library:koverVerify
- name: Test against the SDK stub too, so it keeps matching the real SDK
if: hashFiles('library/libs/*.aar') != ''
run: ./gradlew :library:testDebugUnitTest -PsamsungHealthDataStub
- name: Public API check
run: ./gradlew :library:apiCheck
- name: Build library and example app
run: ./gradlew :library:assembleRelease :app:assembleDebug
- name: Upload reports
if: always()
uses: actions/upload-artifact@v7
with:
name: reports
path: |
library/build/reports
library/build/test-results
if-no-files-found: ignore
18 changes: 18 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Release

on:
push:
branches: [ master ]

permissions:
contents: write
pull-requests: write

jobs:
release-please:
runs-on: ubuntu-26.04
steps:
- uses: googleapis/release-please-action@v5
with:
config-file: release-please-config.json
manifest-file: .release-please-manifest.json
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,12 @@ lint/tmp/
# Android Profiling
*.hprof
.idea/jarRepositories.xml

# Samsung Health Data SDK: license forbids redistribution, add it locally (see README)
library/libs/*.aar

# IDE state
.idea/

# Local task notes, not for the repository
ISSUE-*.md
129 changes: 0 additions & 129 deletions .idea/codeStyles/Project.xml

This file was deleted.

5 changes: 0 additions & 5 deletions .idea/codeStyles/codeStyleConfig.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/compiler.xml

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/dictionaries/florian.xml

This file was deleted.

24 changes: 0 additions & 24 deletions .idea/gradle.xml

This file was deleted.

9 changes: 0 additions & 9 deletions .idea/misc.xml

This file was deleted.

12 changes: 0 additions & 12 deletions .idea/runConfigurations.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

1 change: 1 addition & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ ".": "0.0.6" }
Loading