Skip to content

Commit

Permalink
Merge branch 'main' of github.com:icrc/openmrs-android-fhir into inte…
Browse files Browse the repository at this point in the history
…grate-dynamic-patient-identifier
  • Loading branch information
parthfloyd committed Jul 25, 2024
2 parents cf706a1 + 26e6de0 commit fc99313
Show file tree
Hide file tree
Showing 5 changed files with 210 additions and 6 deletions.
17 changes: 17 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2

updates:
- package-ecosystem: gradle
directory: /
schedule:
interval: weekly
day: monday
time: "04:00"

- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
day: monday
time: "04:00"
77 changes: 77 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: "Build"

# Controls when the action will run. Triggers the workflow on push or pull request
# events for the `master` branch
on:
push:
branches: [main]
pull_request:
# The branches below must be a subset of the branches above
branches: [main]
schedule:
# Run once a week (even if no new code or PRs) to detect random regressions
- cron: "12 13 * * 2"

env:
# Allow precise monitoring of the save/restore of Gradle User Home by `gradle-build-action`
# See https://github.com/marketplace/actions/gradle-build-action?version=v2.1.1#cache-debugging-and-analysis
GRADLE_BUILD_ACTION_CACHE_DEBUG_ENABLED: true
GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: "openmrs-android" # change this to invalidate cache

concurrency:
# github.head_ref uniquely identifies Pull Requests (but is not available when building branches like main or master)
# github.ref is the fallback used when building for workflows triggered by push
# Note that || are fallback values (not "concatenations")
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true # Use e.g. ${{ github.ref != 'refs/heads/main' }} (or master, until #2180) to only cancel for PRs not on branch

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# Build will compile APK, test APK and run tests, lint, etc.
build:
runs-on: ubuntu-latest
timeout-minutes: 60
permissions:
contents: read
packages: read

strategy:
fail-fast: false

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout Repo
uses: actions/checkout@v4
with:
# Fetch origin/master for spotless ratchet to work
# https://github.com/diffplug/spotless/issues/1242
fetch-depth: 0

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "17"
cache: 'gradle'

- name: Setup Android SDK
uses: android-actions/setup-android@v3

- name: Change wrapper permissions
run: chmod +x ./gradlew
env:
USERNAME: $GITHUB_ACTOR
TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Run Gradle tests
run: ./gradlew test --full-stacktrace
env:
USERNAME: $GITHUB_ACTOR
TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Build (full) with Gradle
run: ./gradlew build --full-stacktrace
env:
USERNAME: $GITHUB_ACTOR
TOKEN: ${{ secrets.GITHUB_TOKEN }}
99 changes: 99 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: '39 4 * * 3'

jobs:
analyze:
name: Analyze (${{ matrix.language }})
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners (github.com only)
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
runs-on: ubuntu-latest
timeout-minutes: 360
permissions:
# required for all workflows
security-events: write

# required to fetch internal or private CodeQL packs
packages: read

# only required for workflows in private repositories
actions: read
contents: read

strategy:
fail-fast: false
matrix:
include:
- language: java-kotlin
build-mode: autobuild
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
# Use `c-cpp` to analyze code written in C, C++ or both
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
steps:
- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
env:
USERNAME: $GITHUB_ACTOR
TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

# If the analyze step fails for one of the languages you are analyzing with
# "We were unable to automatically build your code", modify the matrix above
# to set the build mode to "manual" for that language. Then modify this step
# to build your code.
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
- if: matrix.build-mode == 'manual'
shell: bash
run: |
echo 'If you are using a "manual" build mode for one or more of the' \
'languages you are analyzing, replace this with the commands to build' \
'your code, for example:'
echo ' make bootstrap'
echo ' make release'
exit 1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
env:
USERNAME: $GITHUB_ACTOR
TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
category: "/language:${{matrix.language}}"
1 change: 1 addition & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ android {
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
manifestPlaceholders["appAuthRedirectScheme"] = applicationId!!
buildFeatures.buildConfig = true
versionCode = 1
}
buildTypes {
debug {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,13 @@ class PatientListFragment : Fragment() {
patientListViewModel.searchPatientsByName(searchView.query.toString().trim())
fadeOutTopBanner(currentSyncJobStatus)
}
CurrentSyncJobStatus.Cancelled -> TODO()
else -> {
TODO()
is CurrentSyncJobStatus.Cancelled -> {
Timber.i("Sync: Cancelled")
fadeOutTopBanner(currentSyncJobStatus)
}
is CurrentSyncJobStatus.Blocked -> {
Timber.i("Sync: Blocked")
fadeOutTopBanner(currentSyncJobStatus)
}
}
}
Expand Down Expand Up @@ -236,8 +240,14 @@ class PatientListFragment : Fragment() {
patientListViewModel.searchPatientsByName(searchView.query.toString().trim())
fadeOutTopBanner(periodicSyncJobStatus.currentSyncJobStatus)
}
CurrentSyncJobStatus.Cancelled -> TODO()
CurrentSyncJobStatus.Blocked -> TODO()
is CurrentSyncJobStatus.Cancelled -> {
Timber.i("Sync: Cancelled")
fadeOutTopBanner(periodicSyncJobStatus.currentSyncJobStatus)
}
is CurrentSyncJobStatus.Blocked -> {
Timber.i("Sync: Blocked")
fadeOutTopBanner(periodicSyncJobStatus.currentSyncJobStatus)
}
}
}

Expand Down Expand Up @@ -317,4 +327,4 @@ class PatientListFragment : Fragment() {
Handler(Looper.getMainLooper()).postDelayed({ topBanner.visibility = View.GONE }, 2000)
}
}
}
}

0 comments on commit fc99313

Please sign in to comment.