.gitlab-ci.yml 39.2 KB
Newer Older
1
variables:
Michał Kępień's avatar
Michał Kępień committed
2
  # Not normally needed, but may be if some script uses `apt-get install`.
3
  DEBIAN_FRONTEND: noninteractive
Michał Kępień's avatar
Michał Kępień committed
4
  # Locale settings do not affect the build, but might affect tests.
5
  LC_ALL: C
Michał Kępień's avatar
Michał Kępień committed
6

7
  CI_REGISTRY_IMAGE: registry.gitlab.isc.org/isc-projects/images/bind9
8
  CCACHE_DIR: "/ccache"
9
  SOFTHSM2_CONF: "/var/tmp/softhsm2/softhsm2.conf"
10

Michał Kępień's avatar
Michał Kępień committed
11
  GIT_DEPTH: 1
12
13
14
  BUILD_PARALLEL_JOBS: 6
  TEST_PARALLEL_JOBS: 6

15
  CONFIGURE: ./configure
16
17
18
19
  CLANG: clang-11
  SCAN_BUILD: scan-build-11
  ASAN_SYMBOLIZER_PATH: /usr/lib/llvm-11/bin/llvm-symbolizer
  CLANG_FORMAT: clang-format-11
Ondřej Surý's avatar
Ondřej Surý committed
20

Ondřej Surý's avatar
Ondřej Surý committed
21
22
  CFLAGS_COMMON: -fno-omit-frame-pointer -fno-optimize-sibling-calls -O1 -g -Wall -Wextra 

23
24
  # Pass run-time flags to AddressSanitizer to get core dumps on error.
  ASAN_OPTIONS_COMMON: abort_on_error=1:disable_coredump=0:unmap_shadow_on_exit=1
25
  TSAN_OPTIONS_COMMON: "disable_coredump=0 second_deadlock_stack=1 history_size=7 log_exe_name=true log_path=tsan external_symbolizer_path=/usr/lib/llvm-11/bin/llvm-symbolizer"
26

27
28
  TARBALL_EXTENSION: xz

29
30
  AM_COLOR_TESTS: always

31
32
33
34
35
36
  WITHOUT_READLINE: "--without-readline"
  WITH_READLINE: "--with-readline"
  WITH_READLINE_EDITLINE: "--with-readline=editline"
  WITH_READLINE_LIBEDIT: "--with-readline=libedit"
  WITH_READLINE_READLINE: "--with-readline=readline"

37
  INSTALL_PATH: "${CI_PROJECT_DIR}/.local"
Michal Nowak's avatar
Michal Nowak committed
38

Ondřej Surý's avatar
Ondřej Surý committed
39
40
41
  # In multithreaded unit tests, abort on the first failure
  CMOCKA_TEST_ABORT: 1

42
43
44
45
  # Default platforms to run "stress" tests on
  BIND_STRESS_TEST_OS: linux
  BIND_STRESS_TEST_ARCH: amd64

46
stages:
47
  - autoconf
48
  - precheck
49
  - build
50
  - unit
Ondřej Surý's avatar
Ondřej Surý committed
51
  - system
Michal Nowak's avatar
Michal Nowak committed
52
  - performance
53
  - docs
54
  - push
Ondřej Surý's avatar
Ondřej Surý committed
55
  - postcheck
56
  - release
57

Michał Kępień's avatar
Michał Kępień committed
58
59
### Runner Tag Templates

60
.libvirt-amd64: &libvirt_amd64
Michał Kępień's avatar
Michał Kępień committed
61
  tags:
62
    - libvirt
Michał Kępień's avatar
Michał Kępień committed
63
64
    - amd64

65
.linux-amd64: &linux_amd64
Michał Kępień's avatar
Michał Kępień committed
66
67
68
69
  tags:
    - linux
    - amd64

Michal Nowak's avatar
Michal Nowak committed
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
.linux-stress-amd64: &linux_stress_amd64
  tags:
    - amd64
    - aws
    - linux-stress
    - stress

.linux-stress-arm64: &linux_stress_arm64
  tags:
    - aarch64
    - aws
    - linux-stress
    - stress

.freebsd-stress-amd64: &freebsd_stress_amd64
  tags:
    - amd64
    - aws
    - bsd-stress
    - stress

91
92
93
94
95
.windows-amd64: &windows_amd64
  tags:
    - windows
    - amd64

Michał Kępień's avatar
Michał Kępień committed
96
97
### Docker Image Templates

98
99
# Alpine Linux

Michal Nowak's avatar
Michal Nowak committed
100
101
.alpine-3.13-amd64: &alpine_3_13_amd64_image
  image: "$CI_REGISTRY_IMAGE:alpine-3.13-amd64"
102
103
  <<: *linux_amd64

Michał Kępień's avatar
Michał Kępień committed
104
105
# CentOS

106
107
108
.centos-centos7-amd64: &centos_centos7_amd64_image
  image: "$CI_REGISTRY_IMAGE:centos-centos7-amd64"
  <<: *linux_amd64
Michał Kępień's avatar
Michał Kępień committed
109

Michał Kępień's avatar
Michał Kępień committed
110
111
112
113
.centos-centos8-amd64: &centos_centos8_amd64_image
  image: "$CI_REGISTRY_IMAGE:centos-centos8-amd64"
  <<: *linux_amd64

Michał Kępień's avatar
Michał Kępień committed
114
115
# Debian

