.gitlab-ci.yml 34.1 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 21
  CLANG: clang-10
  SCAN_BUILD: scan-build-10
  SYMBOLIZER: /usr/lib/llvm-10/bin/llvm-symbolizer
Ondřej Surý's avatar
Ondřej Surý committed
22
  ASAN_SYMBOLIZER_PATH: /usr/lib/llvm-10/bin/llvm-symbolizer
23
  CLANG_FORMAT: clang-format-10
Ondřej Surý's avatar
Ondřej Surý committed
24

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

27 28
  # 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
29
  TSAN_OPTIONS_COMMON: "second_deadlock_stack=1 history_size=7 log_exe_name=true log_path=tsan external_symbolizer_path=$SYMBOLIZER"
30

31 32 33
  TARBALL_COMPRESSOR: gzip
  TARBALL_EXTENSION: gz

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

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

Michał Kępień's avatar
Michał Kępień committed
46
# Note: BSD runners extract the operating system version to use from job name
Michał Kępień's avatar
Michał Kępień committed
47 48 49

.freebsd-amd64: &freebsd_amd64
  tags:
50
    - libvirt
Michał Kępień's avatar
Michał Kępień committed
51 52
    - amd64

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

58 59 60 61 62
.linux-arm64: &linux_arm64
  tags:
    - linux
    - arm64

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

Michał Kępień's avatar
Michał Kępień committed
68 69
.openbsd-amd64: &openbsd_amd64
  tags:
70
    - libvirt
Michał Kępień's avatar
Michał Kępień committed
71 72
    - amd64

Michał Kępień's avatar
Michał Kępień committed
73 74
### Docker Image Templates

75 76
# Alpine Linux

77 78
.alpine-3.11-amd64: &alpine_3_11_amd64_image
  image: "$CI_REGISTRY_IMAGE:alpine-3.11-amd64"
79 80
  <<: *linux_amd64

Michał Kępień's avatar
Michał Kępień committed
81 82
# CentOS

83 84 85 86 87 88 89
.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
90

Michał Kępień's avatar
Michał Kępień committed
91 92 93 94
.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
95 96
# Debian

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

Michał Kępień's avatar
Michał Kępień committed
101 102
.debian-buster-amd64: &debian_buster_amd64_image
  image: "$CI_REGISTRY_IMAGE:debian-buster-amd64"
103
  <<: *linux_amd64
Michał Kępień's avatar
Michał Kępień committed
104

Ondřej Surý's avatar
Ondřej Surý committed
105 106
.debian-sid-amd64: &debian_sid_amd64_image
  image: "$CI_REGISTRY_IMAGE:debian-sid-amd64"
107
  <<: *linux_amd64
Ondřej Surý's avatar
Ondřej Surý committed
108

109 110 111 112
.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
113 114
.debian-sid-i386: &debian_sid_i386_image
  image: "$CI_REGISTRY_IMAGE:debian-sid-i386"
115
  <<: *linux_i386
Ondřej Surý's avatar
Ondřej Surý committed
116

117 118 119 120 121 122
# 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
123 124
# Fedora

Michal Nowak's avatar
Michal Nowak committed
125 126
.fedora-31-amd64: &fedora_31_amd64_image
  image: "$CI_REGISTRY_IMAGE:fedora-31-amd64"
Michał Kępień's avatar
Michał Kępień committed
127 128
  <<: *linux_amd64

Michał Kępień's avatar
Michał Kępień committed
129 130
# Ubuntu

131 132
.ubuntu-xenial-amd64: &ubuntu_xenial_amd64_image
  image: "$CI_REGISTRY_IMAGE:ubuntu-xenial-amd64"
133
  <<: *linux_amd64
Ondřej Surý's avatar
Ondřej Surý committed
134

135 136
.ubuntu-bionic-amd64: &ubuntu_bionic_amd64_image
  image: "$CI_REGISTRY_IMAGE:ubuntu-bionic-amd64"
