.gitlab-ci.yml 34.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

11 12 13
  # VirtualBox driver needs to set build_dir to "/builds" in gitlab-runner.toml
  KYUA_RESULT: "$CI_PROJECT_DIR/kyua.results"

Michał Kępień's avatar
Michał Kępień committed
14
  GIT_DEPTH: 1
15 16 17
  BUILD_PARALLEL_JOBS: 6
  TEST_PARALLEL_JOBS: 6

18
  CONFIGURE: ./configure
19 20
  CLANG: clang-10
  SCAN_BUILD: scan-build-10
Ondřej Surý's avatar
Ondřej Surý committed
21
  ASAN_SYMBOLIZER_PATH: /usr/lib/llvm-10/bin/llvm-symbolizer
22
  CLANG_FORMAT: clang-format-10
Ondřej Surý's avatar
Ondřej Surý committed
23

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

26 27
  # 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
28
  TSAN_OPTIONS_COMMON: "second_deadlock_stack=1 history_size=7 log_exe_name=true log_path=tsan external_symbolizer_path=/usr/lib/llvm-10/bin/llvm-symbolizer"
29

30 31
  TARBALL_EXTENSION: xz

32 33
  AM_COLOR_TESTS: always

34
stages:
35
  - autoconf
36
  - precheck
37
  - build
38
  - unit
Ondřej Surý's avatar
Ondřej Surý committed
39
  - system
40
  - docs
41
  - push
Ondřej Surý's avatar
Ondřej Surý committed
42
  - postcheck
43
  - release
44

Michał Kępień's avatar
Michał Kępień committed
45 46
### Runner Tag Templates

47
.libvirt-amd64: &libvirt_amd64
Michał Kępień's avatar
Michał Kępień committed
48
  tags:
49
    - libvirt
Michał Kępień's avatar
Michał Kępień committed
50 51
    - amd64

52
.linux-amd64: &linux_amd64
Michał Kępień's avatar
Michał Kępień committed
53 54 55 56
  tags:
    - linux
    - amd64

Ondřej Surý's avatar
Ondřej Surý committed
57 58 59 60 61
.linux-arm64: &linux_arm64
  tags:
    - linux
    - arm64

62
.linux-i386: &linux_i386
Michał Kępień's avatar
Michał Kępień committed
63 64
  tags:
    - linux
65 66
    - i386

Michał Kępień's avatar
Michał Kępień committed
67 68
### Docker Image Templates

69 70
# Alpine Linux

Michal Nowak's avatar
Michal Nowak committed
71 72
.alpine-3.12-amd64: &alpine_3_12_amd64_image
  image: "$CI_REGISTRY_IMAGE:alpine-3.12-amd64"
73 74
  <<: *linux_amd64

Michał Kępień's avatar
Michał Kępień committed
75 76
# CentOS

77 78 79 80 81 82 83
.centos-centos6-amd64: &centos_centos6_amd64_image
  image: "$CI_REGISTRY_IMAGE:centos-centos6-amd64"
  <<: *linux_amd64

.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
84

Michał Kępień's avatar
Michał Kępień committed
85 86 87 88
.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
89 90
# Debian

Ondřej Surý's avatar
Ondřej Surý committed
91 92
.debian-stretch-amd64: &debian_stretch_amd64_image
  image: "$CI_REGISTRY_IMAGE:debian-stretch-amd64"
93
  <<: *linux_amd64
94

Michał Kępień's avatar
Michał Kępień committed
95 96
.debian-buster-amd64: &debian_buster_amd64_image
  image: "$CI_REGISTRY_IMAGE:debian-buster-amd64"
97
  <<: *linux_amd64
Michał Kępień's avatar
Michał Kępień committed
98

Ondřej Surý's avatar
Ondřej Surý committed
99 100
.debian-sid-amd64: &debian_sid_amd64_image
  image: "$CI_REGISTRY_IMAGE:debian-sid-amd64"
101
  <<: *linux_amd64
102