Ondřej Surý's avatar
Ondřej Surý committed
116
117
.debian-stretch-amd64: &debian_stretch_amd64_image
  image: "$CI_REGISTRY_IMAGE:debian-stretch-amd64"
118
  <<: *linux_amd64
119

Michał Kępień's avatar
Michał Kępień committed
120
121
.debian-buster-amd64: &debian_buster_amd64_image
  image: "$CI_REGISTRY_IMAGE:debian-buster-amd64"
122
  <<: *linux_amd64
Michał Kępień's avatar
Michał Kępień committed
123

Ondřej Surý's avatar
Ondřej Surý committed
124
125
.debian-sid-amd64: &debian_sid_amd64_image
  image: "$CI_REGISTRY_IMAGE:debian-sid-amd64"
126
  <<: *linux_amd64
127

128
129
130
131
132
133
# openSUSE Tumbleweed

.tumbleweed-latest-amd64: &tumbleweed_latest_amd64_image
  image: "$CI_REGISTRY_IMAGE:tumbleweed-latest-amd64"
  <<: *linux_amd64

Michał Kępień's avatar
Michał Kępień committed
134
135
# Fedora

Michal Nowak's avatar
Michal Nowak committed
136
137
.fedora-33-amd64: &fedora_33_amd64_image
  image: "$CI_REGISTRY_IMAGE:fedora-33-amd64"
Michał Kępień's avatar
Michał Kępień committed
138
139
  <<: *linux_amd64

Michal Nowak's avatar
Michal Nowak committed
140
141
.fedora-33-arm64: &fedora_33_arm64_image
  image: "$CI_REGISTRY_IMAGE:fedora-33-arm64"
Michal Nowak's avatar
Michal Nowak committed
142
143
  <<: *linux_stress_arm64

Michał Kępień's avatar
Michał Kępień committed
144
145
# Ubuntu

146
147
148
149
.ubuntu-focal-amd64: &ubuntu_focal_amd64_image
  image: "$CI_REGISTRY_IMAGE:ubuntu-focal-amd64"
  <<: *linux_amd64

150
151
152
153
154
155
# Windows

.windows-server-2016-amd64: &windows_server_2016_amd64_image
  image: "$CI_REGISTRY_IMAGE:windows-server-2016-amd64"
  <<: *windows_amd64

156
157
158
159
160
161
# Base image
# This is a meta image that is used as a base for non-specific jobs

.base: &base_image
  <<: *debian_buster_amd64_image

162
163
164
165
166
167
168
### QCOW2 Image Templates

.freebsd-11-amd64: &freebsd_11_amd64_image
  image: "freebsd-11.4-x86_64"
  <<: *libvirt_amd64

.freebsd-12-amd64: &freebsd_12_amd64_image
Michal Nowak's avatar
Michal Nowak committed
169
  image: "freebsd-12.2-x86_64"
170
171
172
  <<: *libvirt_amd64

.openbsd-amd64: &openbsd_amd64_image
Michal Nowak's avatar
Michal Nowak committed
173
  image: "openbsd-6.8-x86_64"
174
175
  <<: *libvirt_amd64

Michał Kępień's avatar
Michał Kępień committed
176
177
### Job Templates

178
179
180
181
182
.default-triggering-rules: &default_triggering_rules
  only:
    - merge_requests
    - tags
    - web
183
    - schedules
184

185
186
187
188
189
.release-branch-triggering-rules: &release_branch_triggering_rules
  only:
    - merge_requests
    - tags
    - web
190
    - schedules
191
    - main@isc-projects/bind9
192
193
    - /^v9_[1-9][0-9]$/@isc-projects/bind9

194
.precheck: &precheck_job
195
  <<: *default_triggering_rules
196
  <<: *base_image
197
198
  stage: precheck

199
.autoconf: &autoconf_job
200
  <<: *release_branch_triggering_rules
201
  <<: *base_image
202
  stage: autoconf
203
204
205
  script:
    - autoreconf -fi
  artifacts:
206
    untracked: true
207
    expire_in: "1 day"
208

209
.configure: &configure |
210
    ${CONFIGURE} \
211
212
    --disable-maintainer-mode \
    --enable-developer \
213
    --enable-option-checking=fatal \
214
215
216
217
    --with-cmocka \
    --with-libxml2 \
    --with-json-c \
    $EXTRA_CONFIGURE \
218
    || (test -s config.log && cat config.log; exit 1)
219

220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
.check_readline_setup: &check_readline_setup |
    if [[ -n "${WITHOUT_READLINE}" ]]; then \
      ! grep "^#define HAVE_READLINE" config.h; \
    elif [[ -n "${WITH_READLINE}" ]]; then \
      grep -e "^#define HAVE_READLINE_READLINE" \
           -e "^#define HAVE_READLINE_LIBEDIT" \
           -e "^#define HAVE_READLINE_EDITLINE" config.h; \
    elif [[ -n "${WITH_READLINE_EDITLINE}" ]]; then \
      grep "^#define HAVE_READLINE_EDITLINE" config.h; \
    elif [[ -n "${WITH_READLINE_LIBEDIT}" ]]; then \
      grep "^#define HAVE_READLINE_LIBEDIT" config.h; \
    elif [[ -n "${WITH_READLINE_READLINE}" ]]; then \
      grep "^#define HAVE_READLINE_READLINE" config.h; \
    fi

235
.build: &build_job
236
  <<: *default_triggering_rules
237
  stage: build
238
  before_script:
239
    - test -w "${CCACHE_DIR}" && export PATH="/usr/lib/ccache:${PATH}"
240
    - test -n "${OUT_OF_TREE_WORKSPACE}" && mkdir "${OUT_OF_TREE_WORKSPACE}" && cd "${OUT_OF_TREE_WORKSPACE}"
241
  script:
242
    - *configure
243
    - *check_readline_setup
244
    - make -j${BUILD_PARALLEL_JOBS:-1} -k all V=1
245
246
247
    - test -z "${RUN_MAKE_INSTALL}" || make DESTDIR="${INSTALL_PATH}" install
    - test -z "${RUN_MAKE_INSTALL}" || DESTDIR="${INSTALL_PATH}" sh util/check-make-install
    - test -z "${RUN_MAKE_INSTALL}" || ls -l "${INSTALL_PATH}"/usr/local/{share/man/man8/named.8,sbin/named}
248
    - if [[ "${CFLAGS}" == *"-fsanitize=address"* ]]; then ( ! grep -F AddressSanitizer config.log ); fi
249
250
251
    - if test -z "${OUT_OF_TREE_WORKSPACE}" && test "$(git status --porcelain | grep -Ev '\?\?' | wc -l)" -gt "0"; then git status --short; exit 1; fi
  after_script:
    - test -n "${OUT_OF_TREE_WORKSPACE}" && mv "${OUT_OF_TREE_WORKSPACE}" "${CI_PROJECT_DIR}"
252
  needs:
253
    - job: autoreconf
254
      artifacts: true
255
256
  artifacts:
    untracked: true
257
    expire_in: "1 day"
258

259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
.windows_build: &windows_build_job
  stage: build
  script:
    - 'Push-Location "C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Auxiliary/Build"'
    - '& cmd.exe /C "vcvarsall.bat x64 & set" | Foreach-Object { if ($_ -match "(.*?)=(.*)") { Set-Item -force -path "Env:\$($matches[1])" -value "$($matches[2])" } }'
    - 'Pop-Location'
    - 'Set-Location win32utils'
    - '& "C:/Strawberry/perl/bin/perl.exe" Configure
         "with-tools-version=15.0"
         "with-platform-toolset=v141"
         "with-platform-version=10.0.17763.0"
         "with-vcredist=C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Redist/MSVC/14.16.27012/vcredist_x64.exe"
         "with-openssl=C:/OpenSSL"
         "with-libxml2=C:/libxml2"
         "with-libuv=C:/libuv"
274
         "with-nghttp2=C:/nghttp2"
275
276
277
278
279
         "without-python"
         "with-system-tests"
         x64'
    - 'Set-Item -path "Env:CL" -value "/MP$([Math]::Truncate($BUILD_PARALLEL_JOBS/2))"'
    - '& msbuild.exe /maxCpuCount:2 /t:Build /p:Configuration=$VSCONF bind9.sln'
280
  needs: []
281
282
  artifacts:
    untracked: true
283
    expire_in: "1 day"
284
    when: always
285

286
287
.setup_interfaces: &setup_interfaces |
    if [ "$(id -u)" -eq "0" ]; then
288
      sh -x bin/tests/system/ifconfig.sh up;
289
    else
290
      sudo sh -x bin/tests/system/ifconfig.sh up;
291
292
293
    fi

.setup_softhsm: &setup_softhsm |
Michal Nowak's avatar
Michal Nowak committed
294
295
    export SLOT=$(sh -x bin/tests/prepare-softhsm2.sh)
    test -n "${SLOT}" && test "${SLOT}" -gt 0
296

297
.system_test_common: &system_test_common
298
  <<: *default_triggering_rules
299
  stage: system
300
  before_script:
301
    - *setup_softhsm
302
303
304
305
306
    # Move the artifacts from the out-of-tree build job to their original location (the out-of-tree workspace).
    - test -n "${OUT_OF_TREE_WORKSPACE}" && mv "$(basename "${OUT_OF_TREE_WORKSPACE}")" "${OUT_OF_TREE_WORKSPACE}"
    # Continue work in the out-of-tree workspace.
    - test -n "${OUT_OF_TREE_WORKSPACE}" && cd "${OUT_OF_TREE_WORKSPACE}"
    - *setup_interfaces
307
  script:
308
    - cd bin/tests/system
309
    - make -j${TEST_PARALLEL_JOBS:-1} -k check V=1
310
    - if git rev-parse > /dev/null 2>&1; then ( ! grep "^I:.*:file.*not removed$" *.log ); fi
311
  after_script:
312
    - test -n "${OUT_OF_TREE_WORKSPACE}" && cd "${OUT_OF_TREE_WORKSPACE}"
313
    - test -d bind-* && cd bind-*
314
    - cat bin/tests/system/test-suite.log
315
    - test -n "${OUT_OF_TREE_WORKSPACE}" && mv "${OUT_OF_TREE_WORKSPACE}" "${CI_PROJECT_DIR}"
316
317
318

.system_test: &system_test_job
  <<: *system_test_common
319
320
  artifacts:
    untracked: true
321
    expire_in: "1 day"
322
323
    when: on_failure

324
325
326
327
328
329
330
.system_test_gcov: &system_test_gcov_job
  <<: *system_test_common
  artifacts:
    untracked: true
    expire_in: "1 day"
    when: always

331
332
333
.system_test_tsan: &system_test_tsan_job
  <<: *system_test_common
  after_script:
334
    - cat bin/tests/system/test-suite.log
335
336
337
    - find bin -name 'tsan.*' -exec python3 util/parse_tsan.py {} \;
  artifacts:
    expire_in: "1 day"
Mark Andrews's avatar
Mark Andrews committed
338
    untracked: true
339
340
    when: on_failure

341
342
343
344
345
346
347
348
349
350
351
352
353
354
.windows_system_test: &windows_system_test_job
  stage: system
  script:
    - 'Push-Location bin/tests/system'
    - '$ifIndex = Get-NetIPInterface -AddressFamily IPv4 -InterfaceMetric 75 | Select-Object -ExpandProperty ifIndex'
    - '& C:/tools/cygwin/bin/sed.exe -i "s/^exit.*/netsh interface ipv4 set dnsservers $ifIndex dhcp/; s/\(name\|interface\)=Loopback/$ifIndex/;" ifconfig.bat'
    - '& C:/tools/cygwin/bin/sed.exe -i "s/kill -f/kill -W/;" conf.sh stop.pl'
    - '& cmd.exe /C ifconfig.bat up; ""'
    - 'Start-Sleep 2'
    - '$Env:Path = "C:/tools/cygwin/bin;$Env:Path"'
    - '& sh.exe runall.sh $TEST_PARALLEL_JOBS'
    - 'If (Test-Path C:/CrashDumps/*) { dir C:/CrashDumps; Throw }'
  artifacts:
    untracked: true
355
    expire_in: "1 day"
356
357
358
359
360
361
    when: on_failure
  only:
    - schedules
    - tags
    - web

362
.unit_test_common: &unit_test_common
363
  <<: *default_triggering_rules
364
  stage: unit
365
  before_script:
366
    - if [ -n "$TCP_CONNECTIONTIMEOUT" ]; then sudo sysctl 'net.inet.tcp.keepinittime=1'; fi
367
    - *setup_softhsm
368
  script:
369
    - make -j${TEST_PARALLEL_JOBS:-1} -k unit V=1
370
371
372

.unit_test: &unit_test_job
  <<: *unit_test_common
373
  artifacts:
Michal Nowak's avatar
Michal Nowak committed
374
    untracked: true
375
    expire_in: "1 day"
376
    when: on_failure
377

378
379
380
381
382
383
384
.unit_test_gcov: &unit_test_gcov_job
  <<: *unit_test_common
  artifacts:
    untracked: true
    expire_in: "1 day"
    when: always

385
386
387
388
389
390
391
392
393
394
395
.unit_test_tsan: &unit_test_tsan_job
  <<: *unit_test_common
  after_script:
    - find lib -name 'tsan.*' -exec python3 util/parse_tsan.py {} \;
  artifacts:
    expire_in: "1 day"
    paths:
      - lib/*/tests/tsan.*
      - tsan/
    when: on_failure

Ondřej Surý's avatar
Ondřej Surý committed
396
.cppcheck_args: &run_cppcheck |
397
  cppcheck --enable=warning,performance,portability,information,missingInclude --include=config.h --std=c11 --language=c --project=compile_commands.json --error-exitcode=2 -j ${TEST_PARALLEL_JOBS:-1} --xml --output-file=cppcheck.results --relative-paths="$CI_PROJECT_DIR" --inline-suppr --suppressions-list=util/suppressions.txt
Ondřej Surý's avatar
Ondřej Surý committed
398
399

.cppcheck_report: &cppcheck_report_html |
400
  cppcheck-htmlreport --title="BIND 9 ($CI_COMMIT_SHORT_SHA) Cppcheck Report" --file=cppcheck.results --report-dir=cppcheck_html/
Ondřej Surý's avatar
Ondřej Surý committed
401
402
403
404

.cppcheck: &cppcheck_job
  <<: *default_triggering_rules
  stage: postcheck
405
406
407
  script:
    - *configure
    - (make -nwk all || true) | compiledb
408
    - export GCC_VERSION=$(gcc --version | sed -n 's/.* \([0-9]\+\)\.[0-9]\+\.[0-9]\+.*/\1/p')
Michał Kępień's avatar
Michał Kępień committed
409
    - sed -i "/gcc\",/a\"-DCPPCHECK\", \"-D__STDC__\", \"-D__GNUC__=${GCC_VERSION}\"," compile_commands.json
Ondřej Surý's avatar
Ondřej Surý committed
410
    - *run_cppcheck
411
  after_script:
Ondřej Surý's avatar
Ondřej Surý committed
412
413
414
415
416
417
    - *cppcheck_report_html
  artifacts:
    paths:
      - compile_commands.json
      - cppcheck.results
      - cppcheck_html/
418
    expire_in: "1 day"
Ondřej Surý's avatar
Ondřej Surý committed
419
    when: on_failure
420
421
422
  needs:
    - job: autoreconf
      artifacts: true
Ondřej Surý's avatar
Ondřej Surý committed
423

Michał Kępień's avatar
Michał Kępień committed
424
425
426
427
### Job Definitions

# Jobs in the precheck stage

428
autoreconf:
429
430
  <<: *autoconf_job

431
misc:
432
  <<: *precheck_job
433
  script:
Evan Hunt's avatar
Evan Hunt committed
434
    - sh util/checklibs.sh > checklibs.out
Mark Andrews's avatar
Mark Andrews committed
435
436
    - sh util/tabify-changes < CHANGES > CHANGES.tmp
    - diff -urNap CHANGES CHANGES.tmp
437
    - perl util/check-changes CHANGES
438
    - sh util/check-line-length.sh CHANGES
439
440
441
    - test ! -f CHANGES.SE || sh util/tabify-changes < CHANGES.SE > CHANGES.tmp
    - test ! -f CHANGES.SE || diff -urNap CHANGES.SE CHANGES.tmp
    - test ! -f CHANGES.SE || perl util/check-changes master=0 CHANGES.SE
442
    - test ! -f CHANGES.SE || sh util/check-line-length.sh CHANGES.SE
443
    - rm CHANGES.tmp
444
445
446
    - perl -w util/merge_copyrights
    - diff -urNap util/copyrights util/newcopyrights
    - rm util/newcopyrights
447
448
    - perl -w util/update_copyrights < util/copyrights
    - if test "$(git status --porcelain | grep -Ev '\?\?' | wc -l)" -gt "0"; then git status --short; exit 1; fi
449
    - xmllint --noout --nonet `git ls-files '*.xml' '*.docbook'`
450
    - sh util/check-win32util-configure
451
    - sh util/check-categories.sh
452
    - if git grep SYSTEMTESTTOP -- ':!.gitlab-ci.yml'; then echo 'Please use relative paths instead of $SYSTEMTESTTOP.'; exit 1; fi
Michal Nowak's avatar
Michal Nowak committed
453
    - bash util/unused-headers.sh
454
  needs: []
455
456
  artifacts:
    paths:
457
458
      - util/newcopyrights
      - checklibs.out
459
    expire_in: "1 day"
460
461
    when: on_failure

462
clang-format:
463
  <<: *precheck_job
464
  needs: []
465
  script:
466
    - if [ -r .clang-format ]; then "${CLANG_FORMAT}" -i -style=file $(git ls-files '*.c' '*.h'); fi
467
468
    - if test "$(git status --porcelain | grep -Ev '\?\?' | wc -l)" -gt "0"; then git status --short; exit 1; fi

469
coccinelle:
470
  <<: *precheck_job
471
  needs: []
472
473
474
  script:
    - util/check-cocci
    - if test "$(git status --porcelain | grep -Ev '\?\?' | wc -l)" -gt "0"; then git status --short; exit 1; fi
475

476
477
478
479
480
481
danger:
  <<: *precheck_job
  needs: []
  script:
    - danger-python ci -f
  only:
482
483
484
485
    refs:
      - merge_requests
    variables:
      - $DANGER_GITLAB_API_TOKEN
486

487
488
489
490
491
492
493
494
495
flake8:
  <<: *default_triggering_rules
  <<: *base_image
  stage: postcheck
  needs:
    - job: autoreconf
      artifacts: true
  script:
    - *configure
496
    - flake8 --max-line-length=80 $(git ls-files '*.py' | grep -vE '(ans\.py|dangerfile\.py)')
497
498
499
500
501
502
503
504
505
506

pylint:
  <<: *default_triggering_rules
  <<: *base_image
  stage: postcheck
  needs:
    - job: autoreconf
      artifacts: true
  script:
    - *configure
507
    - PYTHONPATH="$PYTHONPATH:$CI_PROJECT_DIR/bin/python"
508
    - pylint --rcfile $CI_PROJECT_DIR/.pylintrc $(git ls-files '*.py' | grep -vE '(ans\.py|dangerfile\.py)')
509

510
tarball-create:
511
  stage: precheck
512
  <<: *base_image
513
  <<: *default_triggering_rules
514
  script:
515
516
517
518
    - ./configure --enable-maintainer-mode
    - make maintainer-clean
    - autoreconf -fi
    - ./configure --enable-maintainer-mode
519
    - make -j${BUILD_PARALLEL_JOBS:-1} all V=1
520
    - if test "$(git status --porcelain | grep -Ev '\?\?' | wc -l)" -gt "0"; then git status --short; exit 1; fi
521
    - make -j${BUILD_PARALLEL_JOBS:-1} dist V=1
522
523
  artifacts:
    paths:
524
      - bind-*.tar.${TARBALL_EXTENSION}
525
526
527
  needs:
    - job: autoreconf
      artifacts: true
528

529
# Jobs for doc builds on Debian 10 "buster" (amd64)
Michał Kępień's avatar
Michał Kępień committed
530

531
docs:
532
  <<: *release_branch_triggering_rules
533
  <<: *base_image
534
  stage: docs
535
536
  before_script:
    - test -w "${CCACHE_DIR}" && export PATH="/usr/lib/ccache:${PATH}"
Michał Kępień's avatar
Michał Kępień committed
537
  script:
538
539
    - *configure
    - make -j${BUILD_PARALLEL_JOBS:-1} -k doc V=1
540
    - qpdf --check doc/arm/_build/latex/Bv9ARM.pdf
Michal Nowak's avatar
Michal Nowak committed
541
    - find doc/man/ -maxdepth 1 -name "*.[0-9]" -exec mandoc -T lint "{}" \; | ( ! grep -v -e "skipping paragraph macro. sp after" -e "unknown font, skipping request. ft C" )
542
  needs:
543
    - job: autoreconf
544
      artifacts: true
545
  allow_failure: false
Michał Kępień's avatar
Michał Kępień committed
546
547
  artifacts:
    paths:
548
      - doc/arm/
549
550
      - doc/man/
      - doc/misc/
551
    expire_in: "1 month"
552

553
554
push:docs:
  <<: *base_image
555
  stage: push
556
  needs:
557
    - job: docs
558
      artifacts: false
559
  script:
560
    - curl -X POST -F token=$GITLAB_PAGES_DOCS_TRIGGER_TOKEN -F ref=main $GITLAB_PAGES_DOCS_TRIGGER_URL
561
  only:
562
    - main@isc-projects/bind9
563
    - /^v9_[1-9][0-9]$/@isc-projects/bind9
Michał Kępień's avatar
Michał Kępień committed
564

Michal Nowak's avatar
Michal Nowak committed
565
# Jobs for regular GCC builds on Alpine Linux 3.13 (amd64)
566

Michal Nowak's avatar
Michal Nowak committed
567
gcc:alpine3.13:amd64:
568
569
  variables:
    CC: gcc
Ondřej Surý's avatar
Ondřej Surý committed
570
    CFLAGS: "${CFLAGS_COMMON}"
571
    EXTRA_CONFIGURE: "--enable-dnstap ${WITHOUT_READLINE}"
Michal Nowak's avatar
Michal Nowak committed
572
  <<: *alpine_3_13_amd64_image
573
574
  <<: *build_job

Michal Nowak's avatar
Michal Nowak committed
575
576
system:gcc:alpine3.13:amd64:
  <<: *alpine_3_13_amd64_image
577
  <<: *system_test_job
578
  needs:
Michal Nowak's avatar
Michal Nowak committed
579
    - job: gcc:alpine3.13:amd64
580
      artifacts: true
581

Michal Nowak's avatar
Michal Nowak committed
582
583
unit:gcc:alpine3.13:amd64:
  <<: *alpine_3_13_amd64_image
584
  <<: *unit_test_job
585
  needs:
Michal Nowak's avatar
Michal Nowak committed
586
    - job: gcc:alpine3.13:amd64
587
      artifacts: true
588

Michał Kępień's avatar
Michał Kępień committed
589
590
# Jobs for regular GCC builds on CentOS 7 (amd64)

591
gcc:centos7:amd64:
Michał Kępień's avatar
Michał Kępień committed
592
593
  variables:
    CC: gcc
Ondřej Surý's avatar
Ondřej Surý committed
594
    CFLAGS: "${CFLAGS_COMMON}"
Michał Kępień's avatar
Michał Kępień committed
595
    EXTRA_CONFIGURE: "--enable-dnstap --with-libidn2"
Michał Kępień's avatar
Michał Kępień committed
596
597
598
  <<: *centos_centos7_amd64_image
  <<: *build_job

Michał Kępień's avatar
Michał Kępień committed
599
600
601
system:gcc:centos7:amd64:
  <<: *centos_centos7_amd64_image
  <<: *system_test_job
602
603
604
  needs:
    - job: gcc:centos7:amd64
      artifacts: true
Michał Kępień's avatar
Michał Kępień committed
605
606
607
608

unit:gcc:centos7:amd64:
  <<: *centos_centos7_amd64_image
  <<: *unit_test_job
609
610
611
  needs:
    - job: gcc:centos7:amd64
      artifacts: true
612

Michał Kępień's avatar
Michał Kępień committed
613
614
615
616
617
# Jobs for regular GCC builds on CentOS 8 (amd64)

gcc:centos8:amd64:
  variables:
    CC: gcc
Ondřej Surý's avatar
Ondřej Surý committed
618
    CFLAGS: "${CFLAGS_COMMON}"
619
    EXTRA_CONFIGURE: "--enable-buffer-useinline --with-libidn2"
Michał Kępień's avatar
Michał Kępień committed
620
621
622
623
624
625
  <<: *centos_centos8_amd64_image
  <<: *build_job

system:gcc:centos8:amd64:
  <<: *centos_centos8_amd64_image
  <<: *system_test_job
626
627
628
  needs:
    - job: gcc:centos8:amd64
      artifacts: true
Michał Kępień's avatar
Michał Kępień committed
629
630
631
632

unit:gcc:centos8:amd64:
  <<: *centos_centos8_amd64_image
  <<: *unit_test_job
633
634
635
  needs:
    - job: gcc:centos8:amd64
      artifacts: true
Michał Kępień's avatar
Michał Kępień committed
636

637
# Jobs for regular GCC builds on Debian 9 "stretch" (amd64)
Michał Kępień's avatar
Michał Kępień committed
638

639
gcc:stretch:amd64:
640
641
  variables:
    CC: gcc
Ondřej Surý's avatar
Ondřej Surý committed
642
    CFLAGS: "${CFLAGS_COMMON} -O2"
643
    EXTRA_CONFIGURE: "--without-cmocka --without-gssapi"
644
645
646
  <<: *debian_stretch_amd64_image
  <<: *build_job

Michał Kępień's avatar
Michał Kępień committed
647
648
649
system:gcc:stretch:amd64:
  <<: *debian_stretch_amd64_image
  <<: *system_test_job
650
651
652
  needs:
    - job: gcc:stretch:amd64
      artifacts: true
Michał Kępień's avatar
Michał Kępień committed
653
654
655
656

unit:gcc:stretch:amd64:
  <<: *debian_stretch_amd64_image
  <<: *unit_test_job
657
658
659
  needs:
    - job: gcc:stretch:amd64
      artifacts: true
Michał Kępień's avatar
Michał Kępień committed
660

661
# Jobs for regular GCC builds on Debian 10 "buster" (amd64)
Michał Kępień's avatar
Michał Kępień committed
662
663
664
665