137
  <<: *linux_amd64
Ondřej Surý's avatar
Ondřej Surý committed
138

139 140 141 142 143 144
# Base image
# This is a meta image that is used as a base for non-specific jobs

.base: &base_image
  <<: *debian_buster_amd64_image

Michał Kępień's avatar
Michał Kępień committed
145 146
### Job Templates

147 148 149 150 151
.default-triggering-rules: &default_triggering_rules
  only:
    - merge_requests
    - tags
    - web
152
    - schedules
153

154 155 156 157 158
.release-branch-triggering-rules: &release_branch_triggering_rules
  only:
    - merge_requests
    - tags
    - web
159
    - schedules
160 161 162
    - master@isc-projects/bind9
    - /^v9_[1-9][0-9]$/@isc-projects/bind9

163
.precheck: &precheck_job
164
  <<: *default_triggering_rules
165
  <<: *base_image
166 167
  stage: precheck

168
.autoconf: &autoconf_job
169
  <<: *release_branch_triggering_rules
170
  <<: *base_image
171 172 173 174
  stage: precheck
  script:
    - autoreconf -fi
  artifacts:
175
    untracked: true
176
    expire_in: "1 day"
177 178

.configure: &configure |
179
    ${CONFIGURE} \
180 181 182 183 184 185 186 187 188 189 190 191 192 193
    --disable-maintainer-mode \
    --enable-developer \
    --with-randomdev=/dev/urandom \
    --with-libtool \
    --with-geoip2=auto \
    --disable-static \
    --with-cmocka \
    --with-libxml2 \
    --with-json \
    --prefix=$HOME/.local \
    --without-make-clean \
    $EXTRA_CONFIGURE \
    || cat config.log

Ondřej Surý's avatar
Ondřej Surý committed
194
.build: &build_job
195
  <<: *default_triggering_rules
Ondřej Surý's avatar
Ondřej Surý committed
196 197 198
  stage: build
  before_script:
    - test -w "${CCACHE_DIR}" && export PATH="/usr/lib/ccache:${PATH}"
Michal Nowak's avatar
Michal Nowak committed
199
    - test -n "${OOT_BUILD_WORKSPACE}" && mkdir "${OOT_BUILD_WORKSPACE}" && cd "${OOT_BUILD_WORKSPACE}"
Ondřej Surý's avatar
Ondřej Surý committed
200
  script:
201
    - *configure
202
    - make depend | grep "error:" && exit 1
203
    - make -j${BUILD_PARALLEL_JOBS:-1} -k all V=1
204
    - test -z "${RUN_MAKE_INSTALL}" || make install
Mark Andrews's avatar
Mark Andrews committed
205
    - test -z "${RUN_MAKE_INSTALL}" || sh util/check-make-install
206
  needs:
207
    - job: autoreconf
208
      artifacts: true
Ondřej Surý's avatar
Ondřej Surý committed
209 210
  artifacts:
    untracked: true
211
    expire_in: "1 day"
Ondřej Surý's avatar
Ondřej Surý committed
212

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

240 241
.setup_interfaces: &setup_interfaces |
    if [ "$(id -u)" -eq "0" ]; then
242
      sh -x bin/tests/system/ifconfig.sh up;
243
    else
244
      sudo sh -x bin/tests/system/ifconfig.sh up;
245 246 247
    fi

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

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

.system_test: &system_test_job
  <<: *system_test_common
Ondřej Surý's avatar
Ondřej Surý committed
263 264
  artifacts:
    untracked: true
265
    expire_in: "1 day"
Ondřej Surý's avatar
Ondřej Surý committed
266 267
    when: on_failure

268 269 270 271 272 273 274 275 276 277 278 279 280
.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

281
.kyua_report: &kyua_report_html |
282
  kyua --logfile /dev/null report-html \