Ondřej Surý's avatar
Ondřej Surý committed
103 104 105 106
.debian-sid-arm64: &debian_sid_arm64_image
  image: "$CI_REGISTRY_IMAGE:debian-sid-arm64"
  <<: *linux_arm64

Ondřej Surý's avatar
Ondřej Surý committed
107 108
.debian-sid-i386: &debian_sid_i386_image
  image: "$CI_REGISTRY_IMAGE:debian-sid-i386"
109
  <<: *linux_i386
110

111 112 113 114 115 116
# 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
117 118
# Fedora

119 120
.fedora-32-amd64: &fedora_32_amd64_image
  image: "$CI_REGISTRY_IMAGE:fedora-32-amd64"
Michał Kępień's avatar
Michał Kępień committed
121 122
  <<: *linux_amd64

Michał Kępień's avatar
Michał Kępień committed
123 124
# Ubuntu

125 126
.ubuntu-xenial-amd64: &ubuntu_xenial_amd64_image
  image: "$CI_REGISTRY_IMAGE:ubuntu-xenial-amd64"
127
  <<: *linux_amd64
Ondřej Surý's avatar
Ondřej Surý committed
128

129 130 131 132
.ubuntu-focal-amd64: &ubuntu_focal_amd64_image
  image: "$CI_REGISTRY_IMAGE:ubuntu-focal-amd64"
  <<: *linux_amd64

133 134 135 136 137 138
# Base image
# This is a meta image that is used as a base for non-specific jobs

.base: &base_image
  <<: *debian_buster_amd64_image

139 140 141 142 143 144 145 146 147 148 149 150 151 152
### 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
  image: "freebsd-12.1-x86_64"
  <<: *libvirt_amd64

.openbsd-amd64: &openbsd_amd64_image
  image: "openbsd-6.7-x86_64"
  <<: *libvirt_amd64

Michał Kępień's avatar
Michał Kępień committed
153 154
### Job Templates

155 156 157 158 159
.default-triggering-rules: &default_triggering_rules
  only:
    - merge_requests
    - tags
    - web
160
    - schedules
161

162 163 164 165 166
.release-branch-triggering-rules: &release_branch_triggering_rules
  only:
    - merge_requests
    - tags
    - web
167
    - schedules
168
    - main@isc-projects/bind9
169 170
    - /^v9_[1-9][0-9]$/@isc-projects/bind9

171
.precheck: &precheck_job
172
  <<: *default_triggering_rules
173
  <<: *base_image
174 175
  stage: precheck

176
.autoconf: &autoconf_job
177
  <<: *release_branch_triggering_rules
178
  <<: *base_image
179
  stage: autoconf
180 181 182
  script:
    - autoreconf -fi
  artifacts:
183
    untracked: true
184
    expire_in: "1 day"
185

186
.configure: &configure |
187
    ${CONFIGURE} \
188 189 190 191 192 193 194 195
    --disable-maintainer-mode \
    --enable-developer \
    --with-libtool \
    --with-cmocka \
    --with-libxml2 \
    --with-json-c \
    --prefix=$HOME/.local \
    --without-make-clean \
196
    --with-python=python3 \
197 198
    $EXTRA_CONFIGURE \
    || cat config.log
199

200
.build: &build_job
201
  <<: *default_triggering_rules
202
  stage: build
203
  before_script:
204
    - test -w "${CCACHE_DIR}" && export PATH="/usr/lib/ccache:${PATH}"
Michal Nowak's avatar
Michal Nowak committed
205
    - test -n "${OOT_BUILD_WORKSPACE}" && mkdir "${OOT_BUILD_WORKSPACE}" && cd "${OOT_BUILD_WORKSPACE}"
206
  script:
207
    - *configure
208
    - make -j${BUILD_PARALLEL_JOBS:-1} -k all V=1
209
    - test -z "${RUN_MAKE_INSTALL}" || make install
Mark Andrews's avatar
Mark Andrews committed
210
    - test -z "${RUN_MAKE_INSTALL}" || sh util/check-make-install
