-
Notifications
You must be signed in to change notification settings - Fork 5
415 lines (386 loc) · 16.2 KB
/
weekly_tests.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
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
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
name: Weekly Tests
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * SAT"
jobs:
tests-1:
name: Run first set of tests
runs-on: [self-hosted, small]
timeout-minutes: 1440
outputs:
failed_tests: ${{ steps.collect-failed-tests.outputs.failed_tests }}
steps:
- name: Tests for charm-advanced-routing
uses: convictional/[email protected]
id: charm-advanced-routing
with:
owner: canonical
repo: charm-advanced-routing
github_token: ${{ secrets.GHA_WORKFLOW_TRIGGER }}
workflow_file_name: check.yaml
ref: master
wait_interval: 60
- name: Tests for charm-apt-mirror
uses: convictional/[email protected]
id: charm-apt-mirror
if: ${{ always() }}
with:
owner: canonical
repo: charm-apt-mirror
github_token: ${{ secrets.GHA_WORKFLOW_TRIGGER }}
workflow_file_name: check.yaml
ref: main
wait_interval: 60
- name: Tests for charm-cloudsupport
uses: convictional/[email protected]
id: charm-cloudsupport
if: ${{ always() }}
with:
owner: canonical
repo: charm-cloudsupport
github_token: ${{ secrets.GHA_WORKFLOW_TRIGGER }}
workflow_file_name: check.yaml
ref: main
wait_interval: 60
- name: Tests for charm-duplicity
uses: convictional/[email protected]
id: charm-duplicity
if: ${{ always() }}
with:
owner: canonical
repo: charm-duplicity
github_token: ${{ secrets.GHA_WORKFLOW_TRIGGER }}
workflow_file_name: check.yaml
ref: master
wait_interval: 60
- name: Tests for hardware-observer-operator
uses: convictional/[email protected]
id: hardware-observer-operator
if: ${{ always() }}
with:
owner: canonical
repo: hardware-observer-operator
github_token: ${{ secrets.GHA_WORKFLOW_TRIGGER }}
workflow_file_name: check.yaml
ref: master
wait_interval: 60
- name: COS integration tests for hardware-observer-operator
uses: convictional/[email protected]
id: hardware-observer-operator-integration
if: ${{ always() }}
with:
owner: canonical
repo: hardware-observer-operator
github_token: ${{ secrets.GHA_WORKFLOW_TRIGGER }}
workflow_file_name: cos_integration.yaml
ref: master
wait_interval: 60
- name: Tests for charm-juju-backup-all
uses: convictional/[email protected]
id: charm-juju-backup-all
if: ${{ always() }}
with:
owner: canonical
repo: charm-juju-backup-all
github_token: ${{ secrets.GHA_WORKFLOW_TRIGGER }}
workflow_file_name: check.yaml
ref: master
wait_interval: 60
- name: Tests for charm-juju-local
uses: convictional/[email protected]
id: charm-juju-local
if: ${{ always() }}
with:
owner: canonical
repo: charm-juju-local
github_token: ${{ secrets.GHA_WORKFLOW_TRIGGER }}
workflow_file_name: check.yaml
ref: master
wait_interval: 60
- name: Tests for charm-kubernetes-service-checks
uses: convictional/[email protected]
id: charm-kubernetes-service-checks
if: ${{ always() }}
with:
owner: canonical
repo: charm-kubernetes-service-checks
github_token: ${{ secrets.GHA_WORKFLOW_TRIGGER }}
workflow_file_name: check.yaml
ref: master
wait_interval: 60
- name: Tests for charm-local-users
uses: convictional/[email protected]
id: charm-local-users
if: ${{ always() }}
with:
owner: canonical
repo: charm-local-users
github_token: ${{ secrets.GHA_WORKFLOW_TRIGGER }}
workflow_file_name: check.yaml
ref: main
wait_interval: 60
- name: Tests for charm-logrotated
uses: convictional/[email protected]
id: charm-logrotated
if: ${{ always() }}
with:
owner: canonical
repo: charm-logrotated
github_token: ${{ secrets.GHA_WORKFLOW_TRIGGER }}
workflow_file_name: check.yaml
ref: master
wait_interval: 60
- name: Tests for charm-nginx
uses: convictional/[email protected]
id: charm-nginx
if: ${{ always() }}
with:
owner: canonical
repo: charm-nginx
github_token: ${{ secrets.GHA_WORKFLOW_TRIGGER }}
workflow_file_name: check.yaml
ref: main
wait_interval: 60
- name: Tests for charm-openstack-service-checks
uses: convictional/[email protected]
id: charm-openstack-service-checks
if: ${{ always() }}
with:
owner: canonical
repo: charm-openstack-service-checks
github_token: ${{ secrets.GHA_WORKFLOW_TRIGGER }}
workflow_file_name: check.yaml
ref: master
wait_interval: 60
- name: Tests for charm-prometheus-blackbox-exporter
uses: convictional/[email protected]
id: charm-prometheus-blackbox-exporter
if: ${{ always() }}
with:
owner: canonical
repo: charm-prometheus-blackbox-exporter
github_token: ${{ secrets.GHA_WORKFLOW_TRIGGER }}
workflow_file_name: check.yaml
ref: master
wait_interval: 60
- name: Collect failed tests
id: collect-failed-tests
if: ${{ failure() }}
run: |
failed_tests=""
if [ "${{ steps.charm-advanced-routing.outcome }}" != "success" ]; then
failed_tests+="[charm-advanced-routing](https://github.com/canonical/charm-advanced-routing/actions), "
fi
if [ "${{ steps.charm-apt-mirror.outcome }}" != "success" ]; then
failed_tests+="[charm-apt-mirror](https://github.com/canonical/charm-apt-mirror/actions), "
fi
if [ "${{ steps.charm-cloudsupport.outcome }}" != "success" ]; then
failed_tests+="[charm-cloudsupport](https://github.com/canonical/charm-cloudsupport/actions), "
fi
if [ "${{ steps.charm-duplicity.outcome }}" != "success" ]; then
failed_tests+="[charm-duplicity](https://github.com/canonical/charm-duplicity/actions), "
fi
if [ "${{ steps.hardware-observer-operator.outcome }}" != "success" ]; then
failed_tests+="[hardware-observer-operator](https://github.com/canonical/hardware-observer-operator/actions), "
fi
if [ "${{ steps.hardware-observer-operator-integration.outcome }}" != "success" ]; then
failed_tests+="[hardware-observer-operator-integration](https://github.com/canonical/hardware-observer-operator/actions), "
fi
if [ "${{ steps.charm-juju-backup-all.outcome }}" != "success" ]; then
failed_tests+="[charm-juju-backup-all](https://github.com/canonical/charm-juju-backup-all/actions), "
fi
if [ "${{ steps.charm-juju-local.outcome }}" != "success" ]; then
failed_tests+="[charm-juju-local](https://github.com/canonical/charm-juju-local/actions), "
fi
if [ "${{ steps.charm-kubernetes-service-checks.outcome }}" != "success" ]; then
failed_tests+="[charm-kubernetes-service-checks](https://github.com/canonical/charm-kubernetes-service-checks/actions), "
fi
if [ "${{ steps.charm-local-users.outcome }}" != "success" ]; then
failed_tests+="[charm-local-users](https://github.com/canonical/charm-local-users/actions), "
fi
if [ "${{ steps.charm-logrotated.outcome }}" != "success" ]; then
failed_tests+="[charm-logrotated](https://github.com/canonical/charm-logrotated/actions), "
fi
if [ "${{ steps.charm-nginx.outcome }}" != "success" ]; then
failed_tests+="[charm-nginx](https://github.com/canonical/charm-nginx/actions), "
fi
if [ "${{ steps.charm-nrpe.outcome }}" != "success" ]; then
failed_tests+="[charm-nrpe](https://github.com/canonical/charm-nrpe/actions), "
fi
if [ "${{ steps.charm-openstack-service-checks.outcome }}" != "success" ]; then
failed_tests+="[charm-openstack-service-checks](https://github.com/canonical/charm-openstack-service-checks/actions), "
fi
if [ "${{ steps.charm-prometheus-blackbox-exporter.outcome }}" != "success" ]; then
failed_tests+="[charm-prometheus-blackbox-exporter](https://github.com/canonical/charm-prometheus-blackbox-exporter/actions), "
fi
# Set the output variable to pass the failed tests to the next job
echo "failed_tests=$failed_tests" >> "$GITHUB_OUTPUT"
tests-2:
name: Run second set of tests
runs-on: [self-hosted, small]
timeout-minutes: 1440
outputs:
failed_tests: ${{ steps.collect-failed-tests.outputs.failed_tests }}
steps:
- name: Tests for charm-prometheus-libvirt-exporter
uses: convictional/[email protected]
id: charm-prometheus-libvirt-exporter
with:
owner: canonical
repo: charm-prometheus-libvirt-exporter
github_token: ${{ secrets.GHA_WORKFLOW_TRIGGER }}
workflow_file_name: check.yaml
ref: master
wait_interval: 60
- name: Tests for charm-simple-streams
uses: convictional/[email protected]
id: charm-simple-streams
if: ${{ always() }}
with:
owner: canonical
repo: charm-simple-streams
github_token: ${{ secrets.GHA_WORKFLOW_TRIGGER }}
workflow_file_name: check.yaml
ref: main
wait_interval: 60
- name: Tests for charm-storage-connector
uses: convictional/[email protected]
id: charm-storage-connector
if: ${{ always() }}
with:
owner: canonical
repo: charm-storage-connector
github_token: ${{ secrets.GHA_WORKFLOW_TRIGGER }}
workflow_file_name: check.yaml
ref: master
wait_interval: 60
- name: Tests for charm-sysconfig
uses: convictional/[email protected]
id: charm-sysconfig
if: ${{ always() }}
with:
owner: canonical
repo: charm-sysconfig
github_token: ${{ secrets.GHA_WORKFLOW_TRIGGER }}
workflow_file_name: check.yaml
ref: master
wait_interval: 60
- name: Tests for charm-userdir-ldap
uses: convictional/[email protected]
id: charm-userdir-ldap
if: ${{ always() }}
with:
owner: canonical
repo: charm-userdir-ldap
github_token: ${{ secrets.GHA_WORKFLOW_TRIGGER }}
workflow_file_name: check.yaml
ref: master
wait_interval: 60
- name: Tests for prometheus-hardware-exporter
uses: convictional/[email protected]
id: prometheus-hardware-exporter
if: ${{ always() }}
with:
owner: canonical
repo: prometheus-hardware-exporter
github_token: ${{ secrets.GHA_WORKFLOW_TRIGGER }}
workflow_file_name: check.yaml
ref: main
wait_interval: 60
- name: Tests for prometheus-juju-exporter
uses: convictional/[email protected]
id: prometheus-juju-exporter
if: ${{ always() }}
with:
owner: canonical
repo: prometheus-juju-exporter
github_token: ${{ secrets.GHA_WORKFLOW_TRIGGER }}
workflow_file_name: pr.yaml
ref: main
wait_interval: 60
- name: Tests for prometheus-juju-backup-all-exporter
uses: convictional/[email protected]
id: prometheus-juju-backup-all-exporter
if: ${{ always() }}
with:
owner: canonical
repo: prometheus-juju-backup-all-exporter
github_token: ${{ secrets.GHA_WORKFLOW_TRIGGER }}
workflow_file_name: check.yaml
ref: main
wait_interval: 60
- name: Tests for snap-tempest
uses: convictional/[email protected]
id: snap-tempest
if: ${{ always() }}
with:
owner: canonical
repo: snap-tempest
github_token: ${{ secrets.GHA_WORKFLOW_TRIGGER }}
workflow_file_name: pr.yaml
ref: main
wait_interval: 60
- name: Tests for charmed-openstack-upgrader
uses: convictional/[email protected]
id: charmed-openstack-upgrader
if: ${{ always() }}
with:
owner: canonical
repo: charmed-openstack-upgrader
github_token: ${{ secrets.GHA_WORKFLOW_TRIGGER }}
workflow_file_name: check.yaml
ref: main
wait_interval: 60
- name: Collect failed tests
id: collect-failed-tests
if: ${{ failure() }}
run: |
failed_tests=""
if [ "${{ steps.charm-prometheus-libvirt-exporter.outcome }}" != "success" ]; then
failed_tests+="[charm-prometheus-libvirt-exporter](https://github.com/canonical/charm-prometheus-libvirt-exporter/actions), "
fi
if [ "${{ steps.charm-simple-streams.outcome }}" != "success" ]; then
failed_tests+="[charm-simple-streams](https://github.com/canonical/charm-simple-streams/actions), "
fi
if [ "${{ steps.charm-storage-connector.outcome }}" != "success" ]; then
failed_tests+="[charm-storage-connector](https://github.com/canonical/charm-storage-connector/actions), "
fi
if [ "${{ steps.charm-sysconfig.outcome }}" != "success" ]; then
failed_tests+="[charm-sysconfig](https://github.com/canonical/charm-sysconfig/actions), "
fi
if [ "${{ steps.charm-userdir-ldap.outcome }}" != "success" ]; then
failed_tests+="[charm-userdir-ldap](https://github.com/canonical/charm-userdir-ldap/actions), "
fi
if [ "${{ steps.prometheus-hardware-exporter.outcome }}" != "success" ]; then
failed_tests+="[prometheus-hardware-exporter](https://github.com/canonical/prometheus-hardware-exporter/actions), "
fi
if [ "${{ steps.prometheus-juju-exporter.outcome }}" != "success" ]; then
failed_tests+="[prometheus-juju-exporter](https://github.com/canonical/prometheus-juju-exporter/actions), "
fi
if [ "${{ steps.prometheus-juju-backup-all-exporter.outcome }}" != "success" ]; then
failed_tests+="[prometheus-juju-backup-all-exporter](https://github.com/canonical/prometheus-juju-backup-all-exporter/actions), "
fi
if [ "${{ steps.snap-tempest.outcome }}" != "success" ]; then
failed_tests+="[snap-tempest](https://github.com/canonical/snap-tempest/actions), "
fi
if [ "${{ steps.charmed-openstack-upgrader.outcome }}" != "success" ]; then
failed_tests+="[charmed-openstack-upgrader](https://github.com/canonical/charmed-openstack-upgrader/actions), "
fi
# Set the output variable to pass the failed tests to the next job
echo "failed_tests=$failed_tests" >> "$GITHUB_OUTPUT"
notify-on-failure:
needs: [tests-1, tests-2]
if: ${{ failure() }}
name: Notify Mattermost Channel
runs-on: ubuntu-latest
steps:
- name: Create the Mattermost Message
env:
FAILED_TESTS_1: ${{ needs.tests-1.outputs.failed_tests }}
FAILED_TESTS_2: ${{ needs.tests-2.outputs.failed_tests }}
run: |
echo "{\"text\":\":robot_face: Weekly tests have failed for these projects: $FAILED_TESTS_1 $FAILED_TESTS_2\"}" > mattermost.json
- uses: mattermost/action-mattermost-notify@master
env:
MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL }}