|
1 | 1 | name: IOPS-FHIR-Validation-Terminology |
2 | 2 |
|
3 | | -# Controls when the workflow will run |
4 | 3 | on: |
5 | | - # Triggers the workflow on push or pull request events but only for the master branch |
6 | | - # Allows you to run this workflow manually from the Actions tab |
7 | | - |
8 | 4 | workflow_call: |
9 | 5 | secrets: |
10 | 6 | ONTO_CLIENT_ID: |
11 | 7 | required: true |
12 | 8 | ONTO_CLIENT_SECRET: |
13 | 9 | required: true |
14 | | - FAILONWARNING: |
15 | | - required: false |
16 | 10 |
|
17 | | -# A workflow run is made up of one or more jobs that can run sequentially or in parallel |
18 | 11 | jobs: |
19 | | - # This workflow contains a single job called "build" |
20 | 12 | build: |
21 | | - # The type of runner that the job will run on |
22 | 13 | runs-on: ubuntu-latest |
23 | 14 |
|
24 | | - # Steps represent a sequence of tasks that will be executed as part of the job |
25 | 15 | steps: |
26 | | - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it |
27 | | - - uses: actions/checkout@v4 |
| 16 | + - uses: actions/checkout@v6 |
28 | 17 | with: |
29 | 18 | submodules: true |
30 | | - |
31 | | - - uses: actions/setup-java@v4 |
| 19 | + |
| 20 | + - uses: actions/setup-java@v5 |
32 | 21 | with: |
33 | | - distribution: 'temurin' |
| 22 | + distribution: temurin |
34 | 23 | java-version: '21' |
35 | | - |
| 24 | + |
36 | 25 | - name: Check out IOPS-Validation |
37 | | - uses: actions/checkout@master |
| 26 | + uses: actions/checkout@v6 |
38 | 27 | with: |
39 | | - repository: NHSDigital/IOPS-FHIR-Test-Scripts # orignally known as NHSDigital/IOPS-Validation |
| 28 | + repository: NHSDigital/IOPS-FHIR-Test-Scripts/FHIRValidationAction |
40 | 29 | path: validation |
41 | 30 |
|
42 | 31 | - name: Check out validation-service-fhir-r4 |
43 | | - uses: actions/checkout@master |
| 32 | + uses: actions/checkout@v6 |
44 | 33 | with: |
45 | | - repository: NHSDigital/IOPS-FHIR-Validation-Service |
| 34 | + repository: NHSDigital/FHIR-Validation |
46 | 35 | ref: main |
47 | 36 | path: validation-service-fhir-r4 |
48 | | - |
49 | | - - name: Cache Maven packages |
50 | | - uses: actions/cache@v4 |
51 | | - with: |
52 | | - path: ~/.m2 |
53 | | - key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} |
54 | | - restore-keys: ${{ runner.os }}-m2- |
55 | | - |
56 | | - - name: Install npm |
57 | | - run: cd validation && npm ci |
58 | | - |
59 | | - - name: Configure FHIR Validator |
60 | | - run: cd validation && npm start |
| 37 | + |
| 38 | + - name: Debug XML file |
| 39 | + run: | |
| 40 | + FILE="valuesets/ValueSet-UKCore-ListCode.xml" |
| 41 | + echo "File size: $(wc -c < "$FILE")" |
| 42 | + echo "Last 5 lines:" |
| 43 | + tail -5 "$FILE" |
| 44 | + echo "Line endings: $(file "$FILE")" |
| 45 | +
|
| 46 | + - name: Build validation service |
| 47 | + run: | |
| 48 | + cd validation-service-fhir-r4 |
| 49 | + mvn -B -ntp package |
| 50 | +
|
| 51 | + - name: Start Validation Service |
| 52 | + run: | |
| 53 | + cd validation-service-fhir-r4 |
| 54 | + docker compose up -d |
61 | 55 | env: |
62 | 56 | CI: true |
| 57 | + ONTO_AUTH_URL: https://ontology.nhs.uk/authorisation/auth/realms/nhs-digital-terminology/protocol/openid-connect/token |
| 58 | + ONTO_SERVER_URL: https://ontology.nhs.uk/production1/fhir |
63 | 59 | ONTO_CLIENT_ID: ${{ secrets.ONTO_CLIENT_ID }} |
64 | 60 | ONTO_CLIENT_SECRET: ${{ secrets.ONTO_CLIENT_SECRET }} |
65 | | - |
66 | | - - name: Build FHIR |
67 | | - env: |
68 | | - MAVEN_OPTS: -Xmx8G |
69 | | - run: cd validation-service-fhir-r4 && mvn -DskipTests clean package |
70 | 61 |
|
71 | | - - name: Run FHIR Validator |
| 62 | + - name: Wait for FHIR Validator to be available |
72 | 63 | run: | |
73 | | - 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 & |
74 | | - # Wait for it to become ready, try 30 times, with 10 seconds between |
75 | 64 | for i in {1..60}; do |
76 | | - if curl -sSf http://localhost:9001/metadata > /dev/null || \ |
77 | | - curl -sSf http://localhost:9001/fhir/metadata > /dev/null; then |
| 65 | + if curl -sSf http://localhost:8080/fhir/metadata > /dev/null; then |
78 | 66 | echo "FHIR Validator is up!" |
79 | 67 | exit 0 |
80 | 68 | fi |
|
84 | 72 |
|
85 | 73 | echo "FHIR Validator failed to start in time" |
86 | 74 | exit 1 |
87 | | - |
88 | | - - name: Run Test |
89 | | - run: cd validation && npm test |
90 | | - env: |
91 | | - FAILONWARNING: ${{ secrets.FAILONWARNING }} |
| 75 | + |
| 76 | + - name: Debug directory |
| 77 | + run: | |
| 78 | + pwd |
| 79 | + ls -la |
| 80 | + |
| 81 | + - name: Install FHIR packages |
| 82 | + run: python3 validation/scripts/configure-packages.py |
| 83 | + |
| 84 | + - name: Upload FHIR assets + Examples |
| 85 | + run: python3 validation/scripts/upload-assets.py |
| 86 | + |
| 87 | + - name: Debug - Check ValueSet uploaded |
| 88 | + run: | |
| 89 | + curl -s "http://localhost:8080/fhir/ValueSet?url=https://fhir.hl7.org.uk/ValueSet/UKCore-CareSettingType" | python3 -m json.tool | grep -E '"total"|"id"|"url"' |
| 90 | +
|
| 91 | + - name: Generate validation report |
| 92 | + if: always() |
| 93 | + run: python3 validation/scripts/generate-report.py |
| 94 | + |
| 95 | + - name: Stop Validation Service |
| 96 | + if: always() |
| 97 | + run: | |
| 98 | + cd validation-service-fhir-r4 |
| 99 | + docker compose down |
0 commit comments