211
    - if test "$(git status --porcelain | grep -Ev '\?\?' | wc -l)" -gt "0"; then git status --short; exit 1; fi
212
  needs:
213
    - job: autoreconf
214
      artifacts: true
215 216
  artifacts:
    untracked: true
217
    expire_in: "1 day"
218

219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241
.windows_build: &windows_build_job
  stage: build
  tags:
    - windows
    - amd64
  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"
         "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'
242
  needs: []
243 244
  artifacts:
    untracked: true
245
    expire_in: "1 day"
246
    when: always
247

248 249
.setup_interfaces: &setup_interfaces |
    if [ "$(id -u)" -eq "0" ]; then
250
      sh -x bin/tests/system/ifconfig.sh up;
251
    else
252
      sudo sh -x bin/tests/system/ifconfig.sh up;
253 254 255
    fi

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

259
.system_test_common: &system_test_common
260
  <<: *default_triggering_rules
261
  stage: system
262
  before_script:
263 264
    - *setup_interfaces
    - *setup_softhsm
265
  script:
266
    - cd bin/tests/system
267
    - make -j${TEST_PARALLEL_JOBS:-1} -k check V=1 || make -j${TEST_PARALLEL_JOBS:-1} -k recheck V=1
268 269
  after_script:
    - cat bin/tests/system/test-suite.log
270 271 272

.system_test: &system_test_job
  <<: *system_test_common
273 274
  artifacts:
    untracked: true
275
    expire_in: "1 day"
276 277
    when: on_failure

278 279 280 281
.system_test_tsan: &system_test_tsan_job
  <<: *system_test_common
  allow_failure: true
  after_script:
282
    - cat bin/tests/system/test-suite.log
283 284 285 286 287 288 289 290 291
    - find bin -name 'tsan.*' -exec python3 util/parse_tsan.py {} \;
  artifacts:
    expire_in: "1 day"
    paths:
      - bin/tests/system/*/tsan.*
      - bin/tests/system/*/*/tsan.*
      - tsan/
    when: on_failure

292
.kyua_report: &kyua_report_html |
293
  kyua --logfile /dev/null report-html \
294 295 296 297 298
       --force \
       --results-file "$KYUA_RESULT" \
       --results-filter "" \
       --output kyua_html

299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315
.windows_system_test: &windows_system_test_job
  stage: system
  tags:
    - windows
    - amd64
  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
316
    expire_in: "1 day"
317 318 319 320 321 322
    when: on_failure
  only:
    - schedules
    - tags
    - web

323
.unit_test_common: &unit_test_common
324
  <<: *default_triggering_rules
325
  stage: unit
326
  before_script:
327
    - *setup_softhsm
328
  script:
329
    - make -j${TEST_PARALLEL_JOBS:-1} -k unit V=1
330 331 332

.unit_test: &unit_test_job
  <<: *unit_test_common
333
  artifacts:
Michal Nowak's avatar
Michal Nowak committed
334
    untracked: true
335
    expire_in: "1 day"
336
    when: on_failure
337

338 339 340 341 342 343 344 345 346 347 348 349
.unit_test_tsan: &unit_test_tsan_job
  <<: *unit_test_common
  allow_failure: true
  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
350
.cppcheck_args: &run_cppcheck |
351
  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
352 353

.cppcheck_report: &cppcheck_report_html |
354
  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
355 356 357 358

.cppcheck: &cppcheck_job
  <<: *default_triggering_rules
  stage: postcheck
359
  script:
360 361 362
    # Workaround for cppcheck 2.0 uninitvar false positives triggered by (&var)->field syntax
    # (see: https://sourceforge.net/p/cppcheck/discussion/general/thread/122153e3c1/)
    - sed -i '/^#define ISC__BUFFER.*\\$/{s|_b|__b|;N;s|do {|\0 isc_buffer_t *_b = (isc_buffer_t *)__b;|}; /^#define ISC__BUFFER.*REGION.*\\$/{s|_r|__r|;N;s|do {|\0 isc_region_t *_r = (isc_region_t *)__r;|; /USEDREGION/{s|isc_buffer_t|const \0|g}}' lib/isc/include/isc/buffer.h
