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

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

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

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

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

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

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

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

76
77
# Alpine Linux

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

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

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

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

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

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

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

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

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

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

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

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

136
137
.ubuntu-bionic-amd64: &ubuntu_bionic_amd64_image
  image: "$CI_REGISTRY_IMAGE:ubuntu-bionic-amd64"
138
  <<: *linux_amd64
139

140
141
142
143
144
145
# 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
146
147
### Job Templates

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

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

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

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

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

194
.build: &build_job
195
  <<: *default_triggering_rules
196
  stage: build
197
  before_script:
198
    - 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}"
200
  script:
201
    - *configure
202
    - make -j${BUILD_PARALLEL_JOBS:-1} -k all V=1
203
    - test -z "${RUN_MAKE_INSTALL}" || make install
Mark Andrews's avatar
Mark Andrews committed
204
    - test -z "${RUN_MAKE_INSTALL}" || sh util/check-make-install
205
  needs:
206
    - job: autoreconf
207
      artifacts: true
208
209
  artifacts:
    untracked: true
210
    expire_in: "1 day"
211

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"
         "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'
235
  needs: []
236
237
  artifacts:
    untracked: true
238
    expire_in: "1 day"
239
    when: always
240

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

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

252
.system_test_common: &system_test_common
253
  <<: *default_triggering_rules
254
  stage: system
255
  before_script:
256
257
    - *setup_interfaces
    - *setup_softhsm
258
  script:
259
    - cd bin/tests/system
260
    - make -j${TEST_PARALLEL_JOBS:-1} -k check V=1 || make -j${TEST_PARALLEL_JOBS:-1} -k recheck V=1
261
262
  after_script:
    - cat bin/tests/system/test-suite.log
263
264
265

.system_test: &system_test_job
  <<: *system_test_common
266
267
  artifacts:
    untracked: true
268
    expire_in: "1 day"
269
270
    when: on_failure

271
272
273
274
.system_test_tsan: &system_test_tsan_job
  <<: *system_test_common
  allow_failure: true
  after_script:
275
    - cat bin/tests/system/test-suite.log
276
277
278
279
280
281
282
283
284
    - 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

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

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

316
.unit_test_common: &unit_test_common
317
  <<: *default_triggering_rules
318
  stage: unit
319
  before_script:
320
    - *setup_softhsm
321
  script:
322
    - make -j${TEST_PARALLEL_JOBS:-1} -k unit V=1
323
324
325

.unit_test: &unit_test_job
  <<: *unit_test_common
326
  artifacts:
Michal Nowak's avatar
Michal Nowak committed
327
    untracked: true
328
    expire_in: "1 day"
329
    when: on_failure
330

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

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

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

Michał Kępień's avatar
Michał Kępień committed
374
375
376
377
### Job Definitions

# Jobs in the precheck stage

378
autoreconf:
379
380
  <<: *autoconf_job

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

408
clang-format:
409
  <<: *precheck_job
410
  needs: []
411
  script:
412
    - if [ -r .clang-format ]; then "${CLANG_FORMAT}" -i -style=file $(git ls-files '*.c' '*.h'); fi
413
414
    - if test "$(git status --porcelain | grep -Ev '\?\?' | wc -l)" -gt "0"; then git status --short; exit 1; fi

415
coccinelle:
416
  <<: *precheck_job
417
  needs: []
418
419
420
  script:
    - util/check-cocci
    - if test "$(git status --porcelain | grep -Ev '\?\?' | wc -l)" -gt "0"; then git status --short; exit 1; fi
421

422
423
424
425
426
427
danger:
  <<: *precheck_job
  needs: []
  script:
    - danger-python ci -f
  only:
428
429
430
431
    refs:
      - merge_requests
    variables:
      - $DANGER_GITLAB_API_TOKEN
432

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

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

460
tarball-create:
461
  stage: precheck
462
  <<: *base_image
463
  script:
464
    - *configure
465
    - make -j${BUILD_PARALLEL_JOBS:-1} all V=1
466
    - make -j${BUILD_PARALLEL_JOBS:-1} dist V=1
467
468
  artifacts:
    paths:
469
      - bind-*.tar.${TARBALL_EXTENSION}
470
471
472
  needs:
    - job: autoreconf
      artifacts: true
