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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
21 changes: 21 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#
# This source file is part of the ENGAGE-HF Android open-source project
#
# SPDX-FileCopyrightText: 2026 Stanford University and the project authors (see CONTRIBUTORS.md)
#
# SPDX-License-Identifier: MIT
#

coverage:
status:
# Coverage may not fall more than 0.5 points below the base commit.
project:
default:
target: auto
threshold: 0.5%
# New code must be better covered than the project average, so the average climbs.
patch:
default:
target: 55%

comment: false
26 changes: 26 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#
# This source file is part of the ENGAGE-HF Android open-source project
#
# SPDX-FileCopyrightText: 2026 Stanford University and the project authors (see CONTRIBUTORS.md)
#
# SPDX-License-Identifier: MIT
#

version: 2
multi-ecosystem-groups:
weekly-dependencies:
schedule:
interval: "weekly"
updates:
- package-ecosystem: "github-actions"
directory: "/"
patterns: ["*"]
multi-ecosystem-group: "weekly-dependencies"
- package-ecosystem: "gradle"
directory: "/"
patterns: ["*"]
multi-ecosystem-group: "weekly-dependencies"
- package-ecosystem: "bundler"
directory: "/"
patterns: ["*"]
multi-ecosystem-group: "weekly-dependencies"
152 changes: 5 additions & 147 deletions .github/workflows/build-test-analyze.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This source file is part of the Stanford Spezi open-source project
# This source file is part of the ENGAGE-HF Android open-source project
#
# SPDX-FileCopyrightText: 2024 Stanford University
#
Expand All @@ -13,154 +13,12 @@ on:
workflow_call:

jobs:
detekt:
name: Detekt review
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4.1.0
with:
fetch-depth: 1
ref: ${{ github.head_ref }}
- name: Detekt PR Check
uses: alaegin/Detekt-Action@v1.23.7 # latest github action version released
with:
reviewdog_reporter: github-pr-check
github_token: ${{ secrets.github_token }}
fail_on_error: true
detekt_config: internal/detekt-config.yml
buildtestandanalyze:
name: Build, Test and Analyze
runs-on: ubuntu-latest
timeout-minutes: 120
android:
name: Android
uses: SchmiedmayerLab/.github/.github/workflows/android.yml@v0.5
permissions:
actions: read
contents: read
packages: read
security-events: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: gradle
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
bundler-cache: true
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: java-kotlin
build-mode: manual
- name: Build and Test
run: bundle exec fastlane test
- name: Perform CodeQL Analysis
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
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
test:
name: Instrumented tests
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
api-level: [31, 34]
profile: ["pixel_6"]
target: ["default", "google_apis"]
steps:
- name: checkout
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: gradle
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
bundler-cache: true
- name: Enable KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Gradle cache
uses: gradle/actions/setup-gradle@v3
- name: AVD cache
uses: actions/cache@v4
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{ matrix.api-level }}-${{ matrix.target }}-${{ matrix.profile }}
- name: Create AVD and Generate Snapshot for Caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
target: ${{ matrix.target }}
profile: ${{ matrix.profile }}
arch: x86_64
force-avd-creation: false
emulator-options: -wipe-data -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
script: |
sdkmanager --list
avdmanager list devices
- name: Run Tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
target: ${{ matrix.target }}
profile: ${{ matrix.profile }}
arch: x86_64
force-avd-creation: false
emulator-options: -wipe-data -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: bundle exec fastlane connectedCheck
- name: Upload JaCoCo report to Codecov
uses: codecov/codecov-action@v4
with:
files: '**/build/reports/coverage/androidTest/debug/connected/index.html'
flags: uitests
name: codecov-coverage
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
dokka:
name: Dokka Documentation Deployment
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
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
if: github.ref == 'refs/heads/main'
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: build/dokka/htmlMultiModule
secrets: inherit
115 changes: 22 additions & 93 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This source file is part of the Stanford Spezi open-source project
# This source file is part of the ENGAGE-HF Android open-source project
#
# SPDX-FileCopyrightText: 2024 Stanford University
#
Expand All @@ -16,14 +16,12 @@ on:
inputs:
environment:
description: |
The GitHub deployment environment.
The Google Play track to publish to, and the environment holding its credentials.
required: true
default: 'internal'
type: choice
options:
- production
- beta
- alpha
- internal
version:
description: |
Expand All @@ -34,7 +32,7 @@ on:
inputs:
environment:
description: |
The GitHub deployment environment.
The Google Play track to publish to, and the environment holding its credentials.
required: false
type: string
default: internal
Expand All @@ -49,98 +47,29 @@ concurrency:
cancel-in-progress: false

