-
Notifications
You must be signed in to change notification settings - Fork 17
240 lines (216 loc) · 9.89 KB
/
test-images.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
name: Platform Image Tests
on:
push:
branches:
- main
- stable**
pull_request:
workflow_dispatch:
inputs:
last_release:
description: "Test backwards compatibility with platform ver [semvar]"
required: false
piwind_branch:
description: "Check Results from Piwind branch [git ref]"
required: true
default: 'main'
pytest_options:
description: "Pytest optional args [-k <test_name>]"
required: false
cve_severity:
description: 'Severities of vulnerabilities to scanned for [LOW, MEDIUM, HIGH, CRITICAL, SKIP]'
required: false
oasislmf_branch:
description: 'If set, pip install oasislmf branch [git ref]'
required: false
ods_branch:
description: 'If set, pip install ods-tools branch [git ref]'
required: false
env:
pre_release: 'true' # look for pre-release when testing last released platform version
semver_major: '1' # Search for published images but limited to {semvar_major}.x.x
semver_minor: '28' # Search for published images but limited to x.{semvar_minor}.x
jobs:
build_images:
uses: ./.github/workflows/build-images.yml
secrets: inherit
with:
docker_push: true
ignore_unfixed: true
cve_severity: ${{ github.event_name != 'workflow_dispatch' && 'CRITICAL,HIGH' || inputs.cve_severity }}
oasislmf_branch: ${{ github.event_name != 'workflow_dispatch' && 'stable/1.28.x' || inputs.oasislmf_branch }}
ods_branch: ${{ github.event_name != 'workflow_dispatch' && 'stable/3.1.x' || inputs.ods_branch }}
setup:
runs-on: ubuntu-latest
needs: [build_images]
outputs:
pytest_opts: ${{ steps.pytest.outputs.opts }}
piwind_branch: ${{ steps.piwind.outputs.branch }}
release_tag: ${{ steps.released_images.outputs.prev_release_tag }}
release_stable_15: ${{ steps.released_images.outputs.stable_15 }}
release_stable_23: ${{ steps.released_images.outputs.stable_23 }}
release_stable_27: ${{ steps.released_images.outputs.stable_27 }}
build_server_img: ${{ steps.built_images.outputs.server_img }}
build_server_tag: ${{ steps.built_images.outputs.server_tag }}
build_worker_img: ${{ steps.built_images.outputs.worker_img }}
build_worker_tag: ${{ steps.built_images.outputs.worker_tag }}
build_deb_worker_img: ${{ steps.built_images.outputs.deb_worker_img }}
build_deb_worker_tag: ${{ steps.built_images.outputs.deb_worker_tag }}
steps:
- name: Checkout Platform
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Load latest release tag
id: released_images
run: |
# Find the latest release tag only from current branch
if [[ "${{ github.ref_name }}" == backports/ ]]; then
tag=$( ./scripts/find_release.sh -p "${{ env.pre_release }}")
echo "prev_release_tag=$tag" >> $GITHUB_OUTPUT
# Find tags release accross all branches, limited to matching semver
elif [[ -z "${{ inputs.last_release }}" ]]; then
tag=$( ./scripts/find_latest.sh -j "${{ env.semver_major }}" -i "${{ env.semver_minor }}" )
echo "prev_release_tag=$tag" >> $GITHUB_OUTPUT
# Don't search, use the given input
else
echo "prev_release_tag=${{ inputs.last_release }}" >> $GITHUB_OUTPUT
fi
# Find latest LTS from each stable branch
stable_1_15=$( ./scripts/find_latest.sh -j 1 -i 15 )
echo "stable_15=$stable_1_15" >> $GITHUB_OUTPUT
stable_1_23=$( ./scripts/find_latest.sh -j 1 -i 23 )
echo "stable_23=$stable_1_23" >> $GITHUB_OUTPUT
stable_1_27=$( ./scripts/find_latest.sh -j 1 -i 27 )
echo "stable_27=$stable_1_27" >> $GITHUB_OUTPUT
- name: Select PiWind branch
id: piwind
run: |
if [[ -z "${{ inputs.piwind_branch }}" ]]; then
BRANCH='stable/1.28.x'
else
BRANCH=${{ inputs.piwind_branch }}
fi
echo "branch=$BRANCH" >> $GITHUB_OUTPUT
- name: Select Pytest Options
id: pytest
run: |
if [[ -z "${{ inputs.pytest_options }}" ]]; then
echo "opts='-k all_output'" >> $GITHUB_OUTPUT
else
echo "opts=${{ inputs.pytest_options }}" >> $GITHUB_OUTPUT
fi
# Split ouput strings from build job
- name: Load built images
id: built_images
run: |
server_img=$(echo ${{ needs.build_images.outputs.server_image }} | awk '{split($0,a,":"); print a[1];}')
server_tag=$(echo ${{ needs.build_images.outputs.server_image }} | awk '{split($0,a,":"); print a[2];}')
echo "server_img=$server_img" >> $GITHUB_OUTPUT
echo "server_tag=$server_tag" >> $GITHUB_OUTPUT
worker_img=$(echo ${{ needs.build_images.outputs.worker_image }} | awk '{split($0,a,":"); print a[1];}')
worker_tag=$(echo ${{ needs.build_images.outputs.worker_image }} | awk '{split($0,a,":"); print a[2];}')
echo "worker_img=$worker_img" >> $GITHUB_OUTPUT
echo "worker_tag=$worker_tag" >> $GITHUB_OUTPUT
deb_worker_img=$(echo ${{ needs.build_images.outputs.worker_deb_image }} | awk '{split($0,a,":"); print a[1];}')
deb_worker_tag=$(echo ${{ needs.build_images.outputs.worker_deb_image }} | awk '{split($0,a,":"); print a[2];}')
echo "deb_worker_img=$deb_worker_img" >> $GITHUB_OUTPUT
echo "deb_worker_tag=$deb_worker_tag" >> $GITHUB_OUTPUT
worker_compatibility:
name: Test last worker (${{ needs.setup.outputs.release_tag }})
secrets: inherit
needs: [setup]
uses: OasisLMF/OasisPiWind/.github/workflows/integration.yml@main
with:
piwind_branch: ${{ needs.setup.outputs.piwind_branch }}
server_image: ${{ needs.setup.outputs.build_server_img }}
server_tag: ${{ needs.setup.outputs.build_server_tag }}
worker_image: 'coreoasis/model_worker'
worker_tag: ${{ needs.setup.outputs.release_tag }}
debug_mode: 1
pytest_opts: ${{ needs.setup.outputs.pytest_opts }}
storage_suffix: "_worker-${{ needs.setup.outputs.release_tag }}"
stable_compatibility_15:
name: Test stable worker (${{ needs.setup.outputs.release_stable_15 }})
secrets: inherit
needs: [setup]
uses: OasisLMF/OasisPiWind/.github/workflows/integration.yml@main
with:
piwind_branch: 'stable/1.15.x'
server_image: ${{ needs.setup.outputs.build_server_img }}
server_tag: ${{ needs.setup.outputs.build_server_tag }}
worker_image: 'coreoasis/model_worker'
worker_tag: ${{ needs.setup.outputs.release_stable_15 }}
debug_mode: 1
pytest_opts: ${{ needs.setup.outputs.pytest_opts }}
storage_suffix: "_worker-${{ needs.setup.outputs.release_stable_15 }}"
stable_compatibility_23:
name: Test stable worker (${{ needs.setup.outputs.release_stable_23 }})
secrets: inherit
needs: [setup]
uses: OasisLMF/OasisPiWind/.github/workflows/integration.yml@main
with:
piwind_branch: 'stable/1.23.x'
server_image: ${{ needs.setup.outputs.build_server_img }}
server_tag: ${{ needs.setup.outputs.build_server_tag }}
worker_image: 'coreoasis/model_worker'
worker_tag: ${{ needs.setup.outputs.release_stable_23 }}
debug_mode: 1
pytest_opts: ${{ needs.setup.outputs.pytest_opts }}
storage_suffix: "_worker-${{ needs.setup.outputs.release_stable_23 }}"
stable_compatibility_27:
name: Test stable worker (${{ needs.setup.outputs.release_stable_27 }})
secrets: inherit
needs: [setup]
uses: OasisLMF/OasisPiWind/.github/workflows/integration.yml@main
with:
piwind_branch: 'stable/1.27.x'
server_image: ${{ needs.setup.outputs.build_server_img }}
server_tag: ${{ needs.setup.outputs.build_server_tag }}
worker_image: 'coreoasis/model_worker'
worker_tag: ${{ needs.setup.outputs.release_stable_27 }}
debug_mode: 1
pytest_opts: ${{ needs.setup.outputs.pytest_opts }}
storage_suffix: "_worker-${{ needs.setup.outputs.release_stable_27 }}"
worker_debian:
name: Worker Debian
secrets: inherit
needs: [setup]
uses: OasisLMF/OasisPiWind/.github/workflows/integration.yml@main
with:
piwind_branch: ${{ needs.setup.outputs.piwind_branch }}
server_image: ${{ needs.setup.outputs.build_server_img }}
server_tag: ${{ needs.setup.outputs.build_server_tag }}
worker_image: ${{ needs.setup.outputs.build_deb_worker_img }}
worker_tag: ${{ needs.setup.outputs.build_deb_worker_tag }}
debug_mode: 1
pytest_opts: ${{ needs.setup.outputs.pytest_opts }}
storage_suffix: '_worker-debian'
server_compatibility:
name: Test last Server (${{ needs.setup.outputs.release_tag }})
secrets: inherit
needs: [setup]
uses: OasisLMF/OasisPiWind/.github/workflows/integration.yml@main
with:
piwind_branch: ${{ needs.setup.outputs.piwind_branch }}
server_image: 'coreoasis/api_server'
server_tag: ${{ needs.setup.outputs.release_tag }}
worker_image: ${{ needs.setup.outputs.build_worker_img }}
worker_tag: ${{ needs.setup.outputs.build_worker_tag }}
debug_mode: 1
pytest_opts: ${{ needs.setup.outputs.pytest_opts }}
storage_suffix: "_server-${{ needs.setup.outputs.release_tag }}"
storage_s3:
name: Storage Compatibility (S3)
secrets: inherit
needs: [setup]
uses: OasisLMF/OasisPiWind/.github/workflows/integration.yml@main
with:
piwind_branch: ${{ needs.setup.outputs.piwind_branch }}
server_image: ${{ needs.setup.outputs.build_server_img }}
server_tag: ${{ needs.setup.outputs.build_server_tag }}
worker_image: ${{ needs.setup.outputs.build_worker_img }}
worker_tag: ${{ needs.setup.outputs.build_worker_tag }}
debug_mode: 1
pytest_opts: "--docker-compose=./docker/s3.docker-compose.yml ${{ needs.setup.outputs.pytest_opts }}"
storage_suffix: '_s3'