363 364
    - *configure
    - (make -nwk all || true) | compiledb
365
    - 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
366
    - sed -i "/gcc\",/a\"-DCPPCHECK\", \"-D__STDC__\", \"-D__GNUC__=${GCC_VERSION}\"," compile_commands.json
Ondřej Surý's avatar
Ondřej Surý committed
367
    - *run_cppcheck
368
  after_script:
Ondřej Surý's avatar
Ondřej Surý committed
369 370 371 372 373 374
    - *cppcheck_report_html
  artifacts:
    paths:
      - compile_commands.json
      - cppcheck.results
      - cppcheck_html/
375
    expire_in: "1 day"
Ondřej Surý's avatar
Ondřej Surý committed
376
    when: on_failure
377 378 379
  needs:
    - job: autoreconf
      artifacts: true
Ondřej Surý's avatar
Ondřej Surý committed
380

Michał Kępień's avatar
Michał Kępień committed
381 382 383 384
### Job Definitions

# Jobs in the precheck stage

385
autoreconf:
386 387
  <<: *autoconf_job

388
misc:
389
  <<: *precheck_job
390
  script:
Evan Hunt's avatar
Evan Hunt committed
391
    - sh util/checklibs.sh > checklibs.out
Mark Andrews's avatar
Mark Andrews committed
392 393
    - sh util/tabify-changes < CHANGES > CHANGES.tmp
    - diff -urNap CHANGES CHANGES.tmp
394
    - perl util/check-changes CHANGES
395 396 397 398
    - 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
    - rm CHANGES.tmp
399 400 401
    - perl -w util/merge_copyrights
    - diff -urNap util/copyrights util/newcopyrights
    - rm util/newcopyrights
402 403
    - 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
404
    - xmllint --noout --nonet `git ls-files '*.xml' '*.docbook'`
405
    - sh util/check-win32util-configure
406
    - sh util/check-categories.sh
407
    - if git grep SYSTEMTESTTOP -- ':!.gitlab-ci.yml'; then echo 'Please use relative paths instead of $SYSTEMTESTTOP.'; exit 1; fi
408
  needs: []
409 410
  artifacts:
    paths:
411 412
      - util/newcopyrights
      - checklibs.out
413
    expire_in: "1 day"
414 415
    when: on_failure

416
clang-format:
417
  <<: *precheck_job
418
  needs: []
419
  script:
420
    - if [ -r .clang-format ]; then "${CLANG_FORMAT}" -i -style=file $(git ls-files '*.c' '*.h'); fi
421 422
    - if test "$(git status --porcelain | grep -Ev '\?\?' | wc -l)" -gt "0"; then git status --short; exit 1; fi

423
coccinelle:
424
  <<: *precheck_job
425
  needs: []
426 427 428
  script:
    - util/check-cocci
    - if test "$(git status --porcelain | grep -Ev '\?\?' | wc -l)" -gt "0"; then git status --short; exit 1; fi
429

430 431 432 433 434 435
danger:
  <<: *precheck_job
  needs: []
  script:
    - danger-python ci -f
  only:
436 437 438 439
    refs:
      - merge_requests
    variables:
      - $DANGER_GITLAB_API_TOKEN
440

441 442 443 444 445 446 447 448 449
flake8:
  <<: *default_triggering_rules
  <<: *base_image
  stage: postcheck
  needs:
    - job: autoreconf
      artifacts: true
  script:
    - *configure
450
    - flake8 --max-line-length=80 $(git ls-files '*.py' | grep -vE '(ans\.py|dangerfile\.py)')
451 452 453 454 455 456 457 458 459 460 461 462
  only:
    - merge_requests

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

468
tarball-create:
469
  stage: precheck
470
  <<: *base_image
471
  <<: *default_triggering_rules
472
  script:
473
    - *configure
474
    - make -j${BUILD_PARALLEL_JOBS:-1} all V=1
