summaryrefslogtreecommitdiffstats
path: root/.gitlab-ci.yml
diff options
context:
space:
mode:
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r--.gitlab-ci.yml293
1 files changed, 111 insertions, 182 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index cf7b7120..02a3f552 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -31,7 +31,7 @@ stages:
- test
- respdiff
- deploy
- - pkgtest
+ - pkg
# https://docs.gitlab.com/ce/ci/jobs/job_control.html#select-different-runner-tags-for-each-parallel-matrix-job
.multi_platform: &multi_platform
@@ -157,7 +157,7 @@ docker:
DOCKER_IMAGE_NAME: knot-resolver-test:${CI_COMMIT_SHA}
script:
- docker build --no-cache -t ${DOCKER_IMAGE_NAME} .
- - echo "quit()" | docker run -i ${DOCKER_IMAGE_NAME}
+ # TODO: perhaps try if the running image answers queries
after_script: # remove dangling images to avoid running out of disk space
- docker rmi ${DOCKER_IMAGE_NAME}
- docker rmi $(docker images -f "dangling=true" -q)
@@ -243,7 +243,7 @@ lint:scan-build:
script:
- export SCANBUILD="$(realpath ./scripts/run-scanbuild-with-args.sh)"
- ninja -C build_ci* scan-build || true
- - test "$(ls build_ci*/meson-logs/scanbuild/*/report-*.html | wc -l)" = 22 # we have this many errors ATM :-)
+ - test "$(ls build_ci*/meson-logs/scanbuild/*/report-*.html | wc -l)" = 23 # we have this many errors ATM :-)
lint:tidy:
<<: *after_build
@@ -352,15 +352,12 @@ test:valgrind:
- ${MESON_TEST} --suite unit --suite config --no-suite snowflake --wrap="valgrind --leak-check=full --trace-children=yes --quiet --suppressions=/lj.supp"
- MESON_TESTTHREADS=1 ${MESON_TEST} --wrap="valgrind --leak-check=full --trace-children=yes --quiet --suppressions=/lj.supp" --suite snowflake
-pkgtest:
+manager:
stage: test
+ needs: []
trigger:
- include: ci/pkgtest.yaml
+ include: manager/.gitlab-ci.yml
strategy: depend
- needs:
- - build
- variables: # https://gitlab.nic.cz/help/ci/yaml/README.md#artifact-downloads-to-child-pipelines
- PARENT_PIPELINE_ID: $CI_PIPELINE_ID
except:
refs:
- master@knot/knot-resolver
@@ -555,7 +552,7 @@ obs:release:
obs:odvr:
<<: *obs_trigger
- stage: pkgtest # last stage to ensure it doesn't block anything
+ stage: pkg # last stage to ensure it doesn't block anything
only:
- tags
variables:
@@ -563,192 +560,113 @@ obs:odvr:
when: manual
# }}}
-# pkgtest {{{
-.deploytest: &deploytest
- stage: pkgtest
- only:
- variables:
- - $OBS_REPO =~ /^knot-resolver-devel|knot-dns-devel|knot-resolver-testing$/
- - $CI_COMMIT_TAG
- dependencies: [] # wait for previous stages to finish
- variables:
- OBS_REPO: knot-resolver-latest
- when: delayed
- start_in: 3 minutes # give OBS build some time
- tags:
- - condor
+# pkg {{{
+.pkg_deb_extras: &pkg_deb_extras
+ before_script:
+ - apt update
-obs:build:all:
- <<: *deploytest
- only:
- variables:
- - $OBS_REPO =~ /^knot-resolver-devel|knot-dns-devel|knot-resolver-testing|knot-resolver-odvr$/
- - $CI_COMMIT_TAG
- allow_failure: true
+.enable_repo_build: &enable_repo_build
+ before_script:
+ - ./scripts/enable-repo.py build
+
+.pkg_test: &pkg_test
+ stage: pkg
+ needs:
+ - pkg:make-archive
+ tags:
+ - lxc
+ - amd64
script:
- - "osc results home:CZ-NIC:$OBS_REPO knot-resolver -w"
- - version=$(sed 's/^v//' <(git describe --exact-match HEAD || git rev-parse --short HEAD) )
- - > # check version only for one (reliable) repo to avoid false negatives
- ! osc ls -b home:CZ-NIC:$OBS_REPO knot-resolver Debian_9.0 x86_64 | \
- grep -E '(rpm|deb|tar\.xz)$' | grep -v $version || \
- (echo "ERROR: version mismatch"; exit 1)
- - >
- ! osc results home:CZ-NIC:$OBS_REPO knot-resolver --csv | \
- grep -Ev 'disabled|excluded|Rawhide|CentOS_8_EPEL' | grep -v 'succeeded' -q || \
- (echo "ERROR: build(s) failed"; exit 1)
-
-.distrotest: &distrotest
- <<: *deploytest
- # Description of the distrotest script workflow:
- # 1. wait for OBS package build to complete
- # 2. check the OBS build suceeded
- # 3. set up some variables, dir names etc.
- # 4. create a symlink with predictable name to export artifacts afterwards
- # 5. create an HTCondor job and submit it to a HTCondor cluster
- # 6. check exit code from condor, optionally display one of the logs and end the job with same exit code
+ # 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_user: &pkg_test_user
+ <<: *pkg_test
script:
- - "osc results home:CZ-NIC:$OBS_REPO knot-resolver -a x86_64 -r $DISTROTEST_REPO -w"
- - >
- osc results home:CZ-NIC:$OBS_REPO knot-resolver -a x86_64 -r $DISTROTEST_REPO --csv | grep 'succeeded|$' -q || \
- (echo "ERROR: build failed"; exit 1)
- - export LABEL="gl$(date +%s)_$OBS_REPO"
- - export COMMITDIR="/var/tmp/respdiff-jobs/$(git rev-parse --short HEAD)-$LABEL"
- - export TESTDIR="$COMMITDIR/distrotest.$DISTROTEST_NAME"
- - ln -s $COMMITDIR distrotest_commitdir
- - sudo -u respdiff /var/opt/respdiff/contrib/job_manager/submit.py -w
- -p $DISTROTEST_PRIORITY
- $(sudo -u respdiff /var/opt/respdiff/contrib/job_manager/create.py
- "$(git rev-parse --short HEAD)" -l $LABEL -t distrotest.$DISTROTEST_NAME
- --obs-repo $OBS_REPO)
- - export EXITCODE=$(cat $TESTDIR/j*_exitcode)
- - if [[ "$EXITCODE" != "0" ]]; then cat $TESTDIR/j*_{vagrant.log.txt,stdout.txt}; fi
- - exit $EXITCODE
- after_script:
- - 'cp -t . distrotest_commitdir/distrotest.$DISTROTEST_NAME/j* ||:'
+ - apkg info cache | grep archive/dev
+ - apkg build-dep --test-dep
+ - apkg make-archive
+ - chgrp -R test .
+ - chmod -R g+rwX .
+ - find -type d -exec chmod g+s {} +
+ - git config core.sharedRepository group
+ - sudo -u test git config --global --add safe.directory '*'
+ - sudo -u test apkg build
+ - apkg install
+ - apkg test
+
+.pkg_test_deb: &pkg_test_deb
+ <<: *pkg_test
+ <<: *pkg_deb_extras
+
+pkg:make-archive:
+ # archive is created once and reused in other pkg jobs
+ <<: *pkg_deb_extras
+ stage: pkg
+ image: $CI_REGISTRY/packaging/apkg/full/debian-11
+ tags:
+ - lxc
+ - amd64
+ needs: []
artifacts:
- when: always
- expire_in: 1 week
paths:
- - ./j*
- retry:
- max: 1
- when:
- - script_failure
-
-obs:rocky8:x86_64:
- <<: *distrotest
- allow_failure: true
- variables:
- OBS_REPO: knot-resolver-latest
- DISTROTEST_NAME: rocky8
- DISTROTEST_REPO: CentOS_8_EPEL
-
-obs:debian10:x86_64:
- <<: *distrotest
- only:
- variables:
- - $OBS_REPO =~ /^knot-resolver-devel|knot-dns-devel|knot-resolver-testing|knot-resolver-odvr$/
- - $CI_COMMIT_TAG
- variables:
- OBS_REPO: knot-resolver-latest
- DISTROTEST_NAME: debian10
- DISTROTEST_REPO: Debian_10
+ - pkg/
+ script:
+ - apkg build-dep
+ - apkg make-archive
-obs:debian11:x86_64:
- <<: *distrotest
- only:
- variables:
- - $OBS_REPO =~ /^knot-resolver-devel|knot-dns-devel|knot-resolver-testing|knot-resolver-odvr$/
- - $CI_COMMIT_TAG
- variables:
- OBS_REPO: knot-resolver-latest
- DISTROTEST_NAME: debian11
- DISTROTEST_REPO: Debian_11
+pkg:debian-12:
+ <<: *pkg_test_deb
+ image: $CI_REGISTRY/packaging/apkg/full/debian-12
-obs:fedora35:x86_64:
- <<: *distrotest
- allow_failure: true
- variables:
- OBS_REPO: knot-resolver-latest
- DISTROTEST_NAME: fedora35
- DISTROTEST_REPO: Fedora_35
+pkg:debian-11:
+ <<: *pkg_test_deb
+ image: $CI_REGISTRY/packaging/apkg/full/debian-11
-obs:fedora36:x86_64:
- <<: *distrotest
- allow_failure: true
- variables:
- OBS_REPO: knot-resolver-latest
- DISTROTEST_NAME: fedora36
- DISTROTEST_REPO: Fedora_36
+pkg:ubuntu-24.04:
+ <<: *pkg_test_deb
+ image: $CI_REGISTRY/packaging/apkg/full/ubuntu-24.04
-obs:leap15:x86_64:
- <<: *distrotest
- allow_failure: true
- variables:
- OBS_REPO: knot-resolver-latest
- DISTROTEST_NAME: leap15
- DISTROTEST_REPO: openSUSE_Leap_15.4
+pkg:ubuntu-22.04:
+ <<: *pkg_test_deb
+ image: $CI_REGISTRY/packaging/apkg/full/ubuntu-22.04
-obs:ubuntu1804:x86_64:
- <<: *distrotest
- variables:
- OBS_REPO: knot-resolver-latest
- DISTROTEST_NAME: ubuntu1804
- DISTROTEST_REPO: xUbuntu_18.04
+pkg:ubuntu-20.04:
+ <<: *pkg_test_deb
+ <<: *enable_repo_build
+ image: $CI_REGISTRY/packaging/apkg/full/ubuntu-20.04
-obs:ubuntu2004:x86_64:
- <<: *distrotest
- only:
- variables:
- - $OBS_REPO =~ /^knot-resolver-devel|knot-dns-devel|knot-resolver-testing|knot-resolver-odvr$/
- - $CI_COMMIT_TAG
- variables:
- OBS_REPO: knot-resolver-latest
- DISTROTEST_NAME: ubuntu2004
- DISTROTEST_REPO: xUbuntu_20.04
+pkg:fedora-39:
+ <<: *pkg_test
+ image: $CI_REGISTRY/packaging/apkg/full/fedora-39
-obs:ubuntu2204:x86_64:
- <<: *distrotest
- allow_failure: true
- variables:
- OBS_REPO: knot-resolver-latest
- DISTROTEST_NAME: ubuntu2204
- DISTROTEST_REPO: xUbuntu_22.04
+pkg:fedora-38:
+ <<: *pkg_test
+ image: $CI_REGISTRY/packaging/apkg/full/fedora-38
-.packagingtest: &packagingtest
- stage: pkgtest
- only:
- refs:
- - nightly@knot/knot-resolver
- needs: []
- tags:
- - dind
- - amd64
- variables:
- DISTRO: debian_10
- script:
- - pytest -r fEsxX tests/packaging -k $DISTRO
-
-packaging:centos_8:
- <<: *packagingtest
- variables:
- DISTRO: centos_8
-
-packaging:centos_7:
- <<: *packagingtest
- variables:
- DISTRO: centos_7
-
-packaging:fedora_31:
- <<: *packagingtest
- variables:
- DISTRO: fedora_31
-
-packaging:fedora_32:
- <<: *packagingtest
- variables:
- DISTRO: fedora_32
+pkg:alma-9:
+ <<: *pkg_test
+ image: $CI_REGISTRY/packaging/apkg/full/alma-9
+pkg:arch:
+ <<: *pkg_test_user
+ image: $CI_REGISTRY/packaging/apkg/full/arch
+ before_script:
+ - pacman -Syy
+
+# RHEL 8 derivatives would need more work due to *default* python being old
+#pkg:rocky-8:
+# <<: *pkg_test
+# image: $CI_REGISTRY/packaging/apkg/full/rocky-8
+
+# Leap 15.4 would need more work due to *default* python being old
+#pkg:opensuse-15.4:
+# <<: *pkg_test
+# <<: *enable_repo_build
+# image: $CI_REGISTRY/packaging/apkg/full/opensuse-15.4
+# allow_failure: true # SUSE is always special
# }}}
# docs: {{{
@@ -811,4 +729,15 @@ docs:release:
name: docs-release/$CI_COMMIT_TAG
url: https://$CI_PROJECT_NAMESPACE.pages.nic.cz/-/knot-resolver/-/jobs/$CI_JOB_ID/artifacts/doc/html/index.html
+# This job deploys the current docs as <https://knot.pages.nic.cz/knot-resolver>
+pages:
+ stage: deploy
+ needs:
+ - docs:build
+ script: mv doc/html public
+ when: manual
+ artifacts:
+ paths:
+ - public
+
# }}}