Skip to content
Closed
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
4 changes: 4 additions & 0 deletions .allstar/binary_artifacts.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Exemption reason: This repo uses binary artifacts for gradle builds
# Exemption timeframe: permanent
optConfig:
optOut: true
36 changes: 36 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// https://aka.ms/devcontainer.json
{
"name": "Android FHIR, by Google",

// https://github.com/devcontainers/templates/tree/main/src/java
"image": "mcr.microsoft.com/devcontainers/java:1-17-bookworm",

"features": {
// https://github.com/akhildevelops/devcontainer-features/issues/7
"ghcr.io/akhildevelops/devcontainer-features/android-cli:0": {},
"ghcr.io/devcontainers-contrib/features/pipenv:2": {}

// https://github.com/CASL0/devcontainer-features/issues/4
// "ghcr.io/casl0/devcontainer-features/android-sdk:1": {}

// https://github.com/NordcomInc/devcontainer-features/issues/20
// "ghcr.io/nordcominc/devcontainer-features/android-sdk:1": {
// "platform": "33",
// "build_tools": "33.0.1"
// }
},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
// See https://github.com/google/android-fhir/issues/2614, which is blocked by
// https://github.com/akhildevelops/devcontainer-features/issues/9.
"postCreateCommand": "sudo chown -R vscode:vscode /opt/android/"

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
39 changes: 39 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: 'bug'
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**Component**
Core library, SDC library, reference app, or SDC gallery app

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Smartphone (please complete the following information):**
- Device: [e.g. Pixel4a emulator]
- Android version: [e.g. Settings -> About phone -> Android version]
- Build number: [e.g. Settings -> About phone -> Build number]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.

**Would you like to work on the issue?**
Please state if this issue should be assigned to you or who you think could help to solve this issue.
12 changes: 12 additions & 0 deletions .github/ISSUE_TEMPLATE/code_health.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
name: Code health
about: Code refactoring, testing infrastructure, documentation, etc.
title: ''
labels: 'code health'
assignees: ''

---

**Describe the Issue**

**Would you like to work on the issue?**
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: 'enhancement'
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.

**Would you like to work on the issue?**
Please state if this issue should be assigned to you or who you think could help to solve this issue.
12 changes: 12 additions & 0 deletions .github/ISSUE_TEMPLATE/process.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
name: Process
about: Builds, releases, communications, etc.
title: ''
labels: 'process'
assignees: ''

---

**Describe the Issue**

**Would you like to work on the issue?**
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/research.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: Research
about: Research tasks
title: ''
labels: 'research'
assignees: ''

---

**Describe the issue to be researched**
Include any background information and available resources.

**Describe the goal of the research**
What's the desired outcome of this task? What artifacts should be produced?

**Describe the methodology**
Where can more information be found? Who should the assignee approach to ask questions? How can a decision be made?

**Would you like to work on the issue?**
24 changes: 24 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
**IMPORTANT: All PRs must be linked to an issue (except for extremely trivial and straightforward changes).**

Fixes #[issue number]

**Description**
Clear and concise code change description.

**Alternative(s) considered**
Have you considered any alternatives? And if so, why have you chosen the approach in this PR?

**Type**
Choose one: (Bug fix | Feature | Documentation | Testing | Code health | Builds | Releases | Other)

**Screenshots (if applicable)**

**Checklist**

- [ ] I have read and acknowledged the [Code of conduct](https://github.com/google/android-fhir/blob/master/CODE_OF_CONDUCT.md).
- [ ] I have read the [Contributing](https://google.github.io/android-fhir/contrib/) page.
- [ ] I have signed the Google [Individual CLA](https://cla.developers.google.com/about/google-individual), or I am covered by my company's [Corporate CLA](https://cla.developers.google.com/about/google-corporate ).
- [ ] I have discussed my proposed solution with code owners in the linked issue(s) and we have agreed upon the general approach.
- [ ] I have run `./gradlew spotlessApply` and `./gradlew spotlessCheck` to check my code follows the style guide of this project.
- [ ] I have run `./gradlew check` and `./gradlew connectedCheck` to test my changes locally.
- [ ] I have built and run the demo app(s) to verify my change fixes the issue and/or does not break the demo app(s).
21 changes: 21 additions & 0 deletions .github/actions/commonSetup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: "common machine setup"
description: "Prepares the machine"
runs:
using: "composite"
steps:
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "21"

- 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
24 changes: 24 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# 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"

- package-ecosystem: "devcontainers"
directory: /
schedule:
interval: monthly
day: monday
time: "04:00"
163 changes: 163 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
# 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: "Build"

# Controls when the action will run. Triggers the workflow on push or pull request
# events for the `master` branch
on:
push:
branches: [master]
tags: build*
pull_request:
# The branches below must be a subset of the branches above
branches: [master]
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: "fhir" # 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-24.04-8core'
timeout-minutes: 90
permissions:
actions: read
contents: read
packages: write

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 -x :datacapture:build --scan --full-stacktrace

- name: Check with Gradle
run: ./gradlew check -x :datacapture:check --scan --full-stacktrace

- name: Run tests for datacapture Kotlin Multiplatform desktop environment with X Virtual Framebuffer
run: |
sudo apt-get install -y xvfb
xvfb-run --auto-servernum ./gradlew :datacapture:desktopTest

- name: Publish Maven packages to GitHub Packages
if: ${{ github.event_name == 'push' }}
run: ./gradlew publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPOSITORY_URL: 'https://maven.pkg.github.com/ohs-foundation/kotlin-fhir-data-capture'
# Use SNAPSHOT Prefix to follow Maven convention
ARTIFACT_VERSION_SUFFIX: SNAPSHOT

- name: Release artifacts to local repo
run: ./gradlew publishReleasePublicationToCIRepository --scan
env:
ARTIFACT_VERSION_SUFFIX: build_${{ github.run_id }}

- name: Upload artifact maven-repository.zip
uses: actions/upload-artifact@v4
with:
name: maven-repository
path: build/ci-repo

- name: Zip artifact for debugging
if: ${{ failure() }}
run: zip build.zip ./*/build -r

# Upload the build dir for all the modules for diagnosis
- name: Upload build dir
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: build
path: build.zip

# Steps that follow are related to the Documentation Web Site
# This deploys content based on docs/ which ends up in site/
# to https://google.github.io/android-fhir/ using GitHub Pages.

- name: Install Python
uses: actions/setup-python@v5
with:
python-version: 3.11
cache: "pipenv"
- name: Install PipEnv
uses: tiagovrtr/actions-pipenv@v1
with:
pipenv-version: 2023.12.1

- name: Build Docs Site
# This 1st step intentionally runs not just on the main ("master") branch
# but also for all pull requests. This serves to detect doc breakages.
# (But the following steps, which do the actual deploy, only run for
# the main branch, of course.)
run: ./build-docs.bash

- name: Setup GitHub Pages
if: ${{ github.event_name == 'push' }}
uses: actions/configure-pages@v5

- name: Upload site/ directory as GitHub Pages artifact
if: ${{ github.event_name == 'push' }}
uses: actions/upload-pages-artifact@v3
with:
path: "site/"

deploy-website:
needs: build
if: ${{ github.event_name == 'push' }}
runs-on: ubuntu-latest
# https://docs.github.com/en/actions/security-guides/automatic-token-authentication
# Sets required permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages.
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
# https://github.com/actions/deploy-pages
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
Loading