Skip to content

Commit

Permalink
Create build workflow (#1)
Browse files Browse the repository at this point in the history
* Create build workflow

* Make gradlew executable

* Remove ratchetFrom

* Format fixing

* Add git attributes

* Renormalize files
  • Loading branch information
vidi42 committed Sep 13, 2024
1 parent 9484687 commit ebdf851
Show file tree
Hide file tree
Showing 8 changed files with 287 additions and 16 deletions.
205 changes: 205 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,205 @@
# These files are text and should be normalized (convert crlf => lf)
# See https://help.github.com/articles/dealing-with-line-endings/
# And especially https://adaptivepatchwork.com/2012/03/01/mind-the-end-of-your-line/

## GITATTRIBUTES FOR WEB PROJECTS
#
# These settings are for any web project.
#
# Details per file setting:
# text These files should be normalized (i.e. convert CRLF to LF).
# binary These files are binary and should be left untouched.
#
# Note that binary is a macro for -text -diff.
######################################################################

## AUTO-DETECT
## Handle line endings automatically for files detected as
## text and leave all files detected as binary untouched.
## This will handle all files NOT defined below.
* text=auto

# Java sources
*.java text diff=java
*.kt text diff=kotlin
*.groovy text diff=java
*.scala text diff=java
*.gradle text diff=java
*.gradle.kts text diff=kotlin

## SOURCE CODE
*.bat text eol=crlf
*.coffee text
*.css text
gradlew text eol=lf
*.htm text
*.html text
*.inc text
*.ini text
*.js text
*.json text
*.jsx text
*.less text
*.od text
*.onlydata text
*.php text
*.pl text
*.py text
*.rb text
*.sass text
*.scm text
*.scss text
*.sh text eol=lf
Dockerfile text eol=lf
*.sql text
*.styl text
*.tag text
*.ts text
*.tsx text
*.xml text
*.xhtml text

## DOCKER
*.dockerignore text
Dockerfile text

## DOCUMENTATION
*.markdown text
*.md text
*.mdwn text
*.mdown text
*.mkd text
*.mkdn text
*.mdtxt text
*.mdtext text
*.txt text
AUTHORS text
CHANGELOG text
CHANGES text
CONTRIBUTING text
COPYING text
copyright text
*COPYRIGHT* text
INSTALL text
license text
LICENSE text
NEWS text
readme text
*README* text
TODO text

## TEMPLATES
*.dot text
*.ejs text
*.haml text
*.handlebars text
*.hbs text
*.hbt text
*.jade text
*.latte text
*.mustache text
*.njk text
*.phtml text
*.tmpl text
*.tpl text
*.twig text

## LINTERS
.csslintrc text
.eslintrc text
.htmlhintrc text
.jscsrc text
.jshintrc text
.jshintignore text
.stylelintrc text

## CONFIGS
*.bowerrc text
*.cnf text
*.conf text
*.config text
.browserslistrc text
.editorconfig text
.gitattributes text
.gitconfig text
.htaccess text
*.npmignore text
*.yaml text
*.yml text
browserslist text
Makefile text
makefile text

## HEROKU
Procfile text
.slugignore text

## GRAPHICS
*.ai binary
*.bmp binary
*.eps binary
*.gif binary
*.ico binary
*.jng binary
*.jp2 binary
*.jpg binary
*.jpeg binary
*.jpx binary
*.jxr binary
*.pdf binary
*.png binary
*.psb binary
*.psd binary
*.svg text
*.svgz binary
*.tif binary
*.tiff binary
*.wbmp binary
*.webp binary

## AUDIO
*.kar binary
*.m4a binary
*.mid binary
*.midi binary
*.mp3 binary
*.ogg binary
*.ra binary

## VIDEO
*.3gpp binary
*.3gp binary
*.as binary
*.asf binary
*.asx binary
*.fla binary
*.flv binary
*.m4v binary
*.mng binary
*.mov binary
*.mp4 binary
*.mpeg binary
*.mpg binary
*.ogv binary
*.swc binary
*.swf binary
*.webm binary

## ARCHIVES
*.7z binary
*.gz binary
*.jar binary
*.rar binary
*.tar binary
*.zip binary

## FONTS
*.ttf binary
*.eot binary
*.otf binary
*.woff binary
*.woff2 binary

## EXECUTABLES
*.exe binary
*.pyc binary
67 changes: 67 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle

name: Java CI with Gradle

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:

runs-on: ubuntu-latest
permissions:
contents: read

steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'

# Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies.
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md
- name: Setup Gradle
uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0

- name: Build with Gradle Wrapper
run: ./gradlew build

# NOTE: The Gradle Wrapper is the default and recommended way to run Gradle (https://docs.gradle.org/current/userguide/gradle_wrapper.html).
# If your project does not have the Gradle Wrapper configured, you can use the following configuration to run Gradle with a specified version.
#
# - name: Setup Gradle
# uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0
# with:
# gradle-version: '8.9'
#
# - name: Build with Gradle 8.9
# run: gradle build

dependency-submission:

runs-on: ubuntu-latest
permissions:
contents: write

steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'

# Generates and submits a dependency graph, enabling Dependabot Alerts for all project dependencies.
# See: https://github.com/gradle/actions/blob/main/dependency-submission/README.md
- name: Generate and submit dependency graph
uses: gradle/actions/dependency-submission@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0
3 changes: 0 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ ext {
}

spotless {
// optional: limit format enforcement to just the files changed by this feature branch
ratchetFrom 'origin/main'

format 'misc', {
// define the files to apply `misc` to
target '*.gradle', '.gitattributes', '.gitignore'
Expand Down
Empty file modified gradlew
100644 → 100755
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,13 @@ public FhirClientView(FhirClient fhirClient) {
patientDetails.setReadOnly(true);

Button restartFlowButton = new Button("Restart");
restartFlowButton.addClickListener(
event -> getUI().ifPresent(ui -> ui.navigate("")));
restartFlowButton.addClickListener(event -> getUI().ifPresent(ui -> ui.navigate("")));

add(
new H1("FHIR Client"),
new Text("Now that the Access Token was obtained, use it to read data from the FHIR server."),
new Text(
"Now that the Access Token was obtained, use it to read data from the FHIR"
+ " server."),
accessToken,
patientId,
getPatientDetails,
Expand Down
10 changes: 4 additions & 6 deletions src/main/java/ro/vidi/smart_on_fhir_tutorial/view/HomeView.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* (C)2024 */
package ro.vidi.smart_on_fhir_tutorial.view;

import com.vaadin.flow.component.Text;
Expand All @@ -12,14 +13,11 @@ public class HomeView extends VerticalLayout {
public HomeView() {

Button standaloneProviderLaunchFlow = new Button("Start Standalone Provider Launch Flow");
standaloneProviderLaunchFlow.addClickListener(event -> getUI().ifPresent(
ui -> ui.navigate("smart-start")));
standaloneProviderLaunchFlow.addClickListener(
event -> getUI().ifPresent(ui -> ui.navigate("smart-start")));
add(
new H1("Welcome"),
new Text("This Sample application will guide you trough the SMART on FHIR flow."),
standaloneProviderLaunchFlow
);

standaloneProviderLaunchFlow);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ public SmartCallbackView(FhirClient fhirClient, OidcClient oidcClient) {
"""));

Button restartFlowButton = new Button("Restart");
restartFlowButton.addClickListener(
event -> getUI().ifPresent(ui -> ui.navigate("")));
restartFlowButton.addClickListener(event -> getUI().ifPresent(ui -> ui.navigate("")));

accessFhirInfo = new Button("Access FHIR Data");
accessFhirInfo.setEnabled(false);
Expand Down Expand Up @@ -129,7 +128,9 @@ public SmartCallbackView(FhirClient fhirClient, OidcClient oidcClient) {

add(
new H1("SMART Callback"),
new Text("Now that the authorization code was obtained, exchange it for an access token to be used when accessing the FHIR data."),
new Text(
"Now that the authorization code was obtained, exchange it for an access"
+ " token to be used when accessing the FHIR data."),
authorizationCode,
encodedState,
getAccessTokenButton,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,9 @@ public SmartStartView(FhirClient fhirClient, OidcClient oidcClient) {

add(
new H1("SMART Start"),
new Text("Configure the FHIR Server URL, discover the Auth URLs, then start the authorization flow."),
new Text(
"Configure the FHIR Server URL, discover the Auth URLs, then start the"
+ " authorization flow."),
fhirServerUrlLayout,
discoverMetadataLayout,
metadataAccordion,
Expand Down

0 comments on commit ebdf851

Please sign in to comment.