473
474
475
  only:
    - tags

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

478
docs:
479
  <<: *release_branch_triggering_rules
480
  <<: *base_image
481
  stage: docs
482
483
484
  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
485
  script:
486
487
488
489
490
    - *configure
    - make -j${BUILD_PARALLEL_JOBS:-1} -k maintainer-clean V=1
    - *configure
    - make -j${BUILD_PARALLEL_JOBS:-1} -k all V=1
    - make -j${BUILD_PARALLEL_JOBS:-1} -k doc V=1
491
  needs:
492
    - job: autoreconf
493
      artifacts: true
494
  allow_failure: false
Michał Kępień's avatar
Michał Kępień committed
495
496
  artifacts:
    paths:
497
      - doc/arm/
498
499
      - doc/man/
      - doc/misc/
500
    expire_in: "1 month"
501

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

514
# Jobs for regular GCC builds on Alpine Linux 3.11 (amd64)
515

516
gcc:alpine3.11:amd64:
517
518
  variables:
    CC: gcc
Ondřej Surý's avatar
Ondřej Surý committed
519
    CFLAGS: "${CFLAGS_COMMON}"
520
    EXTRA_CONFIGURE: "--enable-dnstap"
521
  <<: *alpine_3_11_amd64_image
522
523
  <<: *build_job

524
525
system:gcc:alpine3.11:amd64:
  <<: *alpine_3_11_amd64_image
526
  <<: *system_test_job
527
528
529
  needs:
    - job: gcc:alpine3.11:amd64
      artifacts: true
530

531
532
unit:gcc:alpine3.11:amd64:
  <<: *alpine_3_11_amd64_image
533
  <<: *unit_test_job
534
535
536
  needs:
    - job: gcc:alpine3.11:amd64
      artifacts: true
537

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

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

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

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

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

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

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

unit:gcc:centos7:amd64:
  <<: *centos_centos7_amd64_image
  <<: *unit_test_job
582
583
584
  needs:
    - job: gcc:centos7:amd64
      artifacts: true
585

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

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

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

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

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

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

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

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

633
# Jobs for regular GCC builds on Debian 10 "buster" (amd64)
Michał Kępień's avatar
Michał Kępień committed
634
635
636
637

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

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

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

656
# Jobs for scan-build builds on Debian 10 "buster" (amd64)
657
658
659
660
661
662
663
664
665

.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

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

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

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

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

706
unit:gcc:sid:amd64:
707
708
  <<: *debian_sid_amd64_image
  <<: *unit_test_job
709
710
711
  needs:
    - job: gcc:sid:amd64
      artifacts: true
712

713
714
cppcheck:
  <<: *base_image
Ondřej Surý's avatar
Ondřej Surý committed
715
716
  <<: *cppcheck_job

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

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

731
# Jobs for tarball GCC builds on Debian 10 "buster" (amd64)
732

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

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

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

773
# Jobs for regular GCC builds on Debian "sid" (arm64)
Ondřej Surý's avatar
Ondřej Surý committed
774
775
776
777

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

system:gcc:sid:arm64:
  <<: *debian_sid_arm64_image
  <<: *system_test_job
786
787
788
  needs:
    - job: gcc:sid:arm64
      artifacts: true
Ondřej Surý's avatar
Ondřej Surý committed
789
790
791
792

unit:gcc:sid:arm64:
  <<: *debian_sid_arm64_image
  <<: *unit_test_job
793
794
795
  needs:
    - job: gcc:sid:arm64
      artifacts: true
Ondřej Surý's avatar
Ondřej Surý committed
796

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

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

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

814
unit:gcc:sid:i386:
815
816
  <<: *debian_sid_i386_image
  <<: *unit_test_job
817
818
819
  needs:
    - job: gcc:sid:i386
      artifacts: true
820

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

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

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

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

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

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

system:gcc:xenial:amd64:
  <<: *ubuntu_xenial_amd64_image
Michał Kępień's avatar
Michał Kępień committed
857
  <<: *system_test_job
858
859
860
  needs:
    - job: gcc:xenial:amd64
      artifacts: true
Michał Kępień's avatar
Michał Kępień committed
861