475
    - make -j${BUILD_PARALLEL_JOBS:-1} dist V=1
476 477
  artifacts:
    paths:
478
      - bind-*.tar.${TARBALL_EXTENSION}
479 480 481
  needs:
    - job: autoreconf
      artifacts: true
482

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

485
docs:
486
  <<: *release_branch_triggering_rules
487
  <<: *base_image
488
  stage: docs
489 490 491
  before_script:
    - test -w "${CCACHE_DIR}" && export PATH="/usr/lib/ccache:${PATH}"
    - test -n "${OOT_BUILD_WORKSPACE}" && mkdir "${OOT_BUILD_WORKSPACE}" && cd "${OOT_BUILD_WORKSPACE}"
Michał Kępień's avatar
Michał Kępień committed
492
  script:
493 494
    - *configure
    - make -j${BUILD_PARALLEL_JOBS:-1} -k doc V=1
495
  needs:
496
    - job: autoreconf
497
      artifacts: true
498
  allow_failure: false
Michał Kępień's avatar
Michał Kępień committed
499 500
  artifacts:
    paths:
501
      - doc/arm/
502 503
      - doc/man/
      - doc/misc/
504
    expire_in: "1 month"
505

506 507
push:docs:
  <<: *base_image
508
  stage: push
509
  needs:
510
    - job: docs
511
      artifacts: false
512
  script:
513
    - curl -X POST -F token=$GITLAB_PAGES_DOCS_TRIGGER_TOKEN -F ref=main $GITLAB_PAGES_DOCS_TRIGGER_URL
514
  only:
515
    - main@isc-projects/bind9
516
    - /^v9_[1-9][0-9]$/@isc-projects/bind9
Michał Kępień's avatar
Michał Kępień committed
517

Michal Nowak's avatar
Michal Nowak committed
518
# Jobs for regular GCC builds on Alpine Linux 3.12 (amd64)
519

Michal Nowak's avatar
Michal Nowak committed
520
gcc:alpine3.12:amd64:
521 522
  variables:
    CC: gcc
Ondřej Surý's avatar
Ondřej Surý committed
523
    CFLAGS: "${CFLAGS_COMMON}"
524
    EXTRA_CONFIGURE: "--enable-dnstap"
Michal Nowak's avatar
Michal Nowak committed
525
  <<: *alpine_3_12_amd64_image
526 527
  <<: *build_job

Michal Nowak's avatar
Michal Nowak committed
528 529
system:gcc:alpine3.12:amd64:
  <<: *alpine_3_12_amd64_image
530
  <<: *system_test_job
531
  needs:
Michal Nowak's avatar
Michal Nowak committed
532
    - job: gcc:alpine3.12:amd64
533
      artifacts: true
534

Michal Nowak's avatar
Michal Nowak committed
535 536
unit:gcc:alpine3.12:amd64:
  <<: *alpine_3_12_amd64_image
537
  <<: *unit_test_job
538
  needs:
Michal Nowak's avatar
Michal Nowak committed
539
    - job: gcc:alpine3.12:amd64
540
      artifacts: true
541

Michał Kępień's avatar
Michał Kępień committed
542 543
# Jobs for regular GCC builds on CentOS 6 (amd64)

544
gcc:centos6:amd64:
Michał Kępień's avatar
Michał Kępień committed
545 546
  variables:
    CC: gcc
Ondřej Surý's avatar
Ondřej Surý committed
547
    CFLAGS: "${CFLAGS_COMMON}"
548
    EXTRA_CONFIGURE: "--with-libidn2 --disable-warn-error --without-python"
Michał Kępień's avatar
Michał Kępień committed
549 550 551
  <<: *centos_centos6_amd64_image
  <<: *build_job

Michał Kępień's avatar
Michał Kępień committed
552 553 554
system:gcc:centos6:amd64:
  <<: *centos_centos6_amd64_image
  <<: *system_test_job
555 556 557
  needs:
    - job: gcc:centos6:amd64
      artifacts: true
Michał Kępień's avatar
Michał Kępień committed
558 559 560 561

