From: Fred Morcos Date: Tue, 14 Mar 2023 11:28:17 +0000 (+0100) Subject: Github action to run clang-tidy on dnsdist PRs X-Git-Tag: auth-4.8.0~15^2~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=97145bb44b5b4b7e6a97ffaca623bb249debe6fe;p=thirdparty%2Fpdns.git Github action to run clang-tidy on dnsdist PRs --- diff --git a/.github/workflows/clang-tidy.yml b/.github/workflows/clang-tidy.yml index 88cf73b443..3e6ef3e68d 100644 --- a/.github/workflows/clang-tidy.yml +++ b/.github/workflows/clang-tidy.yml @@ -108,3 +108,55 @@ jobs: if [ -f clang-tidy-results/rec-fixes.yml ]; then python .github/scripts/clang-tidy.py --fixes-file clang-tidy-results/rec-fixes.yml fi + + clang-tidy-dnsdist: + name: dnsdist clang-tidy + runs-on: ubuntu-20.04 + env: + UNIT_TESTS: yes + SANITIZERS: + steps: + - uses: PowerDNS/pdns/set-ubuntu-mirror@meta + - uses: actions/checkout@v3 + with: + fetch-depth: 2 + - name: get timestamp for cache + id: get-stamp + shell: bash + run: | + echo "stamp=$(/bin/date +%s)" >> "$GITHUB_OUTPUT" + - name: let GitHub cache our ccache data + uses: actions/cache@v3 + with: + path: ~/.ccache + key: dnsdist-full-ccache-${{ steps.get-stamp.outputs.stamp }} + restore-keys: dnsdist-full-ccache- + - run: build-scripts/gh-actions-setup-inv # this runs apt update+upgrade + - run: inv apt-fresh + - run: inv install-clang + - run: inv install-clang-tidy-tools + - run: inv install-dnsdist-build-deps + - run: inv ci-autoconf + working-directory: pdns/dnsdistdist/ + - run: inv ci-dnsdist-configure full + working-directory: pdns/dnsdistdist/ + - run: inv ci-dnsdist-make-bear + working-directory: pdns/dnsdistdist/ + - run: ccache -s + - run: mkdir clang-tidy-results + - run: ln -s .clang-tidy.full .clang-tidy + - name: Run clang-tidy + working-directory: pdns/dnsdistdist/ + run: git diff -U0 HEAD^ | python /usr/bin/clang-tidy-diff-12.py -p3 -export-fixes ../../clang-tidy-results/dnsdist-fixes.yml + - name: Print clang-tidy fixes YAML + shell: bash + run: | + if [ -f clang-tidy-results/dnsdist-fixes.yml ]; then + cat clang-tidy-results/dnsdist-fixes.yml + fi + - name: Result annotations + shell: bash + run: | + if [ -f clang-tidy-results/dnsdist-fixes.yml ]; then + python .github/scripts/clang-tidy.py --fixes-file clang-tidy-results/dnsdist-fixes.yml + fi diff --git a/tasks.py b/tasks.py index f776ba3d0a..96f2208974 100644 --- a/tasks.py +++ b/tasks.py @@ -548,6 +548,11 @@ def ci_rec_make_bear(c): def ci_dnsdist_make(c): c.run('make -j4 -k V=1') +@task +def ci_dnsdist_make_bear(c): + # Assumed to be running under ./pdns/dnsdistdist/ + c.run('bear --append make -j4 -k V=1') + @task def ci_auth_install_remotebackend_test_deps(c): with c.cd('modules/remotebackend'):