Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/.github
diff options
context:
space:
mode:
authorMartin Jeřábek2024-02-21 23:06:53 +0100
committerMartin Hořeňovský2024-03-01 21:24:45 +0100
commit7677c1658eb4417ec60649589610bf4e3d731bc9 (patch)
tree3ed414008abbd5095c77671455221ce4cee56df8 /.github
parent92d3b23913d46cee771608043efbca4fe4de9a13 (diff)
downloadcatch3-7677c1658eb4417ec60649589610bf4e3d731bc9.tar.gz
ci: add clang-tidy run
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/linux-other-builds.yml49
1 files changed, 49 insertions, 0 deletions
diff --git a/.github/workflows/linux-other-builds.yml b/.github/workflows/linux-other-builds.yml
index 9afd231a..6993c815 100644
--- a/.github/workflows/linux-other-builds.yml
+++ b/.github/workflows/linux-other-builds.yml
@@ -103,3 +103,52 @@ jobs:
CTEST_OUTPUT_ON_FAILURE: 1
working-directory: ${{runner.workspace}}/build
run: ctest -C ${{matrix.build_type}} -j `nproc` ${{matrix.other_ctest_args}}
+ clang-tidy:
+ name: clang-tidy ${{matrix.version}}, ${{matrix.build_description}}, C++${{matrix.std}} ${{matrix.build_type}}
+ runs-on: ubuntu-22.04
+ strategy:
+ matrix:
+ include:
+ - version: "15"
+ build_description: all
+ build_type: Debug
+ std: 17
+ other_pkgs: ''
+ cmake_configurations: -DCATCH_BUILD_EXAMPLES=ON -DCATCH_ENABLE_CMAKE_HELPER_TESTS=ON
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Prepare environment
+ run: |
+ sudo apt-get update
+ sudo apt-get install -y ninja-build clang-${{matrix.version}} clang-tidy-${{matrix.version}} ${{matrix.other_pkgs}}
+
+ - name: Configure build
+ working-directory: ${{runner.workspace}}
+ env:
+ CXX: clang++-${{matrix.version}}
+ CXXFLAGS: ${{matrix.cxxflags}}
+ # Note: $GITHUB_WORKSPACE is distinct from ${{runner.workspace}}.
+ # This is important
+ run: |
+ clangtidy="clang-tidy-${{matrix.version}};-use-color"
+ # Use a dummy compiler/linker/ar/ranlib to effectively disable the
+ # compilation and only run clang-tidy.
+ cmake -Bbuild -H$GITHUB_WORKSPACE \
+ -DCMAKE_BUILD_TYPE=${{matrix.build_type}} \
+ -DCMAKE_CXX_STANDARD=${{matrix.std}} \
+ -DCMAKE_CXX_STANDARD_REQUIRED=ON \
+ -DCMAKE_CXX_EXTENSIONS=OFF \
+ -DCATCH_DEVELOPMENT_BUILD=ON \
+ -DCMAKE_CXX_CLANG_TIDY="$clangtidy" \
+ -DCMAKE_CXX_COMPILER_LAUNCHER=/usr/bin/true \
+ -DCMAKE_AR=/usr/bin/true \
+ -DCMAKE_CXX_COMPILER_AR=/usr/bin/true \
+ -DCMAKE_RANLIB=/usr/bin/true \
+ -DCMAKE_CXX_LINK_EXECUTABLE=/usr/bin/true \
+ ${{matrix.cmake_configurations}} \
+ -G Ninja
+
+ - name: Run clang-tidy
+ working-directory: ${{runner.workspace}}/build
+ run: ninja