unit:gcc:centos6:amd64:
  <<: *centos_centos6_amd64_image
  <<: *unit_test_job
562 563 564
  needs:
    - job: gcc:centos6:amd64
      artifacts: true
Michał Kępień's avatar
Michał Kępień committed
565

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

568
gcc:centos7:amd64:
Michał Kępień's avatar
Michał Kępień committed
569 570
  variables:
    CC: gcc
Ondřej Surý's avatar
Ondřej Surý committed
571
    CFLAGS: "${CFLAGS_COMMON}"
Michał Kępień's avatar
Michał Kępień committed
572
    EXTRA_CONFIGURE: "--enable-dnstap --with-libidn2"
Michał Kępień's avatar
Michał Kępień committed
573 574 575
  <<: *centos_centos7_amd64_image
  <<: *build_job

Michał Kępień's avatar
Michał Kępień committed
576 577 578
system:gcc:centos7:amd64:
  <<: *centos_centos7_amd64_image
  <<: *system_test_job
579 580 581
  needs:
    - job: gcc:centos7:amd64
      artifacts: true
Michał Kępień's avatar
Michał Kępień committed
582 583 584 585

unit:gcc:centos7:amd64:
  <<: *centos_centos7_amd64_image
  <<: *unit_test_job
586 587 588
  needs:
    - job: gcc:centos7:amd64
      artifacts: true
589

Michał Kępień's avatar
Michał Kępień committed
590 591 592 593 594
# Jobs for regular GCC builds on CentOS 8 (amd64)

gcc:centos8:amd64:
  variables:
    CC: gcc
Ondřej Surý's avatar
Ondřej Surý committed
595
    CFLAGS: "${CFLAGS_COMMON}"
Michał Kępień's avatar
Michał Kępień committed
596 597 598 599 600 601 602
    EXTRA_CONFIGURE: "--with-libidn2"
  <<: *centos_centos8_amd64_image
  <<: *build_job

system:gcc:centos8:amd64:
  <<: *centos_centos8_amd64_image
  <<: *system_test_job
603 604 605
  needs:
    - job: gcc:centos8:amd64
      artifacts: true
Michał Kępień's avatar
Michał Kępień committed
606 607 608 609

unit:gcc:centos8:amd64:
  <<: *centos_centos8_amd64_image
  <<: *unit_test_job
610 611 612
  needs:
    - job: gcc:centos8:amd64
      artifacts: true
Michał Kępień's avatar
Michał Kępień committed
613

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

616
gcc:stretch:amd64:
617 618
  variables:
    CC: gcc
Ondřej Surý's avatar
Ondřej Surý committed
619
    CFLAGS: "${CFLAGS_COMMON} -O2"
620 621 622
  <<: *debian_stretch_amd64_image
  <<: *build_job

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

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

637
# Jobs for regular GCC builds on Debian 10 "buster" (amd64)
Michał Kępień's avatar
Michał Kępień committed
638 639 640 641

gcc:buster:amd64:
  variables:
    CC: gcc
Ondřej Surý's avatar
Ondřej Surý committed
642
    CFLAGS: "${CFLAGS_COMMON}"
Michał Kępień's avatar
Michał Kępień committed
643 644 645 646 647 648
  <<: *debian_buster_amd64_image
  <<: *build_job

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

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

660
# Jobs for scan-build builds on Debian 10 "buster" (amd64)
661 662 663 664 665 666 667 668 669

.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

670
scan-build:
671
  <<: *default_triggering_rules
672
  <<: *base_image
673 674
  stage: postcheck
  variables:
675
    CC: "${CLANG}"
Ondřej Surý's avatar
Ondřej Surý committed
676
    CFLAGS: "${CFLAGS_COMMON}"
677 678 679 680 681 682
    CONFIGURE: "${SCAN_BUILD} ./configure"
    EXTRA_CONFIGURE: "--enable-dnstap --with-libidn2"
  script:
    - *configure
    - *scan_build
  needs:
683
    - job: autoreconf
684
      artifacts: true
