.gitlab-ci.yml 34.3 KB
Newer Older
Ondřej Surý's avatar
Ondřej Surý committed
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`.
Ondřej Surý's avatar
Ondřej Surý committed
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.
Ondřej Surý's avatar
Ondřej Surý committed
5
  LC_ALL: C
Michał Kępień's avatar
Michał Kępień committed
6

Michał Kępień's avatar
Fix CI  
Michał Kępień committed
7
  CI_REGISTRY_IMAGE: registry.gitlab.isc.org/isc-projects/images/bind9
Ondřej Surý's avatar
Ondřej Surý committed
8
  CCACHE_DIR: "/ccache"
9
  SOFTHSM2_CONF: "/var/tmp/softhsm2/softhsm2.conf"
Ondřej Surý's avatar
Ondřej Surý committed
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 32
  TARBALL_COMPRESSOR: gzip
  TARBALL_EXTENSION: gz

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

Michał Kępień's avatar
Michał Kępień committed
43 44
### Runner Tag Templates

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

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

55 56 57 58 59
.linux-arm64: &linux_arm64
  tags:
    - linux
    - arm64

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

Michał Kępień's avatar
Michał Kępień committed
65 66
### Docker Image Templates

67 68
# Alpine Linux

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

Michał Kępień's avatar
Michał Kępień committed
73 74
# CentOS

75 76 77 78 79 80 81
.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
82

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

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

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

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

101 102 103 104
.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
105 106
.debian-sid-i386: &debian_sid_i386_image
  image: "$CI_REGISTRY_IMAGE:debian-sid-i386"
107
  <<: *linux_i386
Ondřej Surý's avatar
Ondřej Surý committed
108

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

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

Michał Kępień's avatar
Michał Kępień committed
121 122
# Ubuntu

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

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

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

.base: &base_image
  <<: *debian_buster_amd64_image

137 138 139 140 141 142 143 144 145 146 147 148 149 150
### 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
151 152
### Job Templates

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

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

169
.precheck: &precheck_job
170
  <<: *default_triggering_rules
171
  <<: *base_image
172 173
  stage: precheck

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

.configure: &configure |
185
    ${CONFIGURE} \
186 187 188 189 190 191 192
    --enable-developer \
    --with-randomdev=/dev/urandom \
    --with-libtool \
    --with-geoip2=auto \
    --disable-static \
    --with-cmocka \
    --with-libxml2 \
193
    --with-libjson \
194 195 196 197 198
    --prefix=$HOME/.local \
    --without-make-clean \
    $EXTRA_CONFIGURE \
    || cat config.log

Ondřej Surý's avatar
Ondřej Surý committed
199
.build: &build_job
200
  <<: *default_triggering_rules
Ondřej Surý's avatar
Ondřej Surý committed
201 202 203
  stage: build
  before_script:
    - test -w "${CCACHE_DIR}" && export PATH="/usr/lib/ccache:${PATH}"
Michal Nowak's avatar
Michal Nowak committed
204
    - test -n "${OOT_BUILD_WORKSPACE}" && mkdir "${OOT_BUILD_WORKSPACE}" && cd "${OOT_BUILD_WORKSPACE}"
Ondřej Surý's avatar
Ondřej Surý committed
205
  script:
206
    - *configure
207
    - make depend | grep "error:" && exit 1
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
  needs:
212
    - job: autoreconf
213
      artifacts: true
Ondřej Surý's avatar
Ondřej Surý committed
214 215
  artifacts:
    untracked: true
216
    expire_in: "1 day"
Ondřej Surý's avatar
Ondřej Surý committed
217

218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239
.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"
         "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'
240
  needs: []
241 242
  artifacts:
    untracked: true
243
    expire_in: "1 day"
244

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

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

256
.system_test_common: &system_test_common
257
  <<: *default_triggering_rules
258
  stage: system
Ondřej Surý's avatar
Ondřej Surý committed
259
  before_script:
260 261
    - *setup_interfaces
    - *setup_softhsm
Ondřej Surý's avatar
Ondřej Surý committed
262
  script:
263
    - ( cd bin/tests/system && make -j${TEST_PARALLEL_JOBS:-1} -k test V=1 )
264
    - test -s bin/tests/system/systests.output
265 266 267

.system_test: &system_test_job
  <<: *system_test_common
Ondřej Surý's avatar
Ondřej Surý committed
268 269
  artifacts:
    untracked: true
270
    expire_in: "1 day"
Ondřej Surý's avatar
Ondřej Surý committed
271 272
    when: on_failure

273 274 275 276 277 278 279 280 281 282 283 284 285
.system_test_tsan: &system_test_tsan_job
  <<: *system_test_common
  allow_failure: true
  after_script:
    - 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

286
.kyua_report: &kyua_report_html |
287
  kyua --logfile /dev/null report-html \
288 289 290 291 292
       --force \
       --results-file "$KYUA_RESULT" \
       --results-filter "" \
       --output kyua_html

293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309
.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
310
    expire_in: "1 day"
311 312
    when: on_failure
  only:
313
    - schedules
314 315 316
    - tags
    - web

317
.unit_test_common: &unit_test_common
318
  <<: *default_triggering_rules
319
  stage: unit
Ondřej Surý's avatar
Ondřej Surý committed
320
  before_script:
321
    - *setup_softhsm
Ondřej Surý's avatar
Ondřej Surý committed
322 323 324
  script:
    - make unit
  after_script:
325
    - *kyua_report_html
326 327 328

.unit_test: &unit_test_job
  <<: *unit_test_common
Ondřej Surý's avatar
Ondřej Surý committed
329
  artifacts:
Michal Nowak's avatar
Michal Nowak committed
330
    untracked: true
331
    expire_in: "1 day"
Ondřej Surý's avatar
Ondřej Surý committed
332 333
    when: on_failure

334 335 336 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:
    - *kyua_report_html
    - find lib -name 'tsan.*' -exec python3 util/parse_tsan.py {} \;
  artifacts:
    expire_in: "1 day"
    paths:
      - lib/*/tests/tsan.*
      - tsan/
      - kyua.log
      - kyua.results
      - kyua_html/
    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
Ondřej Surý's avatar
Ondřej Surý committed
390
  script:
391
    - sh util/check-ans-prereq.sh
Evan Hunt's avatar
Evan Hunt committed
392
    - sh util/checklibs.sh > checklibs.out
Mark Andrews's avatar
Mark Andrews committed
393 394
    - sh util/tabify-changes < CHANGES > CHANGES.tmp
    - diff -urNap CHANGES CHANGES.tmp
395
    - perl util/check-changes CHANGES
396 397 398 399
    - 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
Ondřej Surý's avatar
Ondřej Surý committed
400 401 402
    - perl -w util/merge_copyrights
    - diff -urNap util/copyrights util/newcopyrights
    - rm util/newcopyrights
403 404
    - 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
405 406
    - xmllint --noout --nonet `git ls-files '*.xml' '*.docbook'`
    - xmllint --noout --nonet --html `git ls-files '*.html'`
407
    - sh util/check-win32util-configure
408
    - sh util/check-categories.sh
409
  needs: []
Ondřej Surý's avatar
Ondřej Surý committed
410 411
  artifacts:
    paths:
412 413
      - util/newcopyrights
      - checklibs.out
414
    expire_in: "1 day"
Ondřej Surý's avatar
Ondřej Surý committed
415 416
    when: on_failure

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

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

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

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

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

470
tarball-create:
471
  stage: precheck
472
  <<: *base_image
473 474 475 476 477 478 479 480 481 482 483 484 485 486
  script:
    - source version
    - export BIND_DIRECTORY="bind-${MAJORVER}.${MINORVER}.${PATCHVER}${RELEASETYPE}${RELEASEVER}"
    - git archive --prefix="${BIND_DIRECTORY}/" --output="${BIND_DIRECTORY}.tar" HEAD
    - mkdir "${BIND_DIRECTORY}"
    - echo "SRCID=$(git rev-list --max-count=1 HEAD | cut -b1-7)" > "${BIND_DIRECTORY}/srcid"
    - tar --append --file="${BIND_DIRECTORY}.tar" "${BIND_DIRECTORY}/srcid"
    - ${TARBALL_COMPRESSOR} "${BIND_DIRECTORY}.tar"
  artifacts:
    paths:
      - bind-*.tar.${TARBALL_EXTENSION}
  only:
    - tags

Michał Kępień's avatar
Michał Kępień committed
487 488
# Jobs for doc builds on Debian Sid (amd64)

489
docs:
490
  <<: *release_branch_triggering_rules
491
  <<: *base_image
492
  stage: docs
Michał Kępień's avatar
Michał Kępień committed
493
  script:
494
    - ./configure || cat config.log
Michał Kępień's avatar
Michał Kępień committed
495 496
    - make -C doc/misc docbook
    - make -C doc/arm Bv9ARM.html
497
  needs:
498
    - job: autoreconf
499
      artifacts: true
Michał Kępień's avatar
Michał Kępień committed
500 501
  artifacts:
    paths:
502
      - doc/arm/
503
    expire_in: "1 month"
504

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

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

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

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

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

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

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

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

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

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

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

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

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

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

gcc:centos8:amd64:
  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 596 597 598 599 600 601
    EXTRA_CONFIGURE: "--with-libidn2"
  <<: *centos_centos8_amd64_image
  <<: *build_job

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

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

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

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

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

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

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

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

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

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

659 660 661 662 663 664 665 666 667 668
# Jobs for scan-build builds on Debian Buster (amd64)

.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

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

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

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

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

709
unit:gcc:sid:amd64:
Ondřej Surý's avatar
Ondřej Surý committed
710 711
  <<: *debian_sid_amd64_image
  <<: *unit_test_job
712 713 714
  needs:
    - job: gcc:sid:amd64
      artifacts: true
715

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

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

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

734 735
# Jobs for tarball GCC builds on Debian Sid (amd64)

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

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

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

776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799
# Jobs for regular GCC builds on Debian Sid (arm64)

gcc:sid:arm64:
  variables:
    CC: gcc
    CFLAGS: "${CFLAGS_COMMON} -Og"
    EXTRA_CONFIGURE: "--with-libidn2"
  <<: *debian_sid_arm64_image
  <<: *build_job

system:gcc:sid:arm64:
  <<: *debian_sid_arm64_image
  <<: *system_test_job
  needs:
    - job: gcc:sid:arm64
      artifacts: true

unit:gcc:sid:arm64:
  <<: *debian_sid_arm64_image
  <<: *unit_test_job
  needs:
    - job: gcc:sid:arm64
      artifacts: true

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

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

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

817
unit:gcc:sid:i386:
Ondřej Surý's avatar
Ondřej Surý committed
818 819
  <<: *debian_sid_i386_image
  <<: *unit_test_job
820 821 822
  needs:
    - job: gcc:sid:i386
      artifacts: true
Ondřej Surý's avatar
Ondřej Surý committed
823

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

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

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

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

848
# Jobs for regular GCC builds on Fedora 32 (amd64)
Michał Kępień's avatar
Michał Kępień committed
849

850
gcc:fedora32:amd64:
Michał Kępień's avatar
Michał Kępień committed
851 852
  variables:
    CC: gcc
Ondřej Surý's avatar
Ondřej Surý committed
853
    CFLAGS: "${CFLAGS_COMMON} -O1"
Michał Kępień's avatar
Michał Kępień committed
854
    EXTRA_CONFIGURE: "--with-libidn2"
855
  <<: *fedora_32_amd64_image
Michał Kępień's avatar
Michał Kępień committed
856 857
  <<: *build_job

858 859
system:gcc:fedora32:amd64:
  <<: *fedora_32_amd64_image
Michał Kępień's avatar
Michał Kępień committed
860
  <<: *system_test_job
861
  needs:
862
    - job: gcc:fedora32:amd64
863
      artifacts: true
Michał Kępień's avatar
Michał Kępień committed
864

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

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