strategy:
matrix:
include:
- - build_system: meson
+ - builder: autootols
+ sanitizers: asan+ubsan
+ - builder: meson
sanitizers: address,undefined
build_option: '--meson'
- - build_system: autotools
- sanitizers: asan+ubsan
fail-fast: false
defaults:
run:
uses: actions/cache@v4
with:
path: ~/.ccache
- key: auth-ccache-${{ steps.get-stamp.outputs.stamp }}
- restore-keys: auth-ccache-
+ key: auth-ccache-${{ matrix.builder }}-${{ steps.get-stamp.outputs.stamp }}
+ restore-keys: auth-ccache-${{ matrix.builder }}
- name: set sanitizers
run: echo "SANITIZERS=${{ matrix.sanitizers }}" >> "$GITHUB_ENV"
working-directory: .
- - if: ${{ matrix.build_system == 'autotools' }}
- run: inv ci-autoconf
- working-directory: .
- - if: ${{ matrix.build_system == 'autotools' }}
- run: inv ci-auth-configure
- working-directory: .
- - if: ${{ matrix.build_system == 'autotools' }}
- run: inv ci-make-distdir
+ - run: inv install-auth-build-deps
working-directory: .
- - if: ${{ matrix.build_system == 'autotools' }}
- run: inv ci-auth-configure
- - if: ${{ matrix.build_system == 'autotools' }}
- run: inv ci-auth-make-bear # This runs under pdns-$BUILDER_VERSION/pdns/
- - if: ${{ matrix.build_system == 'meson' }}
- run: inv install-meson
+ - run: inv ci-autoconf ${{ matrix.build_option }}
working-directory: .
- - if: ${{ matrix.build_system == 'meson' }}
- run: inv ci-auth-configure-meson ${{ env.REPO_HOME }}/pdns-${{ env.BUILDER_VERSION }}
+ - run: inv ci-auth-configure ${{ matrix.build_option }} -b pdns-${{ env.BUILDER_VERSION }}
working-directory: .
- - if: ${{ matrix.build_system == 'meson' }}
- run: inv run-ninja
+ - run: inv ci-auth-build ${{ matrix.build_option }} # This runs under pdns-$BUILDER_VERSION/pdns/ for make bear
- run: inv ci-auth-install-remotebackend-test-deps
- run: inv ci-auth-run-unit-tests ${{ matrix.build_option }}
- run: inv generate-coverage-info ./testrunner $GITHUB_WORKSPACE
- if: ${{ env.COVERAGE == 'yes' && matrix.build_system == 'autotools' }}
+ if: ${{ env.COVERAGE == 'yes' && matrix.builder != 'meson' }}
working-directory: ./pdns-${{ env.BUILDER_VERSION }}/pdns
- name: Coveralls Parallel auth unit
- if: ${{ env.COVERAGE == 'yes' && matrix.build_system == 'autotools'}}
+ if: ${{ env.COVERAGE == 'yes' && matrix.builder != 'meson' }}
uses: coverallsapp/github-action@v2
with:
flag-name: auth-unit-${{ matrix.sanitizers }}
path-to-lcov: $GITHUB_WORKSPACE/coverage.lcov
parallel: true
allow-empty: true
- - if: ${{ matrix.build_system == 'autotools' }}
- run: inv ci-make-install ${{ matrix.build_option }}
+ - run: inv ci-auth-install ${{ matrix.build_option }}
- run: ccache -s
- - if: ${{ matrix.build_system == 'autotools' }}
+ - if: ${{ matrix.builder != 'meson' }}
run: echo "normalized-branch-name=${{ inputs.branch-name || github.ref_name }}" | tr "/" "-" >> "$GITHUB_ENV"
- - if: ${{ matrix.build_system == 'autotools' }}
+ - if: ${{ matrix.builder != 'meson' }}
name: Store the binaries
uses: actions/upload-artifact@v4 # this takes 30 seconds, maybe we want to tar
with:
c.run('sudo sh install_rust.sh')
def install_libdecaf(c, product):
- c.run('git clone https://git.code.sf.net/p/ed448goldilocks/code /tmp/libdecaf')
+ c.run('rm -rf /tmp/libdecaf && git clone https://git.code.sf.net/p/ed448goldilocks/code /tmp/libdecaf')
with c.cd('/tmp/libdecaf'):
c.run('git checkout 41f349')
c.run(f'CC={get_c_compiler()} CXX={get_cxx_compiler()} '
def install_doc_deps_pdf(c):
c.sudo('apt-get install -y ' + ' '.join(doc_deps_pdf))
+def install_meson(c):
+ c.run(f'python3 -m venv {repo_home}/.venv')
+ c.run(f'. {repo_home}/.venv/bin/activate && pip install meson pyyaml ninja')
+
@task
def install_auth_build_deps(c):
c.sudo('apt-get install -y --no-install-recommends ' + ' '.join(all_build_deps + git_build_deps + auth_build_deps))
+ install_meson(c)
if os.getenv('DECAF_SUPPORT', 'no') == 'yes':
install_libdecaf(c, 'pdns-auth')
c.sudo('apt-get install -y --no-install-recommends ' + ' '.join(all_build_deps + git_build_deps + dnsdist_build_deps + (dnsdist_xdp_build_deps if not skipXDP else [])))
@task
-def ci_autoconf(c):
- c.run('autoreconf -vfi')
+def ci_autoconf(c, meson=False):
+ if not meson:
+ c.run('autoreconf -vfi')
@task
def ci_docs_rec_generate(c):
get_sanitizers(meson=True)
])
-@task
-def ci_auth_configure(c):
+def ci_auth_configure_autotools(c):
unittests = get_unit_tests(auth=True)
fuzz_targets = get_fuzzing_targets()
modules = " ".join([
c.run('cat config.log')
raise UnexpectedExit(res)
-@task
def ci_auth_configure_meson(c, build_dir):
unittests = get_unit_tests(meson=True, auth=True)
fuzz_targets = get_fuzzing_targets(meson=True)
c.run(f'cat {build_dir}/meson-logs/meson-log.txt')
raise UnexpectedExit(res)
+@task
+def ci_auth_configure(c, build_dir=None, meson=False):
+ if meson:
+ ci_auth_configure_meson(c, build_dir)
+ else:
+ ci_auth_configure_autotools(c)
+ if build_dir:
+ ci_make_distdir(c)
+ with c.cd(f'{build_dir}'):
+ ci_auth_configure_autotools(c)
+
@task
def ci_rec_configure(c, features):
unittests = get_unit_tests()
def ci_auth_make_bear(c):
c.run(f'bear --append -- make -j{get_build_concurrency()} -k V=1')
+def run_ninja(c):
+ c.run(f'. {repo_home}/.venv/bin/activate && ninja -j{get_build_concurrency()} --verbose')
+
+@task
+def ci_auth_build(c, meson=False):
+ if meson:
+ run_ninja(c)
+ else:
+ ci_auth_make_bear(c)
+
@task
def ci_rec_make(c):
c.run(f'make -j{get_build_concurrency()} -k V=1')
c.run('make distdir')
@task
-def ci_make_install(c, meson=False):
- # TBD: meson: ninja install or equivalent
- c.run('make install') # FIXME: this builds auth docs - again
+def ci_auth_install(c, meson=False):
+ if not meson:
+ c.run('make install') # FIXME: this builds auth docs - again
@task
-def install_meson(c):
- c.run(f'python3 -m venv {repo_home}/.venv')
- c.run(f'. {repo_home}/.venv/bin/activate && pip install meson pyyaml ninja')
-
-@task
-def run_ninja(c):
- c.run(f'. {repo_home}/.venv/bin/activate && ninja --verbose')
+def ci_make_install(c):
+ c.run('make install')
@task
def add_auth_repo(c, dist_name, dist_release_name, pdns_repo_version):