685 686 687
  artifacts:
    paths:
      - scan-build.reports/
688
    expire_in: "1 day"
689 690
    when: on_failure

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

694
gcc:sid:amd64:
695 696
  variables:
    CC: gcc
Ondřej Surý's avatar
Ondřej Surý committed
697
    CFLAGS: "${CFLAGS_COMMON} -O3"
698
    EXTRA_CONFIGURE: "--enable-dnstap --with-libidn2 --without-lmdb"
699
    RUN_MAKE_INSTALL: 1
Ondřej Surý's avatar
Ondřej Surý committed
700
  <<: *debian_sid_amd64_image
701
  <<: *build_job
702

Michał Kępień's avatar
Michał Kępień committed
703 704 705
system:gcc:sid:amd64:
  <<: *debian_sid_amd64_image
  <<: *system_test_job
706 707 708
  needs:
    - job: gcc:sid:amd64
      artifacts: true
709

710
unit:gcc:sid:amd64:
711 712
  <<: *debian_sid_amd64_image
  <<: *unit_test_job
713 714 715
  needs:
    - job: gcc:sid:amd64
      artifacts: true
716

717 718
cppcheck:
  <<: *base_image
Ondřej Surý's avatar
Ondřej Surý committed
719 720
  <<: *cppcheck_job

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

724
gcc:out-of-tree:
Michal Nowak's avatar
Michal Nowak committed
725 726
  variables:
    CC: gcc
727
    CFLAGS: "${CFLAGS_COMMON} -Og"
Michal Nowak's avatar
Michal Nowak committed
728
    CONFIGURE: ../configure
729
    EXTRA_CONFIGURE: "--enable-dnstap --with-libidn2 --with-lmdb"
Michal Nowak's avatar
Michal Nowak committed
730 731
    RUN_MAKE_INSTALL: 1
    OOT_BUILD_WORKSPACE: workspace
732
  <<: *base_image
Michal Nowak's avatar
Michal Nowak committed
733 734
  <<: *build_job

735
# Jobs for tarball GCC builds on Debian 10 "buster" (amd64)
736

737
gcc:tarball:
738 739 740 741
  variables:
    CC: gcc
    EXTRA_CONFIGURE: "--enable-dnstap --with-libidn2"
    RUN_MAKE_INSTALL: 1
742
  <<: *base_image
743 744 745 746 747
  <<: *build_job
  before_script:
    - tar --extract --file bind-*.tar.${TARBALL_EXTENSION}
    - rm -f bind-*.tar.${TARBALL_EXTENSION}
    - cd bind-*
748
  needs:
749
    - job: tarball-create
750
      artifacts: true
751 752 753
  only:
    - tags

754
system:gcc:tarball:
755
  <<: *base_image
756 757 758 759
  <<: *system_test_job
  before_script:
    - cd bind-*
    - *setup_interfaces
760
  needs:
761
    - job: gcc:tarball
762
      artifacts: true
763 764 765
  only:
    - tags

766
unit:gcc:tarball:
767
  <<: *base_image
768 769 770
  <<: *unit_test_job
  before_script:
    - cd bind-*
771
  needs:
772
    - job: gcc:tarball
773
      artifacts: true
774 775 776
  only:
    - tags

777
# Jobs for regular GCC builds on Debian "sid" (arm64)
Ondřej Surý's avatar
Ondřej Surý committed
778 779 780 781

gcc:sid:arm64:
  variables:
    CC: gcc
782 783
    CFLAGS: "${CFLAGS_COMMON} -Og"
    EXTRA_CONFIGURE: "--with-libidn2"
Ondřej Surý's avatar
Ondřej Surý committed
784 785 786 787 788 789
  <<: *debian_sid_arm64_image
  <<: *build_job

system:gcc:sid:arm64:
  <<: *debian_sid_arm64_image
  <<: *system_test_job
790 791 792
  needs:
    - job: gcc:sid:arm64
      artifacts: true
Ondřej Surý's avatar
Ondřej Surý committed
793 794 795 796