gcc:buster:amd64:
  variables:
    CC: gcc
666
667
    CFLAGS: "${CFLAGS_COMMON} --coverage -O0"
    EXTRA_CONFIGURE: "--enable-dnstap --with-libidn2 ${WITH_READLINE_LIBEDIT}"
Michał Kępień's avatar
Michał Kępień committed
668
669
670
671
672
  <<: *debian_buster_amd64_image
  <<: *build_job

system:gcc:buster:amd64:
  <<: *debian_buster_amd64_image
673
  <<: *system_test_gcov_job
674
  needs:
675
    - job: unit:gcc:buster:amd64
676
      artifacts: true
Michał Kępień's avatar
Michał Kępień committed
677
678
679

unit:gcc:buster:amd64:
  <<: *debian_buster_amd64_image
680
  <<: *unit_test_gcov_job
681
682
683
  needs:
    - job: gcc:buster:amd64
      artifacts: true
Michał Kępień's avatar
Michał Kępień committed
684

685
# Jobs for scan-build builds on Debian 10 "buster" (amd64)
686
687
688
689
690
691
692
693
694

.scan_build: &scan_build |
  ${SCAN_BUILD} --html-title="BIND 9 ($CI_COMMIT_SHORT_SHA)" \
                --keep-cc \
                --status-bugs \
                --keep-going \
                -o scan-build.reports \
                make -j${BUILD_PARALLEL_JOBS:-1} all V=1

695
scan-build:
696
  <<: *default_triggering_rules
697
  <<: *base_image
698
699
  stage: postcheck
  variables:
700
    CC: "${CLANG}"
Ondřej Surý's avatar
Ondřej Surý committed
701
    CFLAGS: "${CFLAGS_COMMON}"
702
703
704
705
706
707
    CONFIGURE: "${SCAN_BUILD} ./configure"
    EXTRA_CONFIGURE: "--enable-dnstap --with-libidn2"
  script:
    - *configure
    - *scan_build
  needs:
708
    - job: autoreconf
709
      artifacts: true
710
711
712
  artifacts:
    paths:
      - scan-build.reports/
713
    expire_in: "1 day"
714
715
    when: on_failure

716
# Jobs for regular GCC builds on Debian "sid" (amd64)
717
# Also tests configration option: --without-lmdb.
Michał Kępień's avatar
Michał Kępień committed
718

719
gcc:sid:amd64:
720
721
  variables:
    CC: gcc
Ondřej Surý's avatar
Ondřej Surý committed
722
    CFLAGS: "${CFLAGS_COMMON} -O3"
723
    EXTRA_CONFIGURE: "--enable-dnstap --with-libidn2 --without-lmdb"
724
    RUN_MAKE_INSTALL: 1
Ondřej Surý's avatar
Ondřej Surý committed
725
  <<: *debian_sid_amd64_image
726
  <<: *build_job
727

Michał Kępień's avatar
Michał Kępień committed
728
729
730
system:gcc:sid:amd64:
  <<: *debian_sid_amd64_image
  <<: *system_test_job
731
732
733
  needs:
    - job: gcc:sid:amd64
      artifacts: true
734

735
unit:gcc:sid:amd64:
736
737
  <<: *debian_sid_amd64_image
  <<: *unit_test_job
738
739
740
  needs:
    - job: gcc:sid:amd64
      artifacts: true
741

742
743
cppcheck:
  <<: *base_image
Ondřej Surý's avatar
Ondřej Surý committed
744
745
  <<: *cppcheck_job

746
# Job for out-of-tree GCC build on Debian "sid" (amd64)
747
# Also tests configration option: --with-lmdb.
Michal Nowak's avatar
Michal Nowak committed
748

749
gcc:out-of-tree:
Michal Nowak's avatar
Michal Nowak committed
750
751
  variables:
    CC: gcc
752
    CFLAGS: "${CFLAGS_COMMON} -Og"
753
    CONFIGURE: "${CI_PROJECT_DIR}/configure"
754
    EXTRA_CONFIGURE: "--enable-dnstap --with-libidn2 --with-lmdb"
Michal Nowak's avatar
Michal Nowak committed
755
    RUN_MAKE_INSTALL: 1
756
    OUT_OF_TREE_WORKSPACE: /tmp/out_of_tree_workspace
757
  <<: *base_image
Michal Nowak's avatar
Michal Nowak committed
758
759
  <<: *build_job

760
761
762
763
764
765
766
767
768
769
770
771
772
system:gcc:out-of-tree:
  variables:
    OUT_OF_TREE_WORKSPACE: /tmp/out_of_tree_workspace
  needs:
    - job: gcc:out-of-tree
      artifacts: true
  <<: *base_image
  <<: *system_test_job
  only:
    - schedules
    - tags
    - web

773
# Jobs for tarball GCC builds on Debian 10 "buster" (amd64)
774

775
gcc:tarball:
776
777
778
779
  variables:
    CC: gcc
    EXTRA_CONFIGURE: "--enable-dnstap --with-libidn2"
    RUN_MAKE_INSTALL: 1
780
  <<: *base_image
781
782
783
784
785
  <<: *build_job
  before_script:
    - tar --extract --file bind-*.tar.${TARBALL_EXTENSION}
    - rm -f bind-*.tar.${TARBALL_EXTENSION}
    - cd bind-*
786
  needs:
787
    - job: tarball-create
788
      artifacts: true
789
  only:
