knot-dns/.gitlab-ci.yml
2025-05-22 18:17:50 +02:00

424 lines
8.3 KiB
YAML

variables:
DEBIAN_FRONTEND: noninteractive
LC_ALL: C
GIT_STRATEGY: fetch
DOCKER_DRIVER: overlay2
GIT_SUBMODULE_STRATEGY: recursive
DISTROTEST_PRIORITY: 6
PKGTEST: 0
stages:
- image
- build
- test
- pkg
- documentation
.image: &image
stage: image
before_script:
- docker info
script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker build --no-cache -t "$IMAGE_TAG" "scripts/docker/$IMAGE_NAME-$IMAGE_VER"
- docker push "$IMAGE_TAG"
tags:
- dind
only:
variables:
- $SCHEDULE_TYPE == "weekly"
docker:knot-dns:debian:
<<: *image
variables:
IMAGE_NAME: debian
IMAGE_VER: latest
IMAGE_TAG: $CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_VER
tags:
- dind
- amd64
docker:knot-dns:debian-arm64:
<<: *image
variables:
IMAGE_NAME: debian
IMAGE_VER: latest
IMAGE_TAG: $CI_REGISTRY_IMAGE/$IMAGE_NAME-arm64:$IMAGE_VER
tags:
- dind
- arm64
docker:knot-dns:debian:unstable:
<<: *image
variables:
IMAGE_NAME: debian
IMAGE_VER: unstable
IMAGE_TAG: $CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_VER
tags:
- dind
- amd64
docker:knot-dns:ubuntu:
<<: *image
variables:
IMAGE_NAME: ubuntu
IMAGE_VER: latest
IMAGE_TAG: $CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_VER
tags:
- dind
- amd64
docker:knot-dns:rocky:
<<: *image
variables:
IMAGE_NAME: rocky
IMAGE_VER: latest
IMAGE_TAG: $CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_VER
tags:
- dind
- amd64
docker:knot-dns:fedora:
<<: *image
variables:
IMAGE_NAME: fedora
IMAGE_VER: latest
IMAGE_TAG: $CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_VER
tags:
- dind
- amd64
.fedora_latest: &fedora_latest
image: "$CI_REGISTRY/knot/knot-dns/fedora:latest"
tags:
- docker
- linux
- amd64
except:
- schedules
.rocky_latest: &rocky_latest
image: "$CI_REGISTRY/knot/knot-dns/rocky:latest"
tags:
- docker
- linux
- amd64
except:
- schedules
.debian_stable: &debian_stable
image: "$CI_REGISTRY/knot/knot-dns/debian:latest"
tags:
- docker
- linux
- amd64
except:
- schedules
.debian_stable_arm64: &debian_stable_arm64
image: "$CI_REGISTRY/knot/knot-dns/debian-arm64:latest"
tags:
- docker
- linux
- arm64
except:
- schedules
.debian_unstable: &debian_unstable
image: "$CI_REGISTRY/knot/knot-dns/debian:unstable"
tags:
- docker
- linux
- amd64
except:
- schedules
.ubuntu_latest: &ubuntu_latest
image: "$CI_REGISTRY/knot/knot-dns/ubuntu:latest"
tags:
- docker
- linux
- amd64
except:
- schedules
.build: &build_job
stage: build
script:
- autoreconf -fi
- ./configure --disable-fastparser --enable-quic $EXTRA_CONFIGURE || ( cat config.log && exit 1 )
- make all V=1
artifacts:
untracked: true
expire_in: '1 hour'
except:
- schedules
.test: &test_job
stage: test
before_script:
- find -exec touch -t $(date +%m%d%H%M) {} \;
script:
- make check V=1
except:
- schedules
build:fedora:amd64:
<<: *fedora_latest
<<: *build_job
test:fedora:amd64:
<<: *fedora_latest
<<: *test_job
dependencies:
- build:fedora:amd64
build:rocky:amd64:
<<: *rocky_latest
<<: *build_job
test:rocky:amd64:
<<: *rocky_latest
<<: *test_job
dependencies:
- build:rocky:amd64
build:ubuntu:amd64:
<<: *ubuntu_latest
<<: *build_job
test:ubuntu:amd64:
<<: *ubuntu_latest
<<: *test_job
dependencies:
- build:ubuntu:amd64
build:debian:amd64:
variables:
EXTRA_CONFIGURE: --enable-xdp=yes
<<: *debian_stable
<<: *build_job
except: # run on schedules as well, for debian:symbols tests
test:debian:amd64:
<<: *debian_stable
<<: *test_job
dependencies:
- build:debian:amd64
build:debian:arm64:
<<: *debian_stable_arm64
<<: *build_job
test:debian:arm64:
<<: *debian_stable_arm64
<<: *test_job
dependencies:
- build:debian:arm64
build:debian:unstable:amd64:
<<: *debian_unstable
<<: *build_job
test:debian:unstable:amd64:
<<: *debian_unstable
<<: *test_job
dependencies:
- build:debian:unstable:amd64
build:debian:unstable:amd64:asan:
variables:
CC: clang
CFLAGS: "-fsanitize=address -g -O2 -fno-omit-frame-pointer"
LDFLAGS: "-fsanitize=address"
LSAN_OPTIONS: verbosity=1:log_threads=1
allow_failure: true
<<: *debian_unstable
<<: *build_job
test:debian:unstable:amd64:asan:
variables:
CC: clang
CFLAGS: "-fsanitize=address -g -O2"
LDFLAGS: "-fsanitize=address"
LSAN_OPTIONS: verbosity=1:log_threads=1
allow_failure: true
<<: *debian_unstable
<<: *test_job
dependencies:
- build:debian:unstable:amd64:asan
build:debian:unstable:amd64:ubsan:
variables:
CC: clang
CFLAGS: "-fsanitize=undefined -fno-sanitize=nonnull-attribute -g -O2"
LDFLAGS: "-fsanitize=undefined"
UBSAN_OPTIONS: print_stacktrace=1
allow_failure: true
<<: *debian_unstable
<<: *build_job
test:debian:unstable:amd64:ubsan:
variables:
CC: clang
CFLAGS: "-fsanitize=undefined -fno-sanitize=nonnull-attribute -g -O2"
LDFLAGS: "-fsanitize=undefined"
UBSAN_OPTIONS: print_stacktrace=1
allow_failure: true
<<: *debian_unstable
<<: *test_job
dependencies:
- build:debian:unstable:amd64:ubsan
build:archive:
<<: *debian_stable
stage: build
script:
- autoreconf -fi
- mkdir _build
- cd _build
- ../configure
- make distcheck V=1 DISTCHECK_CONFIGURE_FLAGS="--disable-static" -j2
- make html singlehtml
only:
- master
- tags
- triggers
- schedules
except: []
artifacts:
paths:
- _build/*.tar.xz
- _build/doc/_build/html
- _build/doc/_build/singlehtml
pages:
stage: documentation
needs:
- build:archive
script:
- mkdir -p public/master
- mv _build/doc/_build/html public/master/html
- mv _build/doc/_build/singlehtml public/master/singlehtml
only:
- master
artifacts:
paths:
- public
build:documentation:
<<: *debian_stable
stage: documentation
only:
- tags
- triggers
dependencies:
- build:debian:amd64
script:
- make -C doc html singlehtml pdf epub V=1
artifacts:
paths:
- doc/_build/html/
- doc/_build/singlehtml/
- doc/_build/latex/KnotDNS.pdf
- doc/_build/epub/KnotDNS.epub
expire_in: '1 hour'
# packaging tests using apkg
.apkg_image: &apkg_image
# apkg images use LC_ALL=C.UTF-8
variables:
LC_ALL: C.UTF-8
.pkg_test: &pkg_test
<<: *apkg_image
stage: pkg
needs:
- pkg:make-archive
only:
variables:
- $PKGTEST == "1"
artifacts:
paths:
- pkg/
expire_in: '1 week'
script:
- python3 -m pip install git+https://gitlab.nic.cz/packaging/apkg.git
# make sure the archive from pkg:make-archive is available
- apkg info cache | grep archive/dev
- apkg install --build-dep
- apkg test --test-dep
.pkg_test_deb: &pkg_test_deb
<<: *pkg_test
before_script:
- apt update
pkg:make-archive:
# archive is created once and reused in other pkg jobs
<<: *apkg_image
stage: pkg
needs:
- build:debian:amd64
only:
variables:
- $PKGTEST == "1"
image: $CI_REGISTRY/packaging/apkg/test/debian-12
artifacts:
paths:
- pkg/
before_script:
- apt update
script:
- python3 -m pip install apkg
- apkg build-dep
- apkg make-archive
pkg:debian-13:
<<: *pkg_test_deb
image: $CI_REGISTRY/packaging/apkg/test/debian-13
pkg:debian-12:
<<: *pkg_test_deb
image: $CI_REGISTRY/packaging/apkg/test/debian-12
pkg:debian-11:
<<: *pkg_test_deb
image: $CI_REGISTRY/packaging/apkg/test/debian-11
pkg:ubuntu-24.04:
<<: *pkg_test_deb
image: $CI_REGISTRY/packaging/apkg/test/ubuntu-24.04
pkg:ubuntu-22.04:
<<: *pkg_test_deb
image: $CI_REGISTRY/packaging/apkg/test/ubuntu-22.04
pkg:ubuntu-20.04:
<<: *pkg_test_deb
image: $CI_REGISTRY/packaging/apkg/test/ubuntu-20.04
pkg:fedora-41:
<<: *pkg_test
image: $CI_REGISTRY/packaging/apkg/test/fedora-41
pkg:fedora-42:
<<: *pkg_test
image: $CI_REGISTRY/packaging/apkg/test/fedora-42
pkg:alma-9:
<<: *pkg_test
image: $CI_REGISTRY/packaging/apkg/test/alma-9
pkg:alma-10:
<<: *pkg_test
image: $CI_REGISTRY/packaging/apkg/test/alma-10
pkg:rocky-8:
<<: *pkg_test
image: $CI_REGISTRY/packaging/apkg/test/rocky-8
pkg:opensuse-15.6:
<<: *pkg_test
image: $CI_REGISTRY/packaging/apkg/test/opensuse-15.6