unit:gcc:sid:arm64:
  <<: *debian_sid_arm64_image
  <<: *unit_test_job
797 798 799
  needs:
    - job: gcc:sid:arm64
      artifacts: true
Ondřej Surý's avatar
Ondřej Surý committed
800

801
# Jobs for regular GCC builds on Debian "sid" (i386)
Michał Kępień's avatar
Michał Kępień committed
802

Michał Kępień's avatar
Michał Kępień committed
803 804 805
gcc:sid:i386:
  variables:
    CC: gcc
Ondřej Surý's avatar
Ondřej Surý committed
806
    CFLAGS: "${CFLAGS_COMMON}"
807
    EXTRA_CONFIGURE: "--with-libidn2 --without-python"
Michał Kępień's avatar
Michał Kępień committed
808 809
  <<: *debian_sid_i386_image
  <<: *build_job
810

Michał Kępień's avatar
Michał Kępień committed
811 812 813
system:gcc:sid:i386:
  <<: *debian_sid_i386_image
  <<: *system_test_job
814 815 816
  needs:
    - job: gcc:sid:i386
      artifacts: true
817

818
unit:gcc:sid:i386:
819 820
  <<: *debian_sid_i386_image
  <<: *unit_test_job
821 822 823
  needs:
    - job: gcc:sid:i386
      artifacts: true
824

825 826 827 828 829 830
# Jobs for regular GCC builds on openSUSE Tumbleweed (amd64)

gcc:tumbleweed:amd64:
  variables:
    CC: gcc
    CFLAGS: "${CFLAGS_COMMON}"
831
    EXTRA_CONFIGURE: "--with-libidn2 --with-python --with-gssapi=/usr/lib/mit/bin/krb5-config"
832 833 834 835 836 837
  <<: *tumbleweed_latest_amd64_image
  <<: *build_job

system:gcc:tumbleweed:amd64:
  <<: *tumbleweed_latest_amd64_image
  <<: *system_test_job
838 839 840
  needs:
    - job: gcc:tumbleweed:amd64
      artifacts: true
841 842 843 844

unit:gcc:tumbleweed:amd64:
  <<: *tumbleweed_latest_amd64_image
  <<: *unit_test_job
845 846 847
  needs:
    - job: gcc:tumbleweed:amd64
      artifacts: true
848

Michał Kępień's avatar
Michał Kępień committed
849 850
# Jobs for regular GCC builds on Ubuntu 16.04 Xenial Xerus (amd64)

Michał Kępień's avatar
Michał Kępień committed
851 852 853
gcc:xenial:amd64:
  variables:
    CC: gcc
Ondřej Surý's avatar
Ondřej Surý committed
854
    CFLAGS: "${CFLAGS_COMMON} -O2"
855
    EXTRA_CONFIGURE: "--disable-geoip"
Michał Kępień's avatar
Michał Kępień committed
856 857 858 859 860
  <<: *ubuntu_xenial_amd64_image
  <<: *build_job

system:gcc:xenial:amd64:
  <<: *ubuntu_xenial_amd64_image
Michał Kępień's avatar
Michał Kępień committed
861
  <<: *system_test_job
862 863 864
  needs:
    - job: gcc:xenial:amd64
      artifacts: true
Michał Kępień's avatar
Michał Kępień committed
865

Michał Kępień's avatar
Michał Kępień committed
866 867 868
unit:gcc:xenial:amd64:
  <<: *ubuntu_xenial_amd64_image
  <<: *unit_test_job
869 870 871
  needs:
    - job: gcc:xenial:amd64
      artifacts: true
Michał Kępień's avatar
Michał Kępień committed
872

873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896
# 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

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

899
gcc:asan:
Michał Kępień's avatar
Michał Kępień committed
900 901
  variables:
    CC: gcc
Ondřej Surý's avatar
Ondřej Surý committed
902
    CFLAGS: "${CFLAGS_COMMON} -fsanitize=address,undefined -DISC_MEM_USE_INTERNAL_MALLOC=0"
Michał Kępień's avatar