-
Notifications
You must be signed in to change notification settings - Fork 552
625 lines (537 loc) · 18 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
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
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
name: CI
on:
- push
- pull_request
concurrency:
# If changes are pushed to a PR, stop all running workflows before starting new ones
group: ${{ github.head_ref || (github.repository == 'saltstack/salt-bootstrap' && github.run_id || github.ref_name) }}
cancel-in-progress: true
jobs:
collect-changed-files:
name: Collect changed files
runs-on: ubuntu-latest
outputs:
run-tests: ${{ steps.set-output.outputs.run-tests }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get specific changed files
id: changed-files
uses: tj-actions/changed-files@v25
with:
separator: ","
files: |
bootstrap-salt.*
Gemfile
kitchen*.yml
tests/**
.github/workflows/**
files_ignore: |
.github/workflows/release.yml
- name: Set Job Output
id: set-output
run: |
echo "::set-output name=run-tests::${{ steps.changed-files.outputs.any_modified }}"
- name: Set Exit Status
if: always()
run: |
mkdir exitstatus
echo "${{ job.status }}" > exitstatus/${{ github.job }}
- name: Upload Exit Status
if: always()
uses: actions/upload-artifact@v3
with:
name: exitstatus
path: exitstatus
generate-actions-workflow:
name: Generate The Actions Workflow
runs-on: ubuntu-latest
needs: collect-changed-files
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install Pre-Commit
run: |
python3 -m pip install -U pip
python3 -m pip install pre-commit
pre-commit install --install-hooks
- name: Generate Workflow Actions
run: |
pre-commit run -av generate-actions-workflow
- name: Set Exit Status
if: always()
run: |
mkdir exitstatus
echo "${{ job.status }}" > exitstatus/${{ github.job }}
- name: Upload Exit Status
if: always()
uses: actions/upload-artifact@v3
with:
name: exitstatus
path: exitstatus
lint:
name: Lint
runs-on: ubuntu-latest
needs: collect-changed-files
container: koalaman/shellcheck-alpine:v0.7.0
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
steps:
- uses: actions/checkout@v3
- name: ShellCheck
run: |
shellcheck -s sh -f tty bootstrap-salt.sh
- name: Set Exit Status
if: always()
run: |
mkdir exitstatus
echo "${{ job.status }}" > exitstatus/${{ github.job }}
- name: Upload Exit Status
if: always()
uses: actions/upload-artifact@v3
with:
name: exitstatus
path: exitstatus
freebsd-131:
name: FreeBSD 13.1
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
uses: ./.github/workflows/test-bsd.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: freebsd-131
display-name: FreeBSD 13.1
timeout: 20
runs-on: macos-12
instances: '["latest"]'
freebsd-123:
name: FreeBSD 12.3
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
uses: ./.github/workflows/test-bsd.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: freebsd-123
display-name: FreeBSD 12.3
timeout: 20
runs-on: macos-12
instances: '["latest"]'
openbsd-7:
name: OpenBSD 7
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
uses: ./.github/workflows/test-bsd.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: openbsd-7
display-name: OpenBSD 7
timeout: 20
runs-on: macos-12
instances: '["latest"]'
macos-11:
name: macOS 11
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
uses: ./.github/workflows/test-macos.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: macos-11
display-name: macOS 11
timeout: 20
runs-on: macos-11
instances: '["old-stable-3003", "old-stable-3004", "old-stable-3005", "stable-3006", "stable-3006-1", "latest"]'
macos-12:
name: macOS 12
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
uses: ./.github/workflows/test-macos.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: macos-12
display-name: macOS 12
timeout: 20
runs-on: macos-12
instances: '["old-stable-3003", "old-stable-3004", "old-stable-3005", "stable-3006", "stable-3006-1", "latest"]'
windows-2019:
name: Windows 2019
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
uses: ./.github/workflows/test-windows.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: windows-2019
display-name: Windows 2019
timeout: 20
runs-on: windows-2019
instances: '["stable-3005", "stable-3005-1", "stable-3006", "stable-3006-1", "latest"]'
windows-2022:
name: Windows 2022
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
uses: ./.github/workflows/test-windows.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: windows-2022
display-name: Windows 2022
timeout: 20
runs-on: windows-2022
instances: '["stable-3005", "stable-3005-1", "stable-3006", "stable-3006-1", "latest"]'
almalinux-8:
name: AlmaLinux 8
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
uses: ./.github/workflows/test-linux.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: almalinux-8
display-name: AlmaLinux 8
timeout: 20
instances: '["old-stable-3003", "old-stable-3004", "old-stable-3005", "stable-3005", "onedir-3005", "stable-3005-1", "stable-3006", "onedir-3006", "stable-3006-1", "latest", "default"]'
almalinux-9:
name: AlmaLinux 9
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
uses: ./.github/workflows/test-linux.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: almalinux-9
display-name: AlmaLinux 9
timeout: 20
instances: '["git-3005", "stable-3006", "onedir-3006", "stable-3006-1", "git-master", "latest", "default"]'
amazon-2:
name: Amazon 2
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
uses: ./.github/workflows/test-linux.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: amazon-2
display-name: Amazon 2
timeout: 20
instances: '["old-stable-3003", "old-stable-3004", "old-stable-3005", "stable-3005", "onedir-3005", "stable-3005-1", "stable-3006", "onedir-3006", "stable-3006-1", "latest", "default"]'
arch:
name: Arch
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
uses: ./.github/workflows/test-linux.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: arch
display-name: Arch
timeout: 20
instances: '["git-master", "latest", "default"]'
centos-7:
name: CentOS 7
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
uses: ./.github/workflows/test-linux.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: centos-7
display-name: CentOS 7
timeout: 20
instances: '["old-stable-3003", "old-stable-3004", "old-stable-3005", "stable-3005", "onedir-3005", "stable-3005-1", "stable-3006", "onedir-3006", "stable-3006-1", "latest", "default"]'
centos-stream8:
name: CentOS Stream 8
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
uses: ./.github/workflows/test-linux.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: centos-stream8
display-name: CentOS Stream 8
timeout: 20
instances: '["old-stable-3003", "old-stable-3004", "old-stable-3005", "stable-3005", "onedir-3005", "stable-3005-1", "stable-3006", "onedir-3006", "stable-3006-1", "latest", "default"]'
centos-stream9:
name: CentOS Stream 9
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
uses: ./.github/workflows/test-linux.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: centos-stream9
display-name: CentOS Stream 9
timeout: 20
instances: '["git-3005", "stable-3006", "onedir-3006", "stable-3006-1", "git-master", "latest", "default"]'
debian-10:
name: Debian 10
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
uses: ./.github/workflows/test-linux.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: debian-10
display-name: Debian 10
timeout: 20
instances: '["old-stable-3003", "old-stable-3004", "old-stable-3005", "stable-3005", "onedir-3005", "stable-3005-1", "stable-3006", "onedir-3006", "stable-3006-1", "latest", "default"]'
debian-11:
name: Debian 11
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
uses: ./.github/workflows/test-linux.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: debian-11
display-name: Debian 11
timeout: 20
instances: '["old-stable-3004", "old-stable-3005", "stable-3005", "onedir-3005", "stable-3005-1", "stable-3006", "onedir-3006", "stable-3006-1", "git-master", "latest", "default"]'
fedora-36:
name: Fedora 36
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
uses: ./.github/workflows/test-linux.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: fedora-36
display-name: Fedora 36
timeout: 20
instances: '["stable-3006", "onedir-3006", "stable-3006-1", "git-master", "latest", "default"]'
fedora-37:
name: Fedora 37
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
uses: ./.github/workflows/test-linux.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: fedora-37
display-name: Fedora 37
timeout: 20
instances: '["stable-3006", "onedir-3006", "stable-3006-1", "latest", "default"]'
fedora-38:
name: Fedora 38
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
uses: ./.github/workflows/test-linux.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: fedora-38
display-name: Fedora 38
timeout: 20
instances: '["stable-3006", "onedir-3006", "stable-3006-1", "latest", "default"]'
gentoo:
name: Gentoo
if: github.event_name == 'push'
uses: ./.github/workflows/test-linux.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: gentoo
display-name: Gentoo
timeout: 90
instances: '["git-master"]'
gentoo-systemd:
name: Gentoo (systemd)
if: github.event_name == 'push'
uses: ./.github/workflows/test-linux.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: gentoo-systemd
display-name: Gentoo (systemd)
timeout: 90
instances: '["git-master"]'
opensuse-15:
name: Opensuse 15
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
uses: ./.github/workflows/test-linux.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: opensuse-15
display-name: Opensuse 15
timeout: 20
instances: '["latest", "default"]'
opensuse-tumbleweed:
name: Opensuse Tumbleweed
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
uses: ./.github/workflows/test-linux.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: opensuse-tumbleweed
display-name: Opensuse Tumbleweed
timeout: 20
instances: '["git-master", "latest", "default"]'
oraclelinux-7:
name: Oracle Linux 7
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
uses: ./.github/workflows/test-linux.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: oraclelinux-7
display-name: Oracle Linux 7
timeout: 20
instances: '["old-stable-3003", "old-stable-3004", "old-stable-3005", "stable-3005", "onedir-3005", "stable-3005-1", "stable-3006", "onedir-3006", "stable-3006-1", "latest", "default"]'
oraclelinux-8:
name: Oracle Linux 8
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
uses: ./.github/workflows/test-linux.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: oraclelinux-8
display-name: Oracle Linux 8
timeout: 20
instances: '["old-stable-3003", "old-stable-3004", "old-stable-3005", "stable-3005", "onedir-3005", "stable-3005-1", "stable-3006", "onedir-3006", "stable-3006-1", "latest", "default"]'
photon-3:
name: Photon OS 3
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
uses: ./.github/workflows/test-linux.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: photon-3
display-name: Photon OS 3
timeout: 20
instances: '["stable-3006", "onedir-3006", "stable-3006-1", "latest", "default"]'
photon-4:
name: Photon OS 4
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
uses: ./.github/workflows/test-linux.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: photon-4
display-name: Photon OS 4
timeout: 20
instances: '["stable-3006", "onedir-3006", "stable-3006-1", "git-master", "latest", "default"]'
rockylinux-8:
name: Rocky Linux 8
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
uses: ./.github/workflows/test-linux.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: rockylinux-8
display-name: Rocky Linux 8
timeout: 20
instances: '["old-stable-3004", "old-stable-3005", "stable-3005", "onedir-3005", "stable-3005-1", "stable-3006", "onedir-3006", "stable-3006-1", "latest", "default"]'
rockylinux-9:
name: Rocky Linux 9
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
uses: ./.github/workflows/test-linux.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: rockylinux-9
display-name: Rocky Linux 9
timeout: 20
instances: '["git-3005", "stable-3006", "onedir-3006", "stable-3006-1", "git-master", "latest", "default"]'
ubuntu-2004:
name: Ubuntu 20.04
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
uses: ./.github/workflows/test-linux.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: ubuntu-2004
display-name: Ubuntu 20.04
timeout: 20
instances: '["old-stable-3003", "old-stable-3004", "old-stable-3005", "stable-3005", "onedir-3005", "stable-3005-1", "stable-3006", "onedir-3006", "stable-3006-1", "git-master", "latest", "default"]'
ubuntu-2204:
name: Ubuntu 22.04
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
uses: ./.github/workflows/test-linux.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: ubuntu-2204
display-name: Ubuntu 22.04
timeout: 20
instances: '["stable-3005", "onedir-3005", "stable-3005-1", "stable-3006", "onedir-3006", "stable-3006-1", "git-master", "latest", "default"]'
set-pipeline-exit-status:
# This step is just so we can make github require this step, to pass checks
# on a pull request instead of requiring all
name: Set the ${{ github.workflow }} Pipeline Exit Status
runs-on: ubuntu-latest
needs:
- lint
- generate-actions-workflow
- freebsd-131
- freebsd-123
- openbsd-7
- macos-11
- macos-12
- windows-2019
- windows-2022
- almalinux-8
- almalinux-9
- amazon-2
- arch
- centos-7
- centos-stream8
- centos-stream9
- debian-10
- debian-11
- fedora-36
- fedora-37
- fedora-38
- gentoo
- gentoo-systemd
- opensuse-15
- opensuse-tumbleweed
- oraclelinux-7
- oraclelinux-8
- photon-3
- photon-4
- rockylinux-8
- rockylinux-9
- ubuntu-2004
- ubuntu-2204
if: always()
steps:
- name: Download Exit Status Files
if: always()
uses: actions/download-artifact@v3
with:
name: exitstatus
path: exitstatus
- name: Delete Exit Status Artifacts
if: always()
uses: geekyeggo/delete-artifact@v1
with:
name: exitstatus
failOnError: false
- name: Set Pipeline Exit Status
run: |
grep -RE 'failure|cancelled' exitstatus/ && exit 1 || exit 0
- name: Done
if: always()
run:
echo "All worflows finished"