forked from PowerDNS/pdns
-
Notifications
You must be signed in to change notification settings - Fork 2
593 lines (576 loc) · 21.2 KB
/
build-and-test-all.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
---
name: 'Build and test everything'
on:
push:
pull_request:
schedule:
- cron: '0 22 * * 3'
permissions: # least privileges, see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
contents: read
env:
CLANG_VERSION: '13'
# github.workspace variable points to the Runner home folder. Container home folder defined below.
REPO_HOME: '/__w/pdns/pdns'
jobs:
build-auth:
name: build auth
if: ${{ !github.event.schedule || vars.SCHEDULED_JOBS_BUILD_AND_TEST_ALL }}
runs-on: ubuntu-20.04
container:
image: ghcr.io/powerdns/base-pdns-ci-image/debian-11-pdns-base:master
env:
ASAN_OPTIONS: detect_leaks=0
FUZZING_TARGETS: yes
SANITIZERS: asan+ubsan
UBSAN_OPTIONS: "print_stacktrace=1:halt_on_error=1:suppressions=${{ env.REPO_HOME }}/build-scripts/UBSan.supp"
UNIT_TESTS: yes
PDNS_TEST_NO_IPV6: yes
outputs:
clang-tidy-failed: ${{ steps.clang-tidy-annotations.outputs.failed }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 5
submodules: recursive
- name: get timestamp for cache
id: get-stamp
run: |
echo "stamp=$(/bin/date +%s)" >> "$GITHUB_OUTPUT"
shell: bash
- run: mkdir -p ~/.ccache
- name: let GitHub cache our ccache data
uses: actions/cache@v3
with:
path: ~/.ccache
key: auth-ccache-${{ steps.get-stamp.outputs.stamp }}
restore-keys: auth-ccache-
- run: inv ci-autoconf
- run: inv ci-auth-configure
- run: inv ci-auth-make-bear # This runs under pdns/
- run: ln -s .clang-tidy.full .clang-tidy
- name: Run clang-tidy
working-directory: pdns
run: git diff -U0 HEAD^..HEAD | python3 ../.github/scripts/git-filter.py | python3 /usr/bin/clang-tidy-diff-${CLANG_VERSION}.py -clang-tidy-binary /usr/bin/clang-tidy-${CLANG_VERSION} -extra-arg=-ferror-limit=0 -p2 -export-fixes clang-tidy-auth.yml
- name: Print clang-tidy fixes YAML
working-directory: pdns
shell: bash
run: |
if [ -f clang-tidy-auth.yml ]; then
cat clang-tidy-auth.yml
fi
- name: Result annotations
id: clang-tidy-annotations
shell: bash
working-directory: pdns
run: |
if [ -f clang-tidy-auth.yml ]; then
set +e
python3 ../.github/scripts/clang-tidy.py --fixes-file clang-tidy-auth.yml
echo "failed=$?" >> $GITHUB_OUTPUT
fi
- run: inv ci-auth-install-remotebackend-test-deps
- run: inv ci-auth-run-unit-tests
- run: inv ci-make-install
- run: ccache -s
- name: Store the binaries
uses: actions/upload-artifact@v3 # this takes 30 seconds, maybe we want to tar
with:
name: pdns-auth
path: /opt/pdns-auth
retention-days: 1
build-recursor:
name: build recursor
if: ${{ !github.event.schedule || vars.SCHEDULED_JOBS_BUILD_AND_TEST_ALL }}
runs-on: ubuntu-20.04
strategy:
matrix:
sanitizers: [ubsan+asan, tsan]
container:
image: ghcr.io/powerdns/base-pdns-ci-image/debian-11-pdns-base:master
env:
ASAN_OPTIONS: detect_leaks=0
SANITIZERS: ${{ matrix.sanitizers }}
UBSAN_OPTIONS: "print_stacktrace=1:halt_on_error=1:suppressions=${{ env.REPO_HOME }}/build-scripts/UBSan.supp"
UNIT_TESTS: yes
defaults:
run:
working-directory: ./pdns/recursordist/
outputs:
clang-tidy-failed: ${{ steps.clang-tidy-annotations.outputs.failed }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 5
submodules: recursive
- name: get timestamp for cache
id: get-stamp
run: |
echo "stamp=$(/bin/date +%s)" >> "$GITHUB_OUTPUT"
shell: bash
- run: mkdir -p ~/.ccache
- name: let GitHub cache our ccache data
uses: actions/cache@v3
with:
path: ~/.ccache
key: recursor-${{ matrix.sanitizers }}-ccache-${{ steps.get-stamp.outputs.stamp }}
restore-keys: recursor-${{ matrix.sanitizers }}-ccache-
- run: inv ci-autoconf
- run: inv ci-rec-configure
- run: inv ci-rec-make-bear
- run: ln -s ../../.clang-tidy.full .clang-tidy
- name: Run clang-tidy
run: git diff -U0 HEAD^..HEAD | python3 ../../.github/scripts/git-filter.py | python3 /usr/bin/clang-tidy-diff-${CLANG_VERSION}.py -clang-tidy-binary /usr/bin/clang-tidy-${CLANG_VERSION} -extra-arg=-ferror-limit=0 -p3 -export-fixes clang-tidy-rec.yml
- name: Print clang-tidy fixes YAML
shell: bash
run: |
if [ -f clang-tidy-rec.yml ]; then
cat clang-tidy-rec.yml
fi
- name: Result annotations
id: clang-tidy-annotations
shell: bash
run: |
if [ -f clang-tidy-rec.yml ]; then
set +e
python ../../.github/scripts/clang-tidy.py --fixes-file clang-tidy-rec.yml
echo "failed=$?" >> $GITHUB_OUTPUT
fi
- run: inv ci-rec-run-unit-tests
- run: inv ci-make-install
- run: ccache -s
- name: Store the binaries
uses: actions/upload-artifact@v3 # this takes 30 seconds, maybe we want to tar
with:
name: pdns-recursor-${{ matrix.sanitizers }}
path: /opt/pdns-recursor
retention-days: 1
build-dnsdist:
name: build dnsdist
if: ${{ !github.event.schedule || vars.SCHEDULED_JOBS_BUILD_AND_TEST_ALL }}
runs-on: ubuntu-20.04
strategy:
matrix:
sanitizers: [ubsan+asan, tsan]
features: [least, full]
exclude:
- sanitizers: tsan
features: least
container:
image: ghcr.io/powerdns/base-pdns-ci-image/debian-11-pdns-base:master
env:
ASAN_OPTIONS: detect_leaks=0
SANITIZERS: ${{ matrix.sanitizers }}
UBSAN_OPTIONS: "print_stacktrace=1:halt_on_error=1:suppressions=${{ env.REPO_HOME }}/build-scripts/UBSan.supp"
UNIT_TESTS: yes
defaults:
run:
working-directory: ./pdns/dnsdistdist/
outputs:
clang-tidy-failed: ${{ steps.clang-tidy-annotations.outputs.failed }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 5
submodules: recursive
- name: get timestamp for cache
id: get-stamp
run: |
echo "stamp=$(/bin/date +%s)" >> "$GITHUB_OUTPUT"
shell: bash
- run: mkdir -p ~/.ccache
- name: let GitHub cache our ccache data
uses: actions/cache@v3
with:
path: ~/.ccache
key: dnsdist-${{ matrix.features }}-${{ matrix.sanitizers }}-ccache-${{ steps.get-stamp.outputs.stamp }}
restore-keys: dnsdist-${{ matrix.features }}-${{ matrix.sanitizers }}-ccache-
- run: inv ci-autoconf
- run: inv ci-dnsdist-configure ${{ matrix.features }}
- run: inv ci-dnsdist-make-bear
- run: ln -s ../../.clang-tidy.full .clang-tidy
- name: Run clang-tidy
run: git diff -U0 HEAD^..HEAD | python3 ../../.github/scripts/git-filter.py | python3 /usr/bin/clang-tidy-diff-${CLANG_VERSION}.py -clang-tidy-binary /usr/bin/clang-tidy-${CLANG_VERSION} -extra-arg=-ferror-limit=0 -p3 -export-fixes clang-tidy-dnsdist.yml
- name: Print clang-tidy fixes YAML
shell: bash
run: |
if [ -f clang-tidy-dnsdist.yml ]; then
cat clang-tidy-dnsdist.yml
fi
- name: Result annotations
id: clang-tidy-annotations
shell: bash
run: |
if [ -f clang-tidy-dnsdist.yml ]; then
set +e
python ../../.github/scripts/clang-tidy.py --fixes-file clang-tidy-dnsdist.yml
echo "failed=$?" >> $GITHUB_OUTPUT
fi
- run: inv ci-dnsdist-run-unit-tests
- run: inv ci-make-install
- run: ccache -s
- name: Store the binaries
uses: actions/upload-artifact@v3 # this takes 30 seconds, maybe we want to tar
with:
name: dnsdist-${{ matrix.features }}-${{ matrix.sanitizers }}
path: /opt/dnsdist
retention-days: 1
test-auth-api:
needs: build-auth
runs-on: ubuntu-20.04
container:
image: ghcr.io/powerdns/base-pdns-ci-image/debian-11-pdns-base:master
env:
UBSAN_OPTIONS: "print_stacktrace=1:halt_on_error=1:suppressions=${{ env.REPO_HOME }}/build-scripts/UBSan.supp"
ASAN_OPTIONS: detect_leaks=0
TSAN_OPTIONS: "halt_on_error=1:suppressions=${{ env.REPO_HOME }}/pdns/dnsdistdist/dnsdist-tsan.supp"
AUTH_BACKEND_IP_ADDR: "172.17.0.1"
strategy:
matrix:
include:
- backend: gsqlite3
image: coscale/docker-sleep
- backend: gmysql
image: mysql:5
- backend: gpgsql
image: postgres:9
- backend: lmdb
image: coscale/docker-sleep
fail-fast: false
services:
database:
image: ${{ matrix.image }}
env:
POSTGRES_USER: runner
POSTGRES_HOST_AUTH_METHOD: trust
MYSQL_ALLOW_EMPTY_PASSWORD: 1
ports:
- 3306:3306
- 5432:5432
# FIXME: this works around dist-upgrade stopping all docker containers. dist-upgrade is huge on these images anyway. Perhaps we do want to run our tasks in a Docker container too.
options: >-
--restart always
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 5
submodules: recursive
- name: Fetch the binaries
uses: actions/download-artifact@v3
with:
name: pdns-auth
path: /opt/pdns-auth
- run: inv apt-fresh
- run: inv install-clang-runtime
- run: inv install-auth-test-deps -b ${{ matrix.backend }}
- run: inv test-api auth -b ${{ matrix.backend }}
test-auth-backend:
needs: build-auth
runs-on: ubuntu-20.04
container:
image: ghcr.io/powerdns/base-pdns-ci-image/debian-11-pdns-base:master
env:
UBSAN_OPTIONS: "print_stacktrace=1:halt_on_error=1:suppressions=${{ env.REPO_HOME }}/build-scripts/UBSan.supp"
ASAN_OPTIONS: detect_leaks=0
LDAPHOST: ldap://ldapserver/
ODBCINI: /github/home/.odbc.ini
AUTH_BACKEND_IP_ADDR: "172.17.0.1"
SKIP_IPV6_TESTS: yes
strategy:
matrix:
include:
- backend: remote
image: coscale/docker-sleep
env: {}
ports: []
- backend: gmysql
image: mysql:5
env:
MYSQL_ALLOW_EMPTY_PASSWORD: 1
ports:
- 3306:3306
- backend: gmysql
image: mariadb:10
env:
MYSQL_ALLOW_EMPTY_PASSWORD: 1
ports:
- 3306:3306
- backend: gpgsql
image: postgres:9
env:
POSTGRES_USER: runner
POSTGRES_HOST_AUTH_METHOD: trust
ports:
- 5432:5432
- backend: gsqlite3 # this also runs regression-tests.nobackend and pdnsutil test-algorithms
image: coscale/docker-sleep
env: {}
ports: []
- backend: lmdb
image: coscale/docker-sleep
env: {}
ports: []
- backend: bind
image: coscale/docker-sleep
env: {}
ports: []
- backend: geoip
image: coscale/docker-sleep
env: {}
ports: []
- backend: lua2
image: coscale/docker-sleep
env: {}
ports: []
- backend: tinydns
image: coscale/docker-sleep
env: {}
ports: []
- backend: authpy
image: coscale/docker-sleep
env: {}
ports: []
- backend: godbc_sqlite3
image: coscale/docker-sleep
env: {}
ports: []
- backend: godbc_mssql
image: mcr.microsoft.com/mssql/server:2017-GA-ubuntu
env:
ACCEPT_EULA: Y
SA_PASSWORD: 'SAsa12%%'
ports:
- 1433:1433
- backend: ldap
image: powerdns/ldap-regress:1.2.4-1
env:
LDAP_LOG_LEVEL: 0
CONTAINER_LOG_LEVEL: 4
ports:
- 389:389
- backend: geoip_mmdb
image: coscale/docker-sleep
env: {}
ports: []
fail-fast: false
services:
database:
image: ${{ matrix.image }}
env: ${{ matrix.env }}
ports: ${{ matrix.ports }}
# FIXME: this works around dist-upgrade stopping all docker containers. dist-upgrade is huge on these images anyway. Perhaps we do want to run our tasks in a Docker container too.
options: >-
--restart always
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 5
submodules: recursive
- name: Fetch the binaries
uses: actions/download-artifact@v3
with:
name: pdns-auth
path: /opt/pdns-auth
# FIXME: install recursor for backends that have ALIAS
- run: inv install-clang-runtime
- run: inv install-auth-test-deps -b ${{ matrix.backend }}
- run: inv test-auth-backend -b ${{ matrix.backend }}
test-ixfrdist:
needs: build-auth
runs-on: ubuntu-20.04
container:
image: ghcr.io/powerdns/base-pdns-ci-image/debian-11-pdns-base:master
env:
UBSAN_OPTIONS: "print_stacktrace=1:halt_on_error=1:suppressions=${{ env.REPO_HOME }}/build-scripts/UBSan.supp"
ASAN_OPTIONS: detect_leaks=0
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 5
submodules: recursive
- name: Fetch the binaries
uses: actions/download-artifact@v3
with:
name: pdns-auth
path: /opt/pdns-auth
- run: inv install-clang-runtime
- run: inv install-auth-test-deps
- run: inv test-ixfrdist
test-recursor-api:
needs: build-recursor
runs-on: ubuntu-20.04
strategy:
matrix:
sanitizers: [ubsan+asan, tsan]
dist_name: [debian]
dist_release_name: [bullseye]
pdns_repo_version: ['45']
container:
image: ghcr.io/powerdns/base-pdns-ci-image/debian-11-pdns-base:master
env:
UBSAN_OPTIONS: "print_stacktrace=1:halt_on_error=1:suppressions=${{ env.REPO_HOME }}/build-scripts/UBSan.supp"
ASAN_OPTIONS: detect_leaks=0
TSAN_OPTIONS: "halt_on_error=1:suppressions=${{ env.REPO_HOME }}/pdns/recursordist/recursor-tsan.supp"
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 5
submodules: recursive
- name: Fetch the binaries
uses: actions/download-artifact@v3
with:
name: pdns-recursor-${{ matrix.sanitizers }}
path: /opt/pdns-recursor
- run: inv apt-fresh
- run: inv add-auth-repo ${{ matrix.dist_name }} ${{ matrix.dist_release_name }} ${{ matrix.pdns_repo_version }}
- run: inv install-clang-runtime
- run: inv install-rec-test-deps
- run: inv test-api recursor
test-recursor-regression:
needs: build-recursor
runs-on: ubuntu-20.04
strategy:
matrix:
sanitizers: [ubsan+asan, tsan]
dist_name: [debian]
dist_release_name: [bullseye]
pdns_repo_version: ['45']
container:
image: ghcr.io/powerdns/base-pdns-ci-image/debian-11-pdns-base:master
env:
UBSAN_OPTIONS: 'print_stacktrace=1:halt_on_error=1:suppressions=${{ env.REPO_HOME }}/build-scripts/UBSan.supp'
ASAN_OPTIONS: detect_leaks=0
TSAN_OPTIONS: "halt_on_error=1:suppressions=${{ env.REPO_HOME }}/pdns/recursordist/recursor-tsan.supp"
SKIP_IPV6_TESTS: yes
steps:
# - uses: PowerDNS/pdns/set-ubuntu-mirror@meta
- uses: actions/[email protected]
with:
fetch-depth: 5
submodules: recursive
- name: Fetch the binaries
uses: actions/download-artifact@v3
with:
name: pdns-recursor-${{ matrix.sanitizers }}
path: /opt/pdns-recursor
- run: inv apt-fresh
- run: inv add-auth-repo ${{ matrix.dist_name }} ${{ matrix.dist_release_name }} ${{ matrix.pdns_repo_version }}
- run: inv install-clang-runtime
- run: inv install-rec-test-deps
- run: inv test-regression-recursor
test-recursor-bulk:
name: 'test rec *mini* bulk'
needs: build-recursor
runs-on: ubuntu-20.04
strategy:
matrix:
sanitizers: [ubsan+asan, tsan]
threads: [1, 2, 3, 4, 8]
mthreads: [2048]
shards: [1, 2, 1024]
container:
image: ghcr.io/powerdns/base-pdns-ci-image/debian-11-pdns-base:master
env:
UBSAN_OPTIONS: 'print_stacktrace=1:halt_on_error=1:suppressions=${{ env.REPO_HOME }}/build-scripts/UBSan.supp'
ASAN_OPTIONS: detect_leaks=0
TSAN_OPTIONS: "halt_on_error=1:suppressions=${{ env.REPO_HOME }}/pdns/recursordist/recursor-tsan.supp"
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 5
submodules: recursive
- name: Fetch the binaries
uses: actions/download-artifact@v3
with:
name: pdns-recursor-${{ matrix.sanitizers }}
path: /opt/pdns-recursor
- run: inv install-clang-runtime
- run: inv install-rec-bulk-deps
- run: inv test-bulk-recursor ${{ matrix.threads }} ${{ matrix.mthreads }} ${{ matrix.shards }}
test-dnsdist-regression:
needs: build-dnsdist
runs-on: ubuntu-20.04
strategy:
matrix:
sanitizers: [ubsan+asan, tsan]
container:
image: ghcr.io/powerdns/base-pdns-ci-image/debian-11-pdns-base:master
env:
UBSAN_OPTIONS: "print_stacktrace=1:halt_on_error=1:suppressions=${{ env.REPO_HOME }}/build-scripts/UBSan.supp"
# Disabling (intercept_send=0) the custom send wrappers for ASAN and TSAN because they cause the tools to report a race that doesn't exist on actual implementations of send(), see https://github.com/google/sanitizers/issues/1498
ASAN_OPTIONS: detect_leaks=0:intercept_send=0
TSAN_OPTIONS: "halt_on_error=1:intercept_send=0:suppressions=${{ env.REPO_HOME }}/pdns/dnsdistdist/dnsdist-tsan.supp"
# IncludeDir tests are disabled because of a weird interaction between TSAN and these tests which ever only happens on GH actions
SKIP_INCLUDEDIR_TESTS: yes
SKIP_IPV6_TESTS: yes
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 5
submodules: recursive
- name: Fetch the binaries
uses: actions/download-artifact@v3
with:
name: dnsdist-full-${{ matrix.sanitizers }}
path: /opt/dnsdist
- run: inv install-clang-runtime
- run: inv install-dnsdist-test-deps
- run: inv test-dnsdist
swagger-syntax-check:
if: ${{ !github.event.schedule || vars.SCHEDULED_JOBS_BUILD_AND_TEST_ALL }}
runs-on: ubuntu-20.04
container:
image: ghcr.io/powerdns/base-pdns-ci-image/debian-11-pdns-base:master
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 5
submodules: recursive
- run: inv install-swagger-tools
- run: inv swagger-syntax-check
check-clang-tidy:
needs: [build-auth, build-dnsdist, build-recursor]
runs-on: ubuntu-20.04
name: Check whether clang-tidy succeeded
steps:
- run: |
if [ "x${{ needs.build-auth.outputs.clang-tidy-failed }}" != "x" -a "${{ needs.build-auth.outputs.clang-tidy-failed }}" != "0" ]; then
exit 1
fi
if [ "x${{ needs.build-dnsdist.outputs.clang-tidy-failed }}" != "x" -a "${{ needs.build-dnsdist.outputs.clang-tidy-failed }}" != "0" ]; then
exit 1
fi
if [ "x${{needs.build-recursor.outputs.clang-tidy-failed}}" != "x" -a "${{needs.build-recursor.outputs.clang-tidy-failed}}" != "0" ]; then
exit 1
fi
collect:
needs:
- build-auth
- build-dnsdist
- build-recursor
- swagger-syntax-check
- test-auth-api
- test-auth-backend
- test-dnsdist-regression
- test-ixfrdist
- test-recursor-api
- test-recursor-regression
- test-recursor-bulk
- check-clang-tidy
if: success() || failure()
runs-on: ubuntu-20.04
steps:
- name: Install jq and yq
run: "sudo snap install jq yq"
- name: Fail job if any of the previous jobs failed
run: "for i in `echo '${{ toJSON(needs) }}' | jq '.[].result' | tr -d '\"'`; do if [[ $i == 'failure' ]]; then echo '${{ toJSON(needs) }}'; exit 1; fi; done;"
- uses: actions/checkout@v3
with:
fetch-depth: 5
submodules: recursive
- name: Get list of jobs in the workflow
run: "yq e '.jobs | keys' .github/workflows/build-and-test-all.yml | awk '{print $2}' | grep -v collect | sort | tee /tmp/workflow-jobs-list.yml"
- name: Get list of prerequisite jobs
run: "echo '${{ toJSON(needs) }}' | jq 'keys | .[]' | tr -d '\"' | sort | tee /tmp/workflow-needs-list.yml"
- name: Fail if there is a job missing on the needs list
run: "if ! diff -q /tmp/workflow-jobs-list.yml /tmp/workflow-needs-list.yml; then exit 1; fi"
# FIXME: if we can make upload/download-artifact fasts, running unit tests outside of build can let regression tests start earlier