-
Notifications
You must be signed in to change notification settings - Fork 11
101 lines (87 loc) · 3.37 KB
/
masterfhirvalidation.yml
File metadata and controls
101 lines (87 loc) · 3.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
on:
workflow_call:
secrets:
ONTO_CLIENT_ID:
required: true
ONTO_CLIENT_SECRET:
required: true
jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
submodules: true
- name: Set up Java
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: '21'
- name: Check out IOPS-Validation scripts
uses: actions/checkout@v6
with:
repository: NHSDigital/IOPS-FHIR-Test-Scripts
ref: main
sparse-checkout: FHIRValidationAction
path: validation
- name: Check out validation-service-fhir-r4
uses: actions/checkout@v6
with:
repository: NHSDigital/FHIR-Validation
ref: main
path: validation-service-fhir-r4
- name: Log in to GHCR
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Pull FHIR Validation service image
run: |
docker pull ghcr.io/nhsdigital/validation-service-fhir-r4:latest
- name: Add Packages to hapi.application.yaml
run: |
pip install ruamel.yaml
python3 validation/FHIRValidationAction/scripts/configure-packages-application-yaml.py
- name: Start Validation Service
run: |
cd validation-service-fhir-r4
docker compose -f docker-compose.ci.yml 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: Wait for FHIR Validator to be available
run: |
for i in {1..120}; do
# Check for fatal package errors in logs and fail immediately
if docker logs fhir-server 2>&1 | grep -q "Unable to locate package\|Unknown resource name\|Error installing IG"; then
echo "Fatal HAPI startup error detected:"
docker logs fhir-server 2>&1 | grep -E "Unable to locate package|Unknown resource name|Error installing IG"
exit 1
fi
if docker logs fhir-server 2>&1 | grep -q "A FHIR has been lit on this server"; then
echo "FHIR server is fully started and packages are installed!"
exit 0
fi
echo "Waiting for FHIR server... attempt $i/120"
sleep 5
done
echo "FHIR server failed to start in time"
docker logs fhir-server 2>&1 | tail -50
exit 1
#- name: Install FHIR packages via $install
# 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 -f docker-compose.ci.yml down