From 3d10eecf1f616e35b8f6dd5112b71ded41adcc0b Mon Sep 17 00:00:00 2001 From: Axel Huebl Date: Mon, 13 Mar 2023 22:03:12 -0700 Subject: [PATCH] CI: Clang-Tidy Add `clang-tidy` correctness checks to CI. --- .github/workflows/tooling.yml | 36 +++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/.github/workflows/tooling.yml b/.github/workflows/tooling.yml index 376927709..9f299e7d7 100644 --- a/.github/workflows/tooling.yml +++ b/.github/workflows/tooling.yml @@ -7,6 +7,42 @@ concurrency: cancel-in-progress: true jobs: + clangtidy: + name: clang-tidy w/o py + runs-on: ubuntu-22.04 + if: github.event.pull_request.draft == false + steps: + - uses: actions/checkout@v3 + + - name: install dependencies + run: | + .github/workflows/dependencies/clang-tidy.sh + + - name: CCache Cache + uses: actions/cache@v3 + # - once stored under a key, they become immutable (even if local cache path content changes) + # - for a refresh the key has to change, e.g., hash of a tracked file in the key + with: + path: | + ~/.ccache + ~/.cache/ccache + key: ccache-openmp-clangtidy-${{ hashFiles('.github/workflows/ubuntu.yml') }}-${{ hashFiles('cmake/dependencies/ABLASTR.cmake') }} + restore-keys: | + ccache-openmp-clangtidy-${{ hashFiles('.github/workflows/ubuntu.yml') }}- + ccache-openmp-clangtidy- + + - name: build ImpactX + env: {CC: clang, CXX: clang++} + run: | + cmake -S . -B build \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_CXX_CLANG_TIDY="$(which clang-tidy);-system-headers=0" \ + -DCMAKE_VERBOSE_MAKEFILE=ON \ + -DImpactX_PYTHON=ON + cmake --build build -j 2 2> build/clang-tidy.log + cat build/clang-tidy.log + if [[ $(wc -m