Skip to content
Open
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
92 changes: 43 additions & 49 deletions .github/workflows/masterfhirvalidation.yml
Original file line number Diff line number Diff line change
@@ -1,80 +1,63 @@
name: IOPS-FHIR-Validation-Terminology

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the master branch
# Allows you to run this workflow manually from the Actions tab

workflow_call:
secrets:
ONTO_CLIENT_ID:
required: true
ONTO_CLIENT_SECRET:
required: true
FAILONWARNING:
required: false

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# 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
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
submodules: true
- uses: actions/setup-java@v4

- uses: actions/setup-java@v5
with:
distribution: 'temurin'
distribution: temurin
java-version: '21'

- name: Check out IOPS-Validation
uses: actions/checkout@master
uses: actions/checkout@v6
with:
repository: NHSDigital/IOPS-FHIR-Test-Scripts # orignally known as NHSDigital/IOPS-Validation
repository: NHSDigital/IOPS-FHIR-Test-Scripts
ref: docker-img
sparse-checkout: FHIRValidationAction
path: validation

- name: Check out validation-service-fhir-r4
uses: actions/checkout@master
uses: actions/checkout@v6
with:
repository: NHSDigital/IOPS-FHIR-Validation-Service
ref: main
repository: NHSDigital/FHIR-Validation
ref: docker-img
path: validation-service-fhir-r4

- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2-

- name: Install npm
run: cd validation && npm ci

- name: Configure FHIR Validator
run: cd validation && npm start

- name: Build validation service
run: |
cd validation-service-fhir-r4
mvn -B -ntp package

- name: Start Validation Service
run: |
cd validation-service-fhir-r4
docker compose build
docker compose up -d
env:
CI: true
ONTO_AUTH_URL: https://ontology.nhs.uk/authorisation/auth/realms/nhs-digital-terminology/protocol/openid-connect/token
ONTO_SERVER_URL: https://ontology.nhs.uk/production1/fhir
ONTO_CLIENT_ID: ${{ secrets.ONTO_CLIENT_ID }}
ONTO_CLIENT_SECRET: ${{ secrets.ONTO_CLIENT_SECRET }}

- name: Build FHIR
env:
MAVEN_OPTS: -Xmx8G
run: cd validation-service-fhir-r4 && mvn -DskipTests clean package

- name: Run FHIR Validator
- name: Wait for FHIR Validator to be available
run: |
nohup java -Xms2G -Xmx8G -jar validation-service-fhir-r4/target/fhir-validator.jar --terminology.url=https://ontology.nhs.uk/production1/fhir --terminology.authorization.tokenUrl=https://ontology.nhs.uk/authorisation/auth/realms/nhs-digital-terminology/protocol/openid-connect/token --terminology.authorization.clientId=${{ secrets.ONTO_CLIENT_ID }} --terminology.authorization.clientSecret=${{ secrets.ONTO_CLIENT_SECRET }} --aws.validationSupport=false --aws.queueEnabled=false &
# Wait for it to become ready, try 30 times, with 10 seconds between
for i in {1..60}; do
if curl -sSf http://localhost:9001/metadata > /dev/null || \
curl -sSf http://localhost:9001/fhir/metadata > /dev/null; then
if curl -sSf http://localhost:8080/fhir/metadata > /dev/null; then
echo "FHIR Validator is up!"
exit 0
fi
Expand All @@ -84,8 +67,19 @@ jobs:

echo "FHIR Validator failed to start in time"
exit 1

- name: Run Test
run: cd validation && npm test
env:
FAILONWARNING: ${{ secrets.FAILONWARNING }}

- name: Install FHIR packages
run: python3 validation/FHIRValidationAction/scripts/configure-packages.py

- name: Upload FHIR assets + Examples
run: python3 validation/FHIRValidationAction/scripts/upload-assets.py

- name: Generate validation report
if: always()
run: python3 validation/FHIRValidationAction/scripts/generate-report.py

- name: Stop Validation Service
if: always()
run: |
cd validation-service-fhir-r4
docker compose down
113 changes: 3 additions & 110 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,111 +1,4 @@
.idea
node_modules
package
src/*.tgz
src/hl7*
src/nhs*
.DS_Store# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# Next.js build output
.next

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port
/validator_cli.jar
.venv
**/__pycache__/*
**/operation_outcomes.json
11 changes: 0 additions & 11 deletions Dockerfile

This file was deleted.

Loading
Loading