From 7e24be6fa3e8ea2cf3797c3bb173239b501f5730 Mon Sep 17 00:00:00 2001 From: Jose Francisco <94977371+icrc-jofrancisco@users.noreply.github.com> Date: Wed, 10 Jul 2024 19:55:38 +0100 Subject: [PATCH 01/13] (fix) add Blocked and Cancelled states (#13) --- .../fhir/fragments/PatientListFragment.kt | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/org/openmrs/android/fhir/fragments/PatientListFragment.kt b/app/src/main/java/org/openmrs/android/fhir/fragments/PatientListFragment.kt index a078715..8d569bc 100644 --- a/app/src/main/java/org/openmrs/android/fhir/fragments/PatientListFragment.kt +++ b/app/src/main/java/org/openmrs/android/fhir/fragments/PatientListFragment.kt @@ -202,7 +202,14 @@ class PatientListFragment : Fragment() { patientListViewModel.searchPatientsByName(searchView.query.toString().trim()) fadeOutTopBanner(currentSyncJobStatus) } - CurrentSyncJobStatus.Cancelled -> TODO() + is CurrentSyncJobStatus.Cancelled -> { + Timber.i("Sync: Cancelled") + fadeOutTopBanner(currentSyncJobStatus) + } + is CurrentSyncJobStatus.Blocked -> { + Timber.i("Sync: Blocked") + fadeOutTopBanner(currentSyncJobStatus) + } } } @@ -233,7 +240,14 @@ class PatientListFragment : Fragment() { patientListViewModel.searchPatientsByName(searchView.query.toString().trim()) fadeOutTopBanner(periodicSyncJobStatus.currentSyncJobStatus) } - CurrentSyncJobStatus.Cancelled -> TODO() + is CurrentSyncJobStatus.Cancelled -> { + Timber.i("Sync: Cancelled") + fadeOutTopBanner(periodicSyncJobStatus.currentSyncJobStatus) + } + is CurrentSyncJobStatus.Blocked -> { + Timber.i("Sync: Blocked") + fadeOutTopBanner(periodicSyncJobStatus.currentSyncJobStatus) + } } } @@ -313,4 +327,4 @@ class PatientListFragment : Fragment() { Handler(Looper.getMainLooper()).postDelayed({ topBanner.visibility = View.GONE }, 2000) } } -} \ No newline at end of file +} From 7bd2b1c19c896522bde5a27cb6083ca2bbd67094 Mon Sep 17 00:00:00 2001 From: Fred Deniger Date: Thu, 11 Jul 2024 08:30:36 +0200 Subject: [PATCH 02/13] add github actions --- .github/.worklfow/build.yaml | 74 +++++++++++++++++++++++++++ .github/.worklfow/codeql.yaml | 74 +++++++++++++++++++++++++++ .github/action/commonSetup/action.yml | 21 ++++++++ app/build.gradle.kts | 1 + 4 files changed, 170 insertions(+) create mode 100644 .github/.worklfow/build.yaml create mode 100644 .github/.worklfow/codeql.yaml create mode 100644 .github/action/commonSetup/action.yml diff --git a/.github/.worklfow/build.yaml b/.github/.worklfow/build.yaml new file mode 100644 index 0000000..52d1513 --- /dev/null +++ b/.github/.worklfow/build.yaml @@ -0,0 +1,74 @@ + nsed under the Apache License, Version 2.0 (the "License"); + # you may not use this file except in compliance with the License. + # You may obtain a copy of the License at + # + # http://www.apache.org/licenses/LICENSE-2.0 + # + # Unless required by applicable law or agreed to in writing, software + # distributed under the License is distributed on an "AS IS" BASIS, + # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + # See the License for the specific language governing permissions and + # limitations under the License. + + 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-22.04-8core + timeout-minutes: 60 + permissions: + actions: read + 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: Setup machine + uses: ./.github/actions/commonSetup + + - name: Spotless check + run: ./gradlew spotlessCheck --scan --full-stacktrace + + - name: Build (full) with Gradle + run: ./gradlew build --scan --full-stacktrace + + - name: Check with Gradle + run: ./gradlew check --scan --full-stacktrace \ No newline at end of file diff --git a/.github/.worklfow/codeql.yaml b/.github/.worklfow/codeql.yaml new file mode 100644 index 0000000..dc386a2 --- /dev/null +++ b/.github/.worklfow/codeql.yaml @@ -0,0 +1,74 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: "CodeQL" + +# NB: This GitHub Action for https://codeql.github.com seems to be +# a bit "special"; it does not appear to be (easily) possible to just +# integrate and run this as part of the main build.yaml action; see +# https://github.com/google/android-fhir/issues/2310. + +on: + push: + branches: ["main"] + pull_request: + # The branches below must be a subset of the branches above + branches: ["main"] + schedule: + - cron: "32 13 * * 2" + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref || || github.run_id }} + cancel-in-progress: true + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-22.04-8core + timeout-minutes: 60 + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: ["java"] + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Switch to Java 17 from Eclipse Temurin distro + uses: actions/setup-java@v4 + with: + java-version: 17 + distribution: temurin + + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + + # TODO: use Autobuild instead of ./gradlew after https://github.com/github/codeql-action/issues/1417 is fixed + # - name: Autobuild + # uses: github/codeql-action/autobuild@v2 + - name: Build with Gradle + run: ./gradlew --scan --full-stacktrace -Dorg.gradle.dependency.verification=off compileDebugAndroidTestSources + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + with: + category: "/language:${{matrix.language}}" \ No newline at end of file diff --git a/.github/action/commonSetup/action.yml b/.github/action/commonSetup/action.yml new file mode 100644 index 0000000..b0b4b83 --- /dev/null +++ b/.github/action/commonSetup/action.yml @@ -0,0 +1,21 @@ +name: "common machine setup" +description: "Prepares the machine" +runs: + using: "composite" + steps: + - name: Set up JDK 17 + uses: actions/setup-java@v2 + with: + distribution: temurin + java-version: "17" + + - name: "Setup Gradle" + uses: gradle/gradle-build-action@v2 + with: + # See https://github.com/marketplace/actions/gradle-build-action#enable-dependency-graph-generation-for-a-workflow + dependency-graph: generate-and-submit + # Limit the size of the cache entry. + # These directories contain instrumented/transformed dependency jars which can be reconstructed relatively quickly. + gradle-home-cache-excludes: | + caches/jars-9 + caches/transforms-3 \ No newline at end of file diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 724cd57..1acf96c 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -15,6 +15,7 @@ android { testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" manifestPlaceholders["appAuthRedirectScheme"] = applicationId!! buildFeatures.buildConfig = true + versionCode = 1 } buildTypes { debug { From 737be1478f18184f62198f4ddf10fa9ab12b6d05 Mon Sep 17 00:00:00 2001 From: Fred Deniger Date: Thu, 11 Jul 2024 09:14:56 +0200 Subject: [PATCH 03/13] add github actions --- .github/{.worklfow => .workflow}/build.yaml | 0 .github/{.worklfow => .workflow}/codeql.yaml | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename .github/{.worklfow => .workflow}/build.yaml (100%) rename .github/{.worklfow => .workflow}/codeql.yaml (100%) diff --git a/.github/.worklfow/build.yaml b/.github/.workflow/build.yaml similarity index 100% rename from .github/.worklfow/build.yaml rename to .github/.workflow/build.yaml diff --git a/.github/.worklfow/codeql.yaml b/.github/.workflow/codeql.yaml similarity index 100% rename from .github/.worklfow/codeql.yaml rename to .github/.workflow/codeql.yaml From 158e9404d501e4c0501c487bb95484fc87511735 Mon Sep 17 00:00:00 2001 From: Fred Deniger Date: Thu, 11 Jul 2024 09:17:42 +0200 Subject: [PATCH 04/13] add github actions --- .../{action => actions}/commonSetup/action.yml | 0 .github/dependabot.yaml | 17 +++++++++++++++++ .github/{.workflow => workflows}/build.yaml | 0 .github/{.workflow => workflows}/codeql.yaml | 0 4 files changed, 17 insertions(+) rename .github/{action => actions}/commonSetup/action.yml (100%) create mode 100644 .github/dependabot.yaml rename .github/{.workflow => workflows}/build.yaml (100%) rename .github/{.workflow => workflows}/codeql.yaml (100%) diff --git a/.github/action/commonSetup/action.yml b/.github/actions/commonSetup/action.yml similarity index 100% rename from .github/action/commonSetup/action.yml rename to .github/actions/commonSetup/action.yml diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml new file mode 100644 index 0000000..4a0a53e --- /dev/null +++ b/.github/dependabot.yaml @@ -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" \ No newline at end of file diff --git a/.github/.workflow/build.yaml b/.github/workflows/build.yaml similarity index 100% rename from .github/.workflow/build.yaml rename to .github/workflows/build.yaml diff --git a/.github/.workflow/codeql.yaml b/.github/workflows/codeql.yaml similarity index 100% rename from .github/.workflow/codeql.yaml rename to .github/workflows/codeql.yaml From af31692ffdf17ee0d8f0c36d3454fba5a1b14af4 Mon Sep 17 00:00:00 2001 From: Fred Deniger Date: Thu, 11 Jul 2024 09:20:03 +0200 Subject: [PATCH 05/13] add github actions --- .github/workflows/build.yaml | 12 ------------ .github/workflows/codeql.yaml | 2 +- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 52d1513..84f54c0 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -1,15 +1,3 @@ - nsed under the Apache License, Version 2.0 (the "License"); - # you may not use this file except in compliance with the License. - # You may obtain a copy of the License at - # - # http://www.apache.org/licenses/LICENSE-2.0 - # - # Unless required by applicable law or agreed to in writing, software - # distributed under the License is distributed on an "AS IS" BASIS, - # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - # See the License for the specific language governing permissions and - # limitations under the License. - name: "Build" # Controls when the action will run. Triggers the workflow on push or pull request diff --git a/.github/workflows/codeql.yaml b/.github/workflows/codeql.yaml index dc386a2..4ca8778 100644 --- a/.github/workflows/codeql.yaml +++ b/.github/workflows/codeql.yaml @@ -29,7 +29,7 @@ on: - cron: "32 13 * * 2" concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.ref || || github.run_id }} + group: ${{ github.workflow }}-${{ github.head_ref || github.ref || github.run_id }} cancel-in-progress: true jobs: From b198c4fae2a3e7ea0e008e65e74fa3f866c1ea4a Mon Sep 17 00:00:00 2001 From: Fred Deniger Date: Thu, 11 Jul 2024 09:32:50 +0200 Subject: [PATCH 06/13] add github actions --- .github/actions/commonSetup/action.yml | 21 ------------------ .github/workflows/build.yaml | 30 +++++++++++++++----------- 2 files changed, 18 insertions(+), 33 deletions(-) delete mode 100644 .github/actions/commonSetup/action.yml diff --git a/.github/actions/commonSetup/action.yml b/.github/actions/commonSetup/action.yml deleted file mode 100644 index b0b4b83..0000000 --- a/.github/actions/commonSetup/action.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: "common machine setup" -description: "Prepares the machine" -runs: - using: "composite" - steps: - - name: Set up JDK 17 - uses: actions/setup-java@v2 - with: - distribution: temurin - java-version: "17" - - - name: "Setup Gradle" - uses: gradle/gradle-build-action@v2 - with: - # See https://github.com/marketplace/actions/gradle-build-action#enable-dependency-graph-generation-for-a-workflow - dependency-graph: generate-and-submit - # Limit the size of the cache entry. - # These directories contain instrumented/transformed dependency jars which can be reconstructed relatively quickly. - gradle-home-cache-excludes: | - caches/jars-9 - caches/transforms-3 \ No newline at end of file diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 84f54c0..ea696db 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -29,12 +29,8 @@ jobs: # Build will compile APK, test APK and run tests, lint, etc. build: - runs-on: ubuntu-22.04-8core + runs-on: ubuntu-latest timeout-minutes: 60 - permissions: - actions: read - contents: read - packages: read strategy: fail-fast: false @@ -49,14 +45,24 @@ # https://github.com/diffplug/spotless/issues/1242 fetch-depth: 0 - - name: Setup machine - uses: ./.github/actions/commonSetup + - 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 - name: Spotless check - run: ./gradlew spotlessCheck --scan --full-stacktrace + run: ./gradlew spotlessCheck --full-stacktrace - - name: Build (full) with Gradle - run: ./gradlew build --scan --full-stacktrace + - name: Run Gradle tests + run: ./gradlew test --full-stacktrace - - name: Check with Gradle - run: ./gradlew check --scan --full-stacktrace \ No newline at end of file + - name: Build (full) with Gradle + run: ./gradlew build --full-stacktrace From de7778588e971d27c6753a5d29be368626e62b00 Mon Sep 17 00:00:00 2001 From: Fred Deniger Date: Thu, 11 Jul 2024 09:34:48 +0200 Subject: [PATCH 07/13] add github actions --- .github/workflows/codeql.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/codeql.yaml b/.github/workflows/codeql.yaml index 4ca8778..4daf18e 100644 --- a/.github/workflows/codeql.yaml +++ b/.github/workflows/codeql.yaml @@ -35,7 +35,7 @@ concurrency: jobs: analyze: name: Analyze - runs-on: ubuntu-22.04-8core + runs-on: ubuntu-latest timeout-minutes: 60 permissions: actions: read @@ -56,6 +56,7 @@ jobs: with: java-version: 17 distribution: temurin + cache: 'gradle' - name: Initialize CodeQL uses: github/codeql-action/init@v3 From 8e7e7911746f1ff5614be60351b2dffa94464cec Mon Sep 17 00:00:00 2001 From: Fred Deniger Date: Thu, 11 Jul 2024 09:39:40 +0200 Subject: [PATCH 08/13] add github actions --- .github/workflows/build.yaml | 3 -- .github/workflows/codeql.yaml | 75 ----------------------------------- 2 files changed, 78 deletions(-) delete mode 100644 .github/workflows/codeql.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index ea696db..aa1e7b2 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -58,9 +58,6 @@ - name: Change wrapper permissions run: chmod +x ./gradlew - - name: Spotless check - run: ./gradlew spotlessCheck --full-stacktrace - - name: Run Gradle tests run: ./gradlew test --full-stacktrace diff --git a/.github/workflows/codeql.yaml b/.github/workflows/codeql.yaml deleted file mode 100644 index 4daf18e..0000000 --- a/.github/workflows/codeql.yaml +++ /dev/null @@ -1,75 +0,0 @@ -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: "CodeQL" - -# NB: This GitHub Action for https://codeql.github.com seems to be -# a bit "special"; it does not appear to be (easily) possible to just -# integrate and run this as part of the main build.yaml action; see -# https://github.com/google/android-fhir/issues/2310. - -on: - push: - branches: ["main"] - pull_request: - # The branches below must be a subset of the branches above - branches: ["main"] - schedule: - - cron: "32 13 * * 2" - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.ref || github.run_id }} - cancel-in-progress: true - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - timeout-minutes: 60 - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: ["java"] - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Switch to Java 17 from Eclipse Temurin distro - uses: actions/setup-java@v4 - with: - java-version: 17 - distribution: temurin - cache: 'gradle' - - - name: Initialize CodeQL - uses: github/codeql-action/init@v3 - with: - languages: ${{ matrix.language }} - - # TODO: use Autobuild instead of ./gradlew after https://github.com/github/codeql-action/issues/1417 is fixed - # - name: Autobuild - # uses: github/codeql-action/autobuild@v2 - - name: Build with Gradle - run: ./gradlew --scan --full-stacktrace -Dorg.gradle.dependency.verification=off compileDebugAndroidTestSources - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 - with: - category: "/language:${{matrix.language}}" \ No newline at end of file From bdbf51836f4ed5ab88dd545a76f43e26e65f24f4 Mon Sep 17 00:00:00 2001 From: Fred Deniger Date: Thu, 11 Jul 2024 09:52:21 +0200 Subject: [PATCH 09/13] add github actions --- .github/workflows/build.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index aa1e7b2..c169612 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -31,6 +31,9 @@ build: runs-on: ubuntu-latest timeout-minutes: 60 + permissions: + contents: read + packages: read strategy: fail-fast: false @@ -57,9 +60,18 @@ - 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 }} From c2496c0dfe4a71c837e8b691436b0cade3010e36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Deniger=20-=20ICRC?= <65169434+icrc-fdeniger@users.noreply.github.com> Date: Thu, 11 Jul 2024 10:14:48 +0200 Subject: [PATCH 10/13] Create codeql.yml --- .github/workflows/codeql.yml | 96 ++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 .github/workflows/codeql.yml diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..06d31a6 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,96 @@ +# 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: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} + timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 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 + 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}}" From cf4c9ed8c43bafa74d3a2a9b22e3d74f1d68fc20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Deniger=20-=20ICRC?= <65169434+icrc-fdeniger@users.noreply.github.com> Date: Thu, 11 Jul 2024 10:18:54 +0200 Subject: [PATCH 11/13] Update codeql.yml --- .github/workflows/codeql.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 06d31a6..4b52b36 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -61,6 +61,9 @@ jobs: # 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 }} From 78be413ca9d4925d2b26984cd04acc1dccb42112 Mon Sep 17 00:00:00 2001 From: Fred Deniger Date: Thu, 11 Jul 2024 10:51:11 +0200 Subject: [PATCH 12/13] add github actions --- .github/workflows/codeql.yml | 4 ++-- app/src/main/java/org/openmrs/android/fhir/FhirApplication.kt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 4b52b36..daac633 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -27,8 +27,8 @@ jobs: # - 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: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} - timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }} + runs-on: ubuntu-latest + timeout-minutes: 360 permissions: # required for all workflows security-events: write diff --git a/app/src/main/java/org/openmrs/android/fhir/FhirApplication.kt b/app/src/main/java/org/openmrs/android/fhir/FhirApplication.kt index d3a1cd1..913d56e 100644 --- a/app/src/main/java/org/openmrs/android/fhir/FhirApplication.kt +++ b/app/src/main/java/org/openmrs/android/fhir/FhirApplication.kt @@ -98,7 +98,7 @@ class FhirApplication : Application(), DataCaptureConfig.Provider { } object ServerConstants { - const val BASE_URL = "http://10.0.2.2:8080/openmrs/ws/fhir2/R4/" - const val REST_BASE_URL = "http://10.0.2.2:8080/openmrs/ws/rest/v1/" + const val BASE_URL = "https://dcms-emr-o3.test.icrc.org/openmrs/ws/fhir2/R4/" + const val REST_BASE_URL = "https://dcms-emr-o3.test.icrc.org/openmrs/ws/rest/v1/" const val CHECK_SERVER_URL = REST_BASE_URL + "session" } From e87b6123ac597f7667d8a7730895c02dee63cc1d Mon Sep 17 00:00:00 2001 From: Fred Deniger Date: Thu, 11 Jul 2024 10:51:38 +0200 Subject: [PATCH 13/13] add github actions --- app/src/main/java/org/openmrs/android/fhir/FhirApplication.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/openmrs/android/fhir/FhirApplication.kt b/app/src/main/java/org/openmrs/android/fhir/FhirApplication.kt index 913d56e..d3a1cd1 100644 --- a/app/src/main/java/org/openmrs/android/fhir/FhirApplication.kt +++ b/app/src/main/java/org/openmrs/android/fhir/FhirApplication.kt @@ -98,7 +98,7 @@ class FhirApplication : Application(), DataCaptureConfig.Provider { } object ServerConstants { - const val BASE_URL = "https://dcms-emr-o3.test.icrc.org/openmrs/ws/fhir2/R4/" - const val REST_BASE_URL = "https://dcms-emr-o3.test.icrc.org/openmrs/ws/rest/v1/" + const val BASE_URL = "http://10.0.2.2:8080/openmrs/ws/fhir2/R4/" + const val REST_BASE_URL = "http://10.0.2.2:8080/openmrs/ws/rest/v1/" const val CHECK_SERVER_URL = REST_BASE_URL + "session" }