-
Notifications
You must be signed in to change notification settings - Fork 3
130 lines (114 loc) · 3.7 KB
/
ci.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
name: ci
on:
push:
branches:
- master
- beta
release:
types: [created]
pull_request:
branches:
- master
- beta
permissions: read-all
jobs:
build:
uses: miracum/.github/.github/workflows/standard-build.yaml@f9d64a7dbe928557fde9f96defa3e372bc0eaf21 # v1.6.1
permissions:
contents: read
id-token: write
packages: write
pull-requests: write
actions: read
security-events: write
with:
enable-build-test-layer: false
enable-upload-test-image: false
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
test:
name: run k8s smoke test
runs-on: ubuntu-22.04
if: ${{ github.event_name == 'pull_request' || github.ref_name == 'beta' }}
needs:
- build
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Create KinD cluster
uses: helm/kind-action@99576bfa6ddf9a8e612d83b513da5a75875caced # v1.9.0
with:
cluster_name: kind
- name: Download image
if: ${{ github.event_name == 'pull_request' }}
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
with:
name: ${{ needs.build.outputs.image-slug }}
path: /tmp
- name: Load image into KinD
if: ${{ github.event_name == 'pull_request' }}
run: |
kind load image-archive /tmp/image.tar
# list images in cluster
docker exec kind-control-plane crictl images
- name: Install test chart
env:
IMAGE_TAG: ${{ needs.build.outputs.image-version }}
run: |
helm dep up tests/k8s
# start by first installing the Strimzi and Prometheus operators
helm upgrade --install \
--set "stream-processors.enabled=false" \
--set "stream-processors.processors.obds-to-fhir.container.image.tag=${IMAGE_TAG}" \
--wait \
--timeout=10m \
obds-to-fhir-test \
tests/k8s
kubectl wait kafka/obds-to-fhir-kafka --for=condition=Ready --timeout=300s
# install the actual obds-to-fhir stream processor
helm upgrade --install \
--set "stream-processors.enabled=true" \
--set "stream-processors.processors.obds-to-fhir.container.image.tag=${IMAGE_TAG}" \
--wait \
--timeout=10m \
obds-to-fhir-test \
tests/k8s
- name: Run Helm test to make sure everything started correctly
run: |
helm test obds-to-fhir-test
- 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@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: kind-cluster-dump.txt
path: |
kind-cluster-dump.txt
lint:
uses: miracum/.github/.github/workflows/standard-lint.yaml@f9d64a7dbe928557fde9f96defa3e372bc0eaf21 # v1.6.1
permissions:
contents: read
pull-requests: write
issues: write
security-events: write
actions: read
with:
codeql-languages: '["java"]'
enable-codeql: true
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
release:
uses: miracum/.github/.github/workflows/standard-release.yaml@f9d64a7dbe928557fde9f96defa3e372bc0eaf21 # v1.6.1
needs:
- build
permissions:
contents: write
pull-requests: write
issues: write
secrets:
semantic-release-token: ${{ secrets.MIRACUM_BOT_SEMANTIC_RELEASE_TOKEN }}