From 5440e0a4a8f288f42f9e67f525a73314f758e919 Mon Sep 17 00:00:00 2001 From: Brendan Barnes Date: Tue, 9 Jul 2024 06:16:52 +0000 Subject: [PATCH] save --- .github/workflows/ci.yml | 71 ++++++++++++++++++++++------------------ 1 file changed, 40 insertions(+), 31 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index da22d9f..c033a7f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,6 +50,45 @@ jobs: working-directory: ${{github.workspace}}/build run: ctest --output-on-failure + clang-tidy: + name: Clang-Tidy + needs: build-and-test + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Install Clang 18 and Clang-Tidy + run: | + wget https://apt.llvm.org/llvm.sh + chmod +x llvm.sh + sudo ./llvm.sh 18 + sudo apt-get install -y clang-18 libc++-18-dev libc++abi-18-dev lld-18 clang-tidy-18 + + - name: Configure CMake + env: + CXX: clang++-18 + run: | + export CXXFLAGS="-stdlib=libc++" + export LDFLAGS="-stdlib=libc++ -fuse-ld=lld-18" + cmake -B ${{github.workspace}}/build -DSQUINT_BUILD_TESTS=ON -DCMAKE_CXX_FLAGS="$CXXFLAGS" -DCMAKE_EXE_LINKER_FLAGS="$LDFLAGS" -DCMAKE_SHARED_LINKER_FLAGS="$LDFLAGS" + + - name: Build + run: cmake --build ${{github.workspace}}/build + + - name: Run Clang-Tidy + run: | + find include -name '*.cpp' -or -name '*.hpp' | \ + xargs clang-tidy-18 -p build \ + --config-file=.clang-tidy + + - name: Check Clang-Tidy result + run: | + if [ $? -ne 0 ]; then + echo "Clang-Tidy found issues. Please fix them before merging." + exit 1 + fi + build-and-test-windows: name: Build and Test (Windows) runs-on: windows-latest @@ -76,34 +115,4 @@ jobs: - name: Test working-directory: ${{github.workspace}}/build - run: ctest -C Release --output-on-failure - - clang-tidy: - name: Clang-Tidy - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Install Clang and Clang-Tidy - run: | - sudo apt-get update - sudo apt-get install -y clang-tidy - - - name: Configure CMake - run: cmake -B ${{github.workspace}}/build -DSQUINT_BUILD_TESTS=ON - - - name: Build - run: cmake --build ${{github.workspace}}/build - - - name: Run Clang-Tidy - run: | - find include -name '*.cpp' -or -name '*.hpp' | \ - xargs clang-tidy -p build \ - --config-file=.clang-tidy - - - name: Check Clang-Tidy result - run: | - if [ $? -ne 0 ]; then - echo "Clang-Tidy found issues. Please fix them before merging." - exit 1 - fi \ No newline at end of file + run: ctest -C Release --output-on-failure \ No newline at end of file