283 284 285 286 287
       --force \
       --results-file "$KYUA_RESULT" \
       --results-filter "" \
       --output kyua_html

288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304
.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
305
    expire_in: "1 day"
306 307
    when: on_failure
  only:
308
    - schedules
309 310 311
    - tags
    - web

312
.unit_test_common: &unit_test_common
313
  <<: *default_triggering_rules
314
  stage: unit
Ondřej Surý's avatar
Ondřej Surý committed
315
  before_script:
316
    - *setup_softhsm
Ondřej Surý's avatar
Ondřej Surý committed
317 318 319
  script:
    - make unit
  after_script:
320
    - *kyua_report_html
321 322 323

.unit_test: &unit_test_job
  <<: *unit_test_common
Ondřej Surý's avatar
Ondřej Surý committed
324
  artifacts:
Michal Nowak's avatar
Michal Nowak committed
325
    untracked: true
326
    expire_in: "1 day"
Ondřej Surý's avatar
Ondřej Surý committed
327 328
    when: on_failure

329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344
.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
345
.cppcheck_args: &run_cppcheck |
346
  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
347 348

.cppcheck_report: &cppcheck_report_html |
349
  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
350 351 352 353

.cppcheck: &cppcheck_job
  <<: *default_triggering_rules
  stage: postcheck
354
  script:
355 356 357
    # 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
358 359
    - *configure
    - (make -nwk all || true) | compiledb
360
    - 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
361
    - sed -i "/gcc\",/a\"-DCPPCHECK\", \"-D__STDC__\", \"-D__GNUC__=${GCC_VERSION}\"," compile_commands.json
Ondřej Surý's avatar
Ondřej Surý committed
362
    - *run_cppcheck
363
  after_script:
Ondřej Surý's avatar
Ondřej Surý committed
364 365 366 367 368 369
    - *cppcheck_report_html
  artifacts:
    paths:
      - compile_commands.json
      - cppcheck.results
      - cppcheck_html/
370
    expire_in: "1 day"
Ondřej Surý's avatar
Ondřej Surý committed
371
    when: on_failure
372 373 374
  needs:
    - job: autoreconf
      artifacts: true
Ondřej Surý's avatar
Ondřej Surý committed
375

Michał Kępień's avatar
Michał Kępień committed
376 377 378 379
### Job Definitions

# Jobs in the precheck stage

380
autoreconf:
381 382
  <<: *autoconf_job

383
misc:
384
  <<: *precheck_job
Ondřej Surý's avatar
Ondřej Surý committed
385
  script:
386
    - sh util/check-ans-prereq.sh
Evan Hunt's avatar
Evan Hunt committed
387
    - sh util/checklibs.sh > checklibs.out
Mark Andrews's avatar
Mark Andrews committed
388 389
    - sh util/tabify-changes < CHANGES > CHANGES.tmp
    - diff -urNap CHANGES CHANGES.tmp
390
    - perl util/check-changes CHANGES
391 392 393 394
    - 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
395 396 397
    - perl -w util/merge_copyrights
    - diff -urNap util/copyrights util/newcopyrights
    - rm util/newcopyrights
398 399
    - 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
400 401
    - xmllint --noout --nonet `git ls-files '*.xml' '*.docbook'`
    - xmllint --noout --nonet --html `git ls-files '*.html'`
402
    - sh util/check-win32util-configure
403
    - sh util/check-categories.sh
404
  needs: []
Ondřej Surý's avatar
Ondřej Surý committed
405 406
  artifacts:
    paths:
407 408
      - util/newcopyrights
      - checklibs.out
409
    expire_in: "1 day"
Ondřej Surý's avatar
Ondřej Surý committed
410 411
    when: on_failure

412 413 414 415 416 417 418 419
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:
420
  <<: *precheck_job
421
  needs: []
422 423 424
  script:
    - util/check-cocci
    - if test "$(git status --porcelain | grep -Ev '\?\?' | wc -l)" -gt "0"; then git status --short; exit 1; fi
