-
Notifications
You must be signed in to change notification settings - Fork 0
244 lines (189 loc) · 7.83 KB
/
build.yml
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
name: Build
on:
push:
branches:
- main
- develop
tags:
- '*.*.*'
pull_request:
branches:
- main
- develop
jobs:
fhir-data-evaluator-ig:
runs-on: ubuntu-22.04
steps:
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 21
- name: Install SUSHI
run: npm install -g fsh-sushi
- name: Check out Git repository
uses: actions/checkout@v4
- name: Build
working-directory: shorthand/FhirDataEvaluatorIG
run: make build
- name: Validate Generated Measures
working-directory: shorthand/FhirDataEvaluatorIG
run: make validate
- name: Validate Documentation Measures
run: make validate -C shorthand/FhirDataEvaluatorIG RESOURCES_PATH="${GITHUB_WORKSPACE}/Documentation/example-measures/example-measure-*.json"
- name: Upload Generated Measures for Integration Test
uses: actions/upload-artifact@v4
with:
name: generated-resources
path: shorthand/FhirDataEvaluatorIG/fsh-generated/resources/Measure-IntegrationTest-Measure-*.json
build:
needs: fhir-data-evaluator-ig
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Download Generated Resources
uses: actions/download-artifact@v4
with:
name: generated-resources
path: shorthand/FhirDataEvaluatorIG/fsh-generated/resources
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
- name: Build
run: mvn -B verify
- name: Upload Jar
uses: actions/upload-artifact@v4
with:
name: fhir-data-evaluator-jar
path: target/fhir-data-evaluator.jar
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and Export to Docker
uses: docker/build-push-action@v5
with:
context: .
file: docker/Dockerfile
tags: fhir-data-evaluator:latest
outputs: type=docker,dest=/tmp/fhir-data-evaluator.tar
- name: Upload FhirDataEvaluator Image
uses: actions/upload-artifact@v4
with:
name: fhir-data-evaluator-image
path: /tmp/fhir-data-evaluator.tar
integration-test:
needs: build
strategy:
matrix:
test:
- no-auth
- basic-auth
- oauth
runs-on: ubuntu-22.04
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Install Blazectl
run: .github/scripts/install-blazectl.sh
- name: Download FhirDataEvaluator Image
uses: actions/download-artifact@v4
with:
name: fhir-data-evaluator-image
path: /tmp
- name: Load FhirDataEvaluator Image
run: docker load --input /tmp/fhir-data-evaluator.tar
- name: Run Blaze and Proxy
run: docker compose -f .github/integration-test/${{ matrix.test }}/docker-compose.yml up -d --wait --wait-timeout 300 --scale fhir-data-evaluator=0
- name: Wait for Blaze
run: .github/scripts/wait-for-url.sh http://localhost:8082/health
- name: Load Data
run: .github/integration-test/${{ matrix.test }}/load-data.sh .github/integration-test/test-data
- name: Run Integration Test for ICD10
run: .github/integration-test/evaluate-icd10.sh ${{ matrix.test }}
- name: Run Integration Test for ICD10 to CSV
run: .github/integration-test/evaluate-icd10-to-csv.sh ${{ matrix.test }}
- name: Run Integration Test for ICD10 with Status to CSV
run: .github/integration-test/evaluate-icd10WithStatus-to-csv.sh ${{ matrix.test }}
- name: Run Integration Test for type code
run: .github/integration-test/evaluate-code.sh ${{ matrix.test }}
- name: Run Integration Test for type boolean
run: .github/integration-test/evaluate-exists.sh ${{ matrix.test }}
- name: Run Integration Test for Unique Count
run: .github/integration-test/evaluate-unique-count.sh ${{ matrix.test }}
- name: Run Integration Test for Unique Count with CSV
run: .github/integration-test/evaluate-unique-count-to-csv.sh ${{ matrix.test }}
- name: Run Integration Test for Unique Count with Components and with CSV
run: .github/integration-test/evaluate-unique-count-with-components-to-csv.sh ${{ matrix.test }}
- name: Run Integration Test for Reference Resolve
run: .github/integration-test/evaluate-reference-resolve.sh ${{ matrix.test }}
- name: Run Integration Test to check if it correctly exits when there are insufficient writing permissions
run: .github/integration-test/missing-permissions-test.sh
- name: Run Integration Test for Posting the MeasureReport to the FHIR server
run: .github/integration-test/evaluate-and-post-report.sh ${{ matrix.test }} Test_PROJECT_Evaluation_1
- name: Run Integration Test for Posting the MeasureReport to the FHIR server with the Same Project Identifier
run: .github/integration-test/evaluate-and-post-update.sh ${{ matrix.test }} Test_PROJECT_Evaluation_1
- name: Run Integration Test for Posting the MeasureReport to the FHIR server with a Different Project Identifier
run: .github/integration-test/evaluate-and-post-different-doc-ref.sh ${{ matrix.test }} Test_PROJECT_Evaluation_2
- name: Remove Blaze volumes
run: docker compose -f .github/integration-test/${{ matrix.test }}/docker-compose.yml down -v
- name: Run Blaze with fresh volumes
run: docker compose -f .github/integration-test/${{ matrix.test }}/docker-compose.yml up -d
- name: Wait for Blaze
run: .github/scripts/wait-for-url.sh http://localhost:8082/health
- name: Download New Data
run: .github/integration-test/test-data/get-mii-testdata.sh
- name: Upload New Data
run: .github/integration-test/${{ matrix.test }}/load-data.sh .github/integration-test/Vorhofflimmern
- name: Run Integration Test multiple stratifiers
run: .github/integration-test/evaluate-multiple-stratifiers.sh ${{ matrix.test }}
push-image:
needs:
- build
- integration-test
runs-on: ubuntu-22.04
if: ${{ ! startsWith(github.head_ref, 'dependabot/')}}
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Download Jar
uses: actions/download-artifact@v4
with:
name: fhir-data-evaluator-jar
path: target
- name: Download FhirDataEvaluator Image
uses: actions/download-artifact@v4
with:
name: fhir-data-evaluator-image
path: /tmp
- name: Load FhirDataEvaluator Image
run: docker load --input /tmp/fhir-data-evaluator.tar
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta
id: docker-meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/medizininformatik-initiative/fhir-data-evaluator
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: docker/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.docker-meta.outputs.tags }}
labels: ${{ steps.docker-meta.outputs.labels }}