needs: get-runner-container-image
strategy:
matrix:
- builder: [autotools, meson]
sanitizers: [asan+ubsan, tsan]
features: [least, full]
architecture_suffix: ${{ contains(needs.get-runner-container-image.outputs.id, 'debian-11') && fromJson('[""]') || fromJson('["", "-arm"]') }}
exclude:
- sanitizers: tsan
features: least
- - architecture_suffix: '-arm'
- builder: autotools
- architecture_suffix: '-arm'
features: least
- architecture_suffix: '-arm'
- name: set up build
uses: ./.github/actions/cache
with:
- cache-key-base: dnsdist-${{ matrix.features }}-${{ matrix.sanitizers }}-${{ matrix.builder}}${{ matrix.architecture_suffix }}-ccache
+ cache-key-base: dnsdist-${{ matrix.features }}-${{ matrix.sanitizers }}-meson${{ matrix.architecture_suffix }}-ccache
- name: install pip build dependencies
uses: ./.github/actions/pip-build-dependencies
with:
- run: ${{ env.INV_CMD }} ci-build-and-install-quiche ${REPO_HOME}
if: ${{ matrix.features != 'least' }}
working-directory: ./pdns/dnsdistdist/
- - run: ${{ env.INV_CMD }} ci-autoconf
- if: ${{ matrix.builder == 'autotools' }}
- working-directory: ./pdns/dnsdistdist/
- - run: ${{ env.INV_CMD }} ci-dnsdist-configure ${{ matrix.features }} ${{ matrix.builder }} dnsdist-${{ env.BUILDER_VERSION }}
+ - run: ${{ env.INV_CMD }} ci-dnsdist-configure ${{ matrix.features }} dnsdist-${{ env.BUILDER_VERSION }}
working-directory: ./pdns/dnsdistdist/
- if: ${{ matrix.builder != 'autotools' }}
- - run: |
- mkdir dnsdist-${{ env.BUILDER_VERSION }}
- if: ${{ matrix.builder == 'autotools' }}
+ - run: ${{ env.INV_CMD }} ci-dnsdist-run-ninja dnsdist-${{ env.BUILDER_VERSION }}
working-directory: ./pdns/dnsdistdist/
- - run: ${{ env.INV_CMD }} ci-dnsdist-configure ${{ matrix.features }} ${{ matrix.builder }} dnsdist-${{ env.BUILDER_VERSION }}
- if: ${{ matrix.builder == 'autotools' }}
- - run: ${{ env.INV_CMD }} ci-dnsdist-make-bear ${{ matrix.builder }}
- - run: ${{ env.INV_CMD }} ci-dnsdist-run-unit-tests ${{ matrix.builder }}
+ - run: ${{ env.INV_CMD }} ci-dnsdist-run-unit-tests
- run: ${{ env.INV_CMD }} generate-coverage-info ./testrunner 'dnsdist' $GITHUB_WORKSPACE
- if: ${{ env.COVERAGE == 'yes' && matrix.sanitizers != 'tsan' && matrix.builder == 'meson'}}
+ if: ${{ env.COVERAGE == 'yes' && matrix.sanitizers != 'tsan' }}
- name: Coveralls Parallel dnsdist unit
- if: ${{ env.COVERAGE == 'yes' && matrix.sanitizers != 'tsan' && matrix.builder == 'meson' }}
+ if: ${{ env.COVERAGE == 'yes' && matrix.sanitizers != 'tsan' }}
uses: coverallsapp/github-action@5cbfd81b66ca5d10c19b062c04de0199c215fb6e
with:
flag-name: dnsdist-unit-${{ matrix.features }}-${{ matrix.sanitizers }}
parallel: true
allow-empty: true
fail-on-error: false
- - run: ${{ env.INV_CMD }} ci-dnsdist-install ${{ matrix.builder == 'meson' && '--meson' || '' }}
+ - run: ${{ env.INV_CMD }} ci-dnsdist-install
- run: ccache -s
- uses: ./.github/actions/normalize-branch-name
- if: ${{ matrix.builder == 'meson' }}
- name: Prepare binaries folder
- if: ${{ matrix.builder == 'meson' }}
run: |
mkdir -p /opt/dnsdist/bin
for i in $(find . -maxdepth 1 -type f -executable); do cp ${i} /opt/dnsdist/bin/; done
- name: Store the binaries
- if: ${{ matrix.builder == 'meson' }}
uses: actions/upload-artifact@v7 # this takes 30 seconds, maybe we want to tar
with:
- name: dnsdist-${{ matrix.features }}-${{ matrix.sanitizers }}-${{ matrix.builder}}${{ matrix.architecture_suffix }}-${{ env.normalized-branch-name }}
+ name: dnsdist-${{ matrix.features }}-${{ matrix.sanitizers }}-meson${{ matrix.architecture_suffix }}-${{ env.normalized-branch-name }}
path: /opt/dnsdist
retention-days: 1
- name: Install python yaml
run: |
pip install pyyaml
- - name: Autoreconf dnsdist
- if: matrix.product == 'dnsdist'
- working-directory: ./pdns/dnsdistdist/
- run: |
- inv ci-autoconf
- run: inv ci-install-rust $REPO_HOME
if: matrix.product == 'dnsdist'
working-directory: ./pdns/dnsdistdist/
if: matrix.product == 'dnsdist'
working-directory: ./pdns/dnsdistdist/
run: |
- inv ci-dnsdist-configure full autotools ''
+ inv ci-dnsdist-configure full build
- name: Build dnsdist
if: matrix.product == 'dnsdist'
working-directory: ./pdns/dnsdistdist/
run: |
- inv ci-dnsdist-make-bear autotools
+ inv ci-dnsdist-run-ninja build
- run: ln -s ../../.clang-tidy.full .clang-tidy
if: matrix.product == 'dnsdist'
working-directory: ./pdns/dnsdistdist/
@task
-def ci_dnsdist_configure(c, features, builder, build_dir):
+def ci_dnsdist_configure(c, features, build_dir):
additional_flags = ""
additional_ld_flags = ""
if is_compiler_clang():
if features == "least":
additional_flags = DNSDIST_CONFIGURE_CXXFLAGS_LEAST
- if builder == "meson":
- cmd = ci_dnsdist_configure_meson(c, features, additional_flags, additional_ld_flags, build_dir)
- logfile = "meson-logs/meson-log.txt"
- else:
- cmd = ci_dnsdist_configure_autotools(features, additional_flags, additional_ld_flags, build_dir)
- logfile = "config.log"
+ cmd = ci_dnsdist_configure_meson(c, features, additional_flags, additional_ld_flags, build_dir)
+ logfile = "meson-logs/meson-log.txt"
res = c.run(cmd, warn=True)
if res.exited != 0:
raise UnexpectedExit(res)
-def ci_dnsdist_configure_autotools(features, additional_flags, additional_ld_flags, build_dir):
- if features == "full":
- features_set = "--enable-dnstap \
- --enable-dnscrypt \
- --enable-dns-over-tls \
- --enable-dns-over-https \
- --enable-dns-over-quic \
- --enable-dns-over-http3 \
- --enable-ipcrypt2 \
- --enable-systemd \
- --enable-yaml \
- --prefix=/opt/dnsdist \
- --with-gnutls \
- --with-libsodium \
- --with-lua=luajit \
- --with-libcap \
- --with-net-snmp \
- --with-nghttp2 \
- --with-re2"
- else:
- features_set = "--disable-dnstap \
- --disable-dnscrypt \
- --disable-ipcipher \
- --disable-ipcrypt2 \
- --disable-systemd \
- --without-cdb \
- --without-ebpf \
- --without-gnutls \
- --without-libedit \
- --without-libsodium \
- --without-lmdb \
- --without-net-snmp \
- --without-nghttp2 \
- --without-re2"
- unittests = get_unit_tests()
- fuzztargets = get_fuzzing_targets()
- tools = f"""AR=llvm-ar-{clang_version} RANLIB=llvm-ranlib-{clang_version}""" if is_compiler_clang() else ""
- out_of_tree_build = build_dir != ""
- return " ".join(
- [
- tools,
- get_base_configure_cmd(
- additional_c_flags="",
- additional_cxx_flags=additional_flags,
- additional_ld_flags=additional_ld_flags,
- enable_systemd=False,
- enable_sodium=False,
- out_of_tree_build=out_of_tree_build,
- ),
- features_set,
- unittests,
- fuzztargets,
- "--enable-lto=thin",
- "--prefix=/opt/dnsdist",
- ]
- )
-
-
DNSDIST_CONFIGURE_MESON_FEATURE_SET_FULL = " ".join(
[
"-D cdb=enabled",
@task
-def ci_dnsdist_make(c):
- c.run(f"make -j{get_build_concurrency(4)} -k V=1")
-
-
-def ci_dnsdist_run_ninja(c):
- c.run(f". {repo_home}/.venv/bin/activate && ninja -j{get_build_concurrency(4)} --verbose")
-
-
-@task
-def ci_dnsdist_make_bear(c, builder):
- if builder == "meson":
- ci_dnsdist_run_ninja(c)
- return
-
- # Assumed to be running under ./pdns/dnsdistdist/
- c.run(f"bear --append -- make -j{get_build_concurrency(4)} -k V=1")
+def ci_dnsdist_run_ninja(c, build_dir):
+ c.run(f". {repo_home}/.venv/bin/activate && meson compile -C {build_dir} -j{get_build_concurrency(4)} --verbose")
@task
@task
-def ci_dnsdist_run_unit_tests(c, builder):
- if builder == "meson":
- suite_timeout_sec = 120
- logfile = "meson-logs/testlog.txt"
- res = c.run(f". {repo_home}/.venv/bin/activate && meson test --verbose -t {suite_timeout_sec}", warn=True)
- else:
- logfile = "test-suite.log"
- res = c.run("make check", warn=True)
+def ci_dnsdist_run_unit_tests(c):
+ suite_timeout_sec = 120
+ logfile = "meson-logs/testlog.txt"
+ res = c.run(f". {repo_home}/.venv/bin/activate && meson test --verbose -t {suite_timeout_sec}", warn=True)
+
if res.exited != 0:
c.run(f"cat {logfile}", warn=True)
raise UnexpectedExit(res)
@task
-def ci_dnsdist_install(c, meson=False):
- if meson:
- c.sudo(f"bash -c 'source {repo_home}/.venv/bin/activate && meson install'")
- else:
- c.run("make install")
+def ci_dnsdist_install(c):
+ c.sudo(f"bash -c 'source {repo_home}/.venv/bin/activate && meson install'")
@task