425

426 427 428 429 430 431 432 433
danger:
  <<: *precheck_job
  needs: []
  script:
    - danger-python ci -f
  only:
    - merge_requests

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

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

462
tarball-create:
463
  stage: precheck
464
  <<: *base_image
465 466 467 468 469 470 471 472 473 474 475 476 477 478
  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
479 480
# Jobs for doc builds on Debian Sid (amd64)

481
docs:
482
  <<: *release_branch_triggering_rules
483
  <<: *base_image
484
  stage: docs
Michał Kępień's avatar
Michał Kępień committed
485
  script:
486
    - ./configure || cat config.log
Michał Kępień's avatar
Michał Kępień committed
487 488
    - make -C doc/misc docbook
    - make -C doc/arm Bv9ARM.html
489
  needs:
490
    - job: autoreconf
491
      artifacts: true
Michał Kępień's avatar
Michał Kępień committed
492 493
  artifacts:
    paths:
494
      - doc/arm/
495
    expire_in: "1 month"
496

497 498
push:docs:
  <<: *base_image
499
  stage: push
500
  needs:
501
    - job: docs
502
      artifacts: false
503 504 505
  script:
    - curl -X POST -F token=$GITLAB_PAGES_DOCS_TRIGGER_TOKEN -F ref=master $GITLAB_PAGES_DOCS_TRIGGER_URL
  only:
506 507
    - master@isc-projects/bind9
    - /^v9_[1-9][0-9]$/@isc-projects/bind9
Michał Kępień's avatar
Michał Kępień committed
508

509
# Jobs for regular GCC builds on Alpine Linux 3.11 (amd64)
510

511
gcc:alpine3.11:amd64:
512 513
  variables:
    CC: gcc
Ondřej Surý's avatar
Ondřej Surý committed
514
    CFLAGS: "${CFLAGS_COMMON}"
515
    EXTRA_CONFIGURE: "--enable-dnstap"
516
  <<: *alpine_3_11_amd64_image
517 518
  <<: *build_job

519 520
system:gcc:alpine3.11:amd64:
  <<: *alpine_3_11_amd64_image
521
  <<: *system_test_job
522 523 524
  needs:
    - job: gcc:alpine3.11:amd64
      artifacts: true
525

526 527
unit:gcc:alpine3.11:amd64:
  <<: *alpine_3_11_amd64_image
528
  <<: *unit_test_job
529 530 531
  needs:
    - job: gcc:alpine3.11:amd64
      artifacts: true
532

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

535
gcc:centos6:amd64:
Michał Kępień's avatar
Michał Kępień committed
536 537
  variables:
    CC: gcc
Ondřej Surý's avatar
Ondřej Surý committed
538
    CFLAGS: "${CFLAGS_COMMON}"
539
    EXTRA_CONFIGURE: "--with-libidn2 --disable-warn-error"
Michał Kępień's avatar
Michał Kępień committed
540 541 542
  <<: *centos_centos6_amd64_image
  <<: *build_job

Michał Kępień's avatar
Michał Kępień committed
543 544 545
system:gcc:centos6:amd64:
  <<: *centos_centos6_amd64_image
  <<: *system_test_job
546 547 548
  needs:
    - job: gcc:centos6:amd64
      artifacts: true
Michał Kępień's avatar
Michał Kępień committed
549 550 551 552

unit:gcc:centos6:amd64:
  <<: *centos_centos6_amd64_image
  <<: *unit_test_job
553 554 555
  needs:
    - job: gcc:centos6:amd64
      artifacts: true
Michał Kępień's avatar
Michał Kępień committed
556

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

559
gcc:centos7:amd64:
Michał Kępień's avatar
Michał Kępień committed
560 561
  variables:
    CC: gcc
Ondřej Surý's avatar
Ondřej Surý committed
562
    CFLAGS: "${CFLAGS_COMMON}"
