-
Notifications
You must be signed in to change notification settings - Fork 3
186 lines (160 loc) · 5.82 KB
/
ci.yaml
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
name: ci
on:
pull_request:
branches:
- master
push:
branches:
- master
release:
types:
- created
permissions: read-all
env:
ONCO_ANALYTICS_NAMESPACE_NAME: bzkf-onco-analytics
jobs:
build-decompose-xml-image:
name: build decompose-xmls container image
uses: miracum/.github/.github/workflows/standard-build.yaml@3a6d6e823363d6a7b39daaadc24566130bddef38 # v1.12.10
permissions:
contents: write
id-token: write
packages: write
pull-requests: write
actions: read
security-events: write
with:
image: ghcr.io/${{ github.repository }}/decompose-xmls
build-context: src/decompose_xmls
enable-build-test-layer: false
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
build-obds-fhir-to-opal-image:
name: build obds-fhir-to-opal container image
uses: miracum/.github/.github/workflows/standard-build.yaml@3a6d6e823363d6a7b39daaadc24566130bddef38 # v1.12.10
permissions:
contents: write
id-token: write
packages: write
pull-requests: write
actions: read
security-events: write
with:
image: ghcr.io/${{ github.repository }}/obds-fhir-to-opal
build-context: src/obds_fhir_to_opal
enable-build-test-layer: false
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
lint:
uses: miracum/.github/.github/workflows/standard-lint.yaml@3a6d6e823363d6a7b39daaadc24566130bddef38 # v1.12.10
permissions:
contents: read
pull-requests: write
issues: write
security-events: write
actions: read
with:
enable-validate-gradle-wrapper: false
codeql-languages: '["python"]'
enable-codeql: false
enable-verify-base-image-signature: false
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
tests:
strategy:
matrix:
# Python versions to run tests for
python-version: ["3.11"]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
cd src/decompose_xmls
pip install pytest
pip install -r requirements.txt
pip install -r requirements-test.txt
- name: Run decompose_xmls tests
run: |
cd src/decompose_xmls
pytest
test-k8s:
runs-on: ubuntu-22.04
# disabled since the major deployment platform is currently
# docker compose anyways
if: ${{ false }}
# run tests only on PRs
# ${{ github.event_name == 'pull_request' }}
needs:
- build-decompose-xml-image
- build-obds-fhir-to-opal-image
steps:
- name: install k3s
run: |
curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=v1.28.3+k3s2 sh -
- name: setup .kube/config
run: |
mkdir ~/.kube
sudo k3s kubectl config view --raw | tee ~/.kube/config > /dev/null
chmod 600 ~/.kube/config
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: install dependencies
run: |
kubectl get node
# via <https://stackoverflow.com/a/65411733>
kubectl create namespace "${ONCO_ANALYTICS_NAMESPACE_NAME}" --dry-run=client -o yaml | kubectl apply -f -
kubectl config set-context --current --namespace="${ONCO_ANALYTICS_NAMESPACE_NAME}"
kubectl config view
helm dependency build charts/prerequisites
helm upgrade --install --wait --timeout=10m --set strimzi-kafka-operator.generateNetworkPolicy=false onco-analytics-on-fhir-prerequisites charts/prerequisites
kubectl apply -f k8s/
kubectl wait kafka/bzkf-dizbox-cluster --for=condition=Ready --timeout=600s
kubectl apply -f k8s/kafka-bridge.yaml
kubectl wait kafkabridge/bzkf-dizbox-bridge --for=condition=Ready --timeout=600s
kubectl get all -A
- name: install onco-analytics-on-fhir
run: |
helm repo add miracum https://miracum.github.io/charts
helm repo add akhq https://akhq.io/
helm repo add hapi-fhir-jpaserver-starter https://hapifhir.github.io/hapi-fhir-jpaserver-starter
helm dependency build charts/onco-analytics-on-fhir
helm upgrade --install --wait --timeout=10m onco-analytics-on-fhir charts/onco-analytics-on-fhir
kubectl get all -A
- name: test deployments
run: |
helm test onco-analytics-on-fhir
kubectl wait deployment/onco-analytics-on-fhir-stream-processors-obds-to-fhir --for=condition=Available --timeout=300s
kubectl wait deployment/onco-analytics-on-fhir-stream-processors-fhir-to-server --for=condition=Available --timeout=300s
- name: Print cluster logs
if: always()
run: |
kubectl cluster-info dump -o yaml | tee kind-cluster-dump.txt
- name: Upload cluster dump
if: always()
uses: actions/upload-artifact@ff15f0306b3f739f7b6fd43fb5d26cd321bd4de5 # v3.2.1
with:
name: kind-cluster-dump.txt
path: |
kind-cluster-dump.txt
build-air-gapped-installer:
runs-on: ubuntu-22.04
if: ${{ github.event_name == 'pull_request' }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- run: |
./build-air-gapped-installer.sh
release:
if: ${{ startsWith(github.ref, 'refs/tags/') }}
permissions:
actions: read
contents: write
id-token: write
packages: write
needs:
- build-decompose-xml-image
- build-obds-fhir-to-opal-image
uses: ./.github/workflows/release.yaml