jobs:
determineenvironment:
name: Determine Environment
runs-on: ubuntu-latest
outputs:
environment: ${{ steps.determineenvironment.outputs.environment }}
steps:
- name: Determine Environment
id: determineenvironment
run: |
echo "Determining the Environment ..."
if [[ -z "${{ inputs.environment }}" ]]; then
echo "environment=internal" >> $GITHUB_OUTPUT
echo "environment: internal"
else
echo "environment=${{ inputs.environment }}" >> $GITHUB_OUTPUT
echo "environment: ${{ inputs.environment }}"
fi
vars:
name: Inject Environment Variables In Deployment Workflow
needs: determineenvironment
runs-on: ubuntu-latest
environment: ${{ needs.determineenvironment.outputs.environment }}
outputs:
appidentifier: ${{ vars.APP_IDENTIFIER }}
version: ${{ steps.script.outputs.version }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: actions-ecosystem/action-get-latest-tag@v1
id: get-latest-tag
with:
semver_only: true
initial_version: "1.0.0"
- id: script
run: |
echo "Injecting Environment Variables In Deployment Workflow ..."
if [[ -z "${{ inputs.version }}" ]]; then
IFS='.' read -r MAJOR MINOR PATCH <<< "${{ steps.get-latest-tag.outputs.tag }}"

PATCH=$((PATCH + 1))
NEW_VERSION="${MAJOR}.${MINOR}.${PATCH}"

echo "version=$NEW_VERSION" >> $GITHUB_OUTPUT
echo "version: $NEW_VERSION"
else
echo "version=${{ inputs.version }}" >> $GITHUB_OUTPUT
echo "version: ${{ inputs.version }}"
fi
echo "appidentifier: ${{ vars.APP_IDENTIFIER }}"
buildtestandanalyze:
android:
name: Android
uses: ./.github/workflows/build-test-analyze.yml
permissions:
actions: read
contents: write
contents: read
packages: read
security-events: write
secrets: inherit
googleplaydeployment:

google_play:
name: Upload App to Google Play
runs-on: ubuntu-latest
needs: [determineenvironment, vars, buildtestandanalyze]
environment: ${{ needs.determineenvironment.outputs.environment }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v3.13.0
with:
distribution: 'temurin'
java-version: '17'
cache: gradle
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
bundler-cache: true
- name: Decode and Write Google Service JSON
env:
GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }}
run: echo $GOOGLE_SERVICES_JSON | base64 --decode >./app/google-services.json
- name: Decode and Write Secrets
env:
SECRETS_XML: ${{ secrets.SECRETS_XML }}
run: echo $SECRETS_XML | base64 --decode >./engagehf-modules/account/src/main/res/values/secrets.xml
- name: Setup keystore file
env:
KEY_STORE: ${{ secrets.KEY_STORE }}
run: |
echo $KEY_STORE | base64 -d > keystore.jks
echo $KEY_STORE | base64 -d > app/keystore.jks
- name: Build and Deploy
env:
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
SERVICE_ACCOUNT_JSON_KEY: ${{ secrets.SERVICE_ACCOUNT_JSON_KEY }}
run: bundle exec fastlane deployment environment:"${{ needs.determineenvironment.outputs.environment }}" applicationid:"${{ needs.vars.outputs.appidentifier }}" versionname:"${{ needs.vars.outputs.version }}"
needs: android
uses: SchmiedmayerLab/.github/.github/workflows/android-google-play.yml@v0.5
permissions:
contents: write
secrets: inherit
with:
environment: ${{ inputs.environment || 'internal' }}
recordversion: true
version: ${{ inputs.version }}
keystorepaths: |
keystore.jks
app/keystore.jks
googleservicespath: app/google-services.json
secretsxmlpath: engagehf-modules/account/src/main/res/values/secrets.xml
22 changes: 22 additions & 0 deletions .github/workflows/monthly-markdown-link-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#
# This source file is part of the ENGAGE-HF Android open-source project
#
# SPDX-FileCopyrightText: 2024 Stanford University
#
# SPDX-License-Identifier: MIT
#

name: Monthly Markdown Link Check

on:
schedule:
- cron: "0 0 1 * *"
workflow_dispatch:

jobs:
markdown_links:
name: Markdown Links
uses: SchmiedmayerLab/.github/.github/workflows/markdown-links.yml@v0.5
permissions:
contents: read
pull-requests: read
Loading
Loading