Implementing pin detection (#71) #62
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Clang Tidy Linting | |
| on: | |
| push: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| packages: read | |
| jobs: | |
| clang-tidy-linting: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| build-essential \ | |
| clang \ | |
| clang-tidy \ | |
| gcc \ | |
| g++ \ | |
| git \ | |
| curl \ | |
| zip \ | |
| unzip \ | |
| pkg-config \ | |
| ninja-build \ | |
| cmake | |
| - name: Setup vcpkg | |
| run: | | |
| git clone https://github.com/microsoft/vcpkg.git /tmp/vcpkg | |
| /tmp/vcpkg/bootstrap-vcpkg.sh | |
| echo "VCPKG_ROOT=/tmp/vcpkg" >> $GITHUB_ENV | |
| echo "/tmp/vcpkg" >> $GITHUB_PATH | |
| - name: Cache VCPKG | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| /tmp/vcpkg/downloads | |
| /tmp/vcpkg/installed | |
| ~/.cache/vcpkg | |
| key: ${{ runner.os }}-vcpkg-clang_debug-${{ hashFiles('vcpkg.json') }} | |
| restore-keys: ${{ runner.os }}-vcpkg- | |
| - name: Cache build | |
| uses: actions/cache@v4 | |
| with: | |
| path: build | |
| key: ${{ runner.os }}-cmake-clang_debug-${{ hashFiles('CMakeLists.txt', '**/*.cmake') }} | |
| restore-keys: ${{ runner.os }}-cmake- | |
| - name: Configure (clang_debug) | |
| run: cmake --preset clang_debug | |
| - name: Run clang-tidy | |
| shell: bash | |
| run: | | |
| set +e | |
| cmake --build --preset clang_debug --target clang-tidy 2>&1 | tee clang_tidy_output.txt | |
| CLANG_TIDY_EXIT_CODE=${PIPESTATUS[0]} # Capture CMake exit code, not tee | |
| set -e | |
| if [ $CLANG_TIDY_EXIT_CODE -eq 0 ]; then | |
| echo "<details><summary>🟢 Clang Tidy Results (click to expand)</summary>" >> $GITHUB_STEP_SUMMARY | |
| else | |
| echo "## 🔴 Clang Tidy Results" >> $GITHUB_STEP_SUMMARY | |
| fi | |
| echo '' >> $GITHUB_STEP_SUMMARY | |
| echo '```' >> $GITHUB_STEP_SUMMARY | |
| cat clang_tidy_output.txt >> $GITHUB_STEP_SUMMARY | |
| echo '```' >> $GITHUB_STEP_SUMMARY | |
| if [ $CLANG_TIDY_EXIT_CODE -eq 0 ]; then | |
| echo "</details>" >> $GITHUB_STEP_SUMMARY | |
| fi | |
| exit $CLANG_TIDY_EXIT_CODE |