790
    - schedules
791
    - tags
792
    - web
793

794
system:gcc:tarball:
795
  <<: *base_image
796
797
798
799
  <<: *system_test_job
  before_script:
    - cd bind-*
    - *setup_interfaces
800
  needs:
801
    - job: gcc:tarball
802
      artifacts: true
803
  only:
804
    - schedules
805
    - tags
806
    - web
807

808
unit:gcc:tarball:
809
  <<: *base_image
810
811
812
  <<: *unit_test_job
  before_script:
    - cd bind-*
813
  needs:
814
    - job: gcc:tarball
815
      artifacts: true
816
  only:
817
    - schedules
818
    - tags
819
    - web
820

821
# Jobs for debug GCC builds on openSUSE Tumbleweed (amd64)
822
823
824
825

gcc:tumbleweed:amd64:
  variables:
    CC: gcc
826
    CFLAGS: "${CFLAGS_COMMON} -DDEBUG"
827
    EXTRA_CONFIGURE: "--with-libidn2 ${WITH_READLINE_READLINE}"
828
829
830
831
832
833
  <<: *tumbleweed_latest_amd64_image
  <<: *build_job

system:gcc:tumbleweed:amd64:
  <<: *tumbleweed_latest_amd64_image
  <<: *system_test_job
834
835
836
  needs:
    - job: gcc:tumbleweed:amd64
      artifacts: true
837
838
839
840

unit:gcc:tumbleweed:amd64:
  <<: *tumbleweed_latest_amd64_image
  <<: *unit_test_job
841
842
843
  needs:
    - job: gcc:tumbleweed:amd64
      artifacts: true
844

845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
# Jobs for regular GCC builds on Ubuntu 20.04 Focal Fossa (amd64)

gcc:focal:amd64:
  variables:
    CC: gcc
    CFLAGS: "${CFLAGS_COMMON} -Og"
    EXTRA_CONFIGURE: "--with-libidn2"
  <<: *ubuntu_focal_amd64_image
  <<: *build_job

system:gcc:focal:amd64:
  <<: *ubuntu_focal_amd64_image
  <<: *system_test_job
  needs:
    - job: gcc:focal:amd64
      artifacts: true

unit:gcc:focal:amd64:
  <<: *ubuntu_focal_amd64_image
  <<: *unit_test_job
  needs:
    - job: gcc:focal:amd64
      artifacts: true

869
# Jobs for ASAN builds on Debian 10 "buster" (amd64)
Michał Kępień's avatar
Michał Kępień committed
870

871
gcc:asan:
Michał Kępień's avatar
Michał Kępień committed
872
873
  variables:
    CC: gcc
874
    CFLAGS: "${CFLAGS_COMMON} -fsanitize=address,undefined"
Michał Kępień's avatar
Michał Kępień committed
875
876
    LDFLAGS: "-fsanitize=address,undefined"
    EXTRA_CONFIGURE: "--with-libidn2"
877
  <<: *base_image
Michał Kępień's avatar
Michał Kępień committed
878
  <<: *build_job
879

880
system:gcc:asan:
881
882
  variables:
    ASAN_OPTIONS: ${ASAN_OPTIONS_COMMON}
883
  <<: *base_image
884
  <<: *system_test_job
885
  needs:
886
    - job: gcc:asan
887
      artifacts: true
888

889
unit:gcc:asan:
890
891
  variables:
    ASAN_OPTIONS: ${ASAN_OPTIONS_COMMON}
892
893
894
895
896
897
898
899
900
  <<: *base_image
  <<: *unit_test_job
  needs:
    - job: gcc:asan
      artifacts: true

clang:asan:
  variables:
    CC: ${CLANG}
901
    CFLAGS: "${CFLAGS_COMMON} -fsanitize=address,undefined"
902
903
904
905
906
907
908
909
910
911
912
    LDFLAGS: "-fsanitize=address,undefined"
    EXTRA_CONFIGURE: "--with-libidn2"
  <<: *base_image
  <<: *build_job

system:clang:asan:
  variables:
    ASAN_OPTIONS: ${ASAN_OPTIONS_COMMON}
  <<: *base_image
  <<: *system_test_job
  needs:
913
    - job: clang:asan
914
915
916
917
918
919
      artifacts: true

unit:clang:asan:
  variables:
    ASAN_OPTIONS: ${ASAN_OPTIONS_COMMON}
  <<: *base_image
Michał Kępień's avatar
Michał Kępień committed
920
  <<: *unit_test_job
921
  needs:
922
    - job: clang:asan
923
      artifacts: true
924

925
# Jobs for TSAN builds on Debian 10 "buster" (amd64)
926

927
928
gcc:tsan:
  <<: *base_image
929
930
  <<: *build_job
  variables:
931
    CC: gcc
932
    CFLAGS: "${CFLAGS_COMMON} -fsanitize=thread"
933
934
935
    LDFLAGS: "-fsanitize=thread"
    EXTRA_CONFIGURE: "--with-libidn2 --enable-pthread-rwlock"

936
system:gcc:tsan:
937
  variables:
938
    TSAN_OPTIONS: ${TSAN_OPTIONS_COMMON}
939
  <<: *base_image
940
  <<: *system_test_tsan_job
941
  needs:
942
    - job: gcc:tsan
943
      artifacts: true
944

945
unit:gcc:tsan:
946
  variables:
947
    TSAN_OPTIONS: ${TSAN_OPTIONS_COMMON}