Michał Kępień's avatar
Michał Kępień committed
563
    EXTRA_CONFIGURE: "--enable-dnstap --with-libidn2"
Michał Kępień's avatar
Michał Kępień committed
564 565 566
  <<: *centos_centos7_amd64_image
  <<: *build_job

Michał Kępień's avatar
Michał Kępień committed
567 568 569
system:gcc:centos7:amd64:
  <<: *centos_centos7_amd64_image
  <<: *system_test_job
570 571 572
  needs:
    - job: gcc:centos7:amd64
      artifacts: true
Michał Kępień's avatar
Michał Kępień committed
573 574 575 576

unit:gcc:centos7:amd64:
  <<: *centos_centos7_amd64_image
  <<: *unit_test_job
577 578 579
  needs:
    - job: gcc:centos7:amd64
      artifacts: true
580

Michał Kępień's avatar
Michał Kępień committed
581 582 583 584 585
# Jobs for regular GCC builds on CentOS 8 (amd64)

gcc:centos8:amd64:
  variables:
    CC: gcc
Ondřej Surý's avatar
Ondřej Surý committed
586
    CFLAGS: "${CFLAGS_COMMON}"
Michał Kępień's avatar
Michał Kępień committed
587 588 589 590 591 592 593
    EXTRA_CONFIGURE: "--with-libidn2"
  <<: *centos_centos8_amd64_image
  <<: *build_job

system:gcc:centos8:amd64:
  <<: *centos_centos8_amd64_image
  <<: *system_test_job
594 595 596
  needs:
    - job: gcc:centos8:amd64
      artifacts: true
Michał Kępień's avatar
Michał Kępień committed
597 598 599 600

unit:gcc:centos8:amd64:
  <<: *centos_centos8_amd64_image
  <<: *unit_test_job
601 602 603
  needs:
    - job: gcc:centos8:amd64
      artifacts: true
Michał Kępień's avatar
Michał Kępień committed
604

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

607
gcc:stretch:amd64:
608 609
  variables:
    CC: gcc
Ondřej Surý's avatar
Ondřej Surý committed
610
    CFLAGS: "${CFLAGS_COMMON} -O2"
611 612 613
  <<: *debian_stretch_amd64_image
  <<: *build_job

Michał Kępień's avatar
Michał Kępień committed
614 615 616
system:gcc:stretch:amd64:
  <<: *debian_stretch_amd64_image
  <<: *system_test_job
617 618 619
  needs:
    - job: gcc:stretch:amd64
      artifacts: true
Michał Kępień's avatar
Michał Kępień committed
620 621 622 623

unit:gcc:stretch:amd64:
  <<: *debian_stretch_amd64_image
  <<: *unit_test_job
624 625 626
  needs:
    - job: gcc:stretch:amd64
      artifacts: true
Michał Kępień's avatar
Michał Kępień committed
627

Michał Kępień's avatar
Michał Kępień committed
628 629 630 631 632
# 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
633
    CFLAGS: "${CFLAGS_COMMON}"
Michał Kępień's avatar
Michał Kępień committed
634 635 636 637 638 639
  <<: *debian_buster_amd64_image
  <<: *build_job

system:gcc:buster:amd64:
  <<: *debian_buster_amd64_image
  <<: *system_test_job
640 641 642
  needs:
    - job: gcc:buster:amd64
      artifacts: true
Michał Kępień's avatar
Michał Kępień committed
643 644 645 646

unit:gcc:buster:amd64:
  <<: *debian_buster_amd64_image
  <<: *unit_test_job
647 648 649
  needs:
    - job: gcc:buster:amd64
      artifacts: true
Michał Kępień's avatar
Michał Kępień committed
650

651 652 653 654 655 656 657 658 659 660
# 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

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

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

685
gcc:sid:amd64:
686 687
  variables:
    CC: gcc
Ondřej Surý's avatar
Ondřej Surý committed
688
    CFLAGS: "${CFLAGS_COMMON} -O3"
689
    EXTRA_CONFIGURE: "--enable-dnstap --with-libidn2 --without-lmdb"
690
    RUN_MAKE_INSTALL: 1
Ondřej Surý's avatar
Ondřej Surý committed
691 692
  <<: *debian_sid_amd64_image
  <<: *build_job
693

Michał Kępień's avatar
Michał Kępień committed
694 695 696
system:gcc:sid:amd64:
  <<: *debian_sid_amd64_image
  <<: *system_test_job
697 698 699
  needs:
    - job: gcc:sid:amd64
      artifacts: true
700

701
unit:gcc:sid:amd64:
Ondřej Surý's avatar
Ondřej Surý committed
702 703
  <<: *debian_sid_amd64_image
  <<: *unit_test_job
704 705 706
  needs:
    - job: gcc:sid:amd64
      artifacts: true
707

708 709
cppcheck:
  <<: *base_image
Ondřej Surý's avatar
Ondřej Surý committed
710 711
  <<: *cppcheck_job

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

715
gcc:out-of-tree:
Michal Nowak's avatar
Michal Nowak committed
716 717
  variables:
    CC: gcc
718
    CFLAGS: "${CFLAGS_COMMON} -Og"
Michal Nowak's avatar
Michal Nowak committed
719
    CONFIGURE: ../configure
720
    EXTRA_CONFIGURE: "--enable-dnstap --with-libidn2 --with-lmdb"
Michal Nowak's avatar
Michal Nowak committed
721 722
    RUN_MAKE_INSTALL: 1
    OOT_BUILD_WORKSPACE: workspace
723
  <<: *base_image
Michal Nowak's avatar
Michal Nowak committed
724 725
  <<: *build_job

726 727
# Jobs for tarball GCC builds on Debian Sid (amd64)

728
gcc:tarball:
729 730 731 732
  variables:
    CC: gcc
    EXTRA_CONFIGURE: "--enable-dnstap --with-libidn2"
    RUN_MAKE_INSTALL: 1
733
  <<: *base_image
734 735 736 737 738
  <<: *build_job
  before_script:
    - tar --extract --file bind-*.tar.${TARBALL_EXTENSION}
    - rm -f bind-*.tar.${TARBALL_EXTENSION}
    - cd bind-*
739
  needs:
740
    - job: tarball-create
741
      artifacts: true
742 743 744
  only:
    - tags

745
system:gcc:tarball:
746
  <<: *base_image
747 748 749 750
  <<: *system_test_job
  before_script:
    - cd bind-*
    - *setup_interfaces
751
  needs:
752
    - job: gcc:tarball
753
      artifacts: true
754 755 756
  only:
    - tags

757
unit:gcc:tarball:
758
  <<: *base_image
759 760 761
  <<: *unit_test_job
  before_script:
    - cd bind-*
762
  needs:
763
    - job: gcc:tarball
764
      artifacts: true
765 766 767
  only:
    - tags

768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791
# 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
792 793
# Jobs for regular GCC builds on Debian Sid (i386)

Michał Kępień's avatar
Michał Kępień committed
794 795 796
gcc:sid:i386:
  variables:
    CC: gcc
Ondřej Surý's avatar
Ondřej Surý committed
797
    CFLAGS: "${CFLAGS_COMMON}"
798
    EXTRA_CONFIGURE: "--with-libidn2 --without-python"
Michał Kępień's avatar
Michał Kępień committed
799 800
  <<: *debian_sid_i386_image
  <<: *build_job
801

Michał Kępień's avatar
Michał Kępień committed
802 803 804
system:gcc:sid:i386:
  <<: *debian_sid_i386_image
  <<: *system_test_job
805 806 807
  needs:
    - job: gcc:sid:i386
      artifacts: true
808

809
unit:gcc:sid:i386:
Ondřej Surý's avatar
Ondřej Surý committed
810 811
  <<: *debian_sid_i386_image
  <<: *unit_test_job
812 813 814
  needs:
    - job: gcc:sid:i386
      artifacts: true
Ondřej Surý's avatar
Ondřej Surý committed
815

816 817 818 819 820 821 822 823 824 825 826 827 828
# Jobs for regular GCC builds on openSUSE Tumbleweed (amd64)

gcc:tumbleweed:amd64:
  variables:
    CC: gcc
    CFLAGS: "${CFLAGS_COMMON}"
    EXTRA_CONFIGURE: "--with-libidn2"
  <<: *tumbleweed_latest_amd64_image
  <<: *build_job

system:gcc:tumbleweed:amd64:
  <<: *tumbleweed_latest_amd64_image
  <<: *system_test_job
829 830 831
  needs:
    - job: gcc:tumbleweed:amd64
      artifacts: true
832 833 834 835

unit:gcc:tumbleweed:amd64:
  <<: *tumbleweed_latest_amd64_image
  <<: *unit_test_job
836 837 838
  needs:
    - job: gcc:tumbleweed:amd64
      artifacts: true
839

Michal Nowak's avatar
Michal Nowak committed
840
# Jobs for regular GCC builds on Fedora 31 (amd64)
Michał Kępień's avatar
Michał Kępień committed
841

Michal Nowak's avatar
Michal Nowak committed
842
gcc:fedora31:amd64:
Michał Kępień's avatar
Michał Kępień committed
843 844
  variables:
    CC: gcc
Ondřej Surý's avatar
Ondřej Surý committed
845
    CFLAGS: "${CFLAGS_COMMON} -O1"
Michał Kępień's avatar
Michał Kępień committed
846
    EXTRA_CONFIGURE: "--with-libidn2"
Michal Nowak's avatar
Michal Nowak committed
847
  <<: *fedora_31_amd64_image
Michał Kępień's avatar
Michał Kępień committed
848 849
  <<: *build_job

Michal Nowak's avatar
Michal Nowak committed
850 851
system:gcc:fedora31:amd64:
  <<: *fedora_31_amd64_image
Michał Kępień's avatar
Michał Kępień committed
852
  <<: *system_test_job
853 854 855
  needs:
    - job: gcc:fedora31:amd64
      artifacts: true
Michał Kępień's avatar
Michał Kępień committed
856

Michal Nowak's avatar
Michal Nowak committed
857 858
unit:gcc:fedora31:amd64:
  <<: *fedora_31_amd64_image
Michał Kępień's avatar
Michał Kępień committed
859
  <<: *unit_test_job
860 861 862
  needs:
    - job: gcc:fedora31:amd64
      artifacts: true
Michał Kępień's avatar
Michał Kępień committed
863

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

Michał Kępień's avatar
Michał Kępień committed
866 867 868
gcc:xenial:amd64:
  variables:
    CC: gcc
Ondřej Surý's avatar
Ondřej Surý committed
869
    CFLAGS: "${CFLAGS_COMMON} -O2"
870
    EXTRA_CONFIGURE: "--disable-geoip"
Michał Kępień's avatar
Michał Kępień committed
871 872 873 874 875
  <<: *ubuntu_xenial_amd64_image
  <<: *build_job

system:gcc:xenial:amd64:
  <<: *ubuntu_xenial_amd64_image
Michał Kępień's avatar
Michał Kępień committed
876
  <<: *system_test_job
877 878 879
  needs:
    - job: gcc:xenial:amd64
      artifacts: true
Michał Kępień's avatar
Michał Kępień committed
880

Michał Kępień's avatar
Michał Kępień committed
881 882 883
unit:gcc:xenial:amd64:
  <<: *ubuntu_xenial_amd64_image
  <<: *unit_test_job
884 885 886
  needs:
    - job: gcc:xenial:amd64
      artifacts: true
887