Michał Kępień's avatar
Michał Kępień committed
862
863
864
unit:gcc:xenial:amd64:
  <<: *ubuntu_xenial_amd64_image
  <<: *unit_test_job
865
866
867
  needs:
    - job: gcc:xenial:amd64
      artifacts: true
Michał Kępień's avatar
Michał Kępień committed
868

Michał Kępień's avatar
Michał Kępień committed
869
870
# Jobs for regular GCC builds on Ubuntu 18.04 Bionic Beaver (amd64)

Michał Kępień's avatar
Michał Kępień committed
871
872
873
gcc:bionic:amd64:
  variables:
    CC: gcc
Ondřej Surý's avatar
Ondřej Surý committed
874
    CFLAGS: "${CFLAGS_COMMON} -Og"
Michał Kępień's avatar
Michał Kępień committed
875
876
877
878
879
880
    EXTRA_CONFIGURE: "--with-libidn2"
  <<: *ubuntu_bionic_amd64_image
  <<: *build_job

system:gcc:bionic:amd64:
  <<: *ubuntu_bionic_amd64_image
881
  <<: *system_test_job
882
883
884
  needs:
    - job: gcc:bionic:amd64
      artifacts: true
885

Michał Kępień's avatar
Michał Kępień committed
886
887
888
unit:gcc:bionic:amd64:
  <<: *ubuntu_bionic_amd64_image
  <<: *unit_test_job
889
890
891
  needs:
    - job: gcc:bionic:amd64
      artifacts: true
892

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

895
gcc:asan:
Michał Kępień's avatar
Michał Kępień committed
896
897
  variables:
    CC: gcc
Ondřej Surý's avatar
Ondřej Surý committed
898
    CFLAGS: "${CFLAGS_COMMON} -fsanitize=address,undefined -DISC_MEM_USE_INTERNAL_MALLOC=0"
Michał Kępień's avatar
Michał Kępień committed
899
900
    LDFLAGS: "-fsanitize=address,undefined"
    EXTRA_CONFIGURE: "--with-libidn2"
901
  <<: *base_image
Michał Kępień's avatar
Michał Kępień committed
902
  <<: *build_job
903

904
system:gcc:asan:
905
906
  variables:
    ASAN_OPTIONS: ${ASAN_OPTIONS_COMMON}
907
  <<: *base_image
908
  <<: *system_test_job
909
  needs:
910
    - job: gcc:asan
911
      artifacts: true
912

913
unit:gcc:asan:
914
915
  variables:
    ASAN_OPTIONS: ${ASAN_OPTIONS_COMMON}
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
  <<: *base_image
  <<: *unit_test_job
  needs:
    - job: gcc:asan
      artifacts: true

clang:asan:
  variables:
    CC: ${CLANG}
    CFLAGS: "${CFLAGS_COMMON} -fsanitize=address,undefined -DISC_MEM_USE_INTERNAL_MALLOC=0"
    LDFLAGS: "-fsanitize=address,undefined"
    EXTRA_CONFIGURE: "--with-libidn2"
  <<: *base_image
  <<: *build_job

system:clang:asan:
  variables:
    ASAN_OPTIONS: ${ASAN_OPTIONS_COMMON}
  <<: *base_image
  <<: *system_test_job
  needs:
937
    - job: clang:asan
938
939
940
941
942
943
      artifacts: true

unit:clang:asan:
  variables:
    ASAN_OPTIONS: ${ASAN_OPTIONS_COMMON}
  <<: *base_image
Michał Kępień's avatar
Michał Kępień committed
944
  <<: *unit_test_job
945
  needs:
946
    - job: clang:asan
947
      artifacts: true
948

949
# Jobs for TSAN builds on Debian 10 "buster" (amd64)
950

951
952
gcc:tsan:
  <<: *base_image
953
954
  <<: *build_job
  variables:
955
    CC: gcc
956
957
958
959
    CFLAGS: "${CFLAGS_COMMON} -fsanitize=thread -DISC_MEM_USE_INTERNAL_MALLOC=0"
    LDFLAGS: "-fsanitize=thread"
    EXTRA_CONFIGURE: "--with-libidn2 --enable-pthread-rwlock"

960
system:gcc:tsan:
961
  variables:
962
    TSAN_OPTIONS: ${TSAN_OPTIONS_COMMON}
963
  <<: *base_image