[DO NOT MERGE] Add tutorials for type-erasure, reflection and vanishing-this #461
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 | |
| on: | |
| schedule: | |
| - cron: "0 1 * * *" | |
| push: | |
| branches: [main] | |
| paths: | |
| - ".github/workflows/clang-tidy.yml" # This file | |
| - "**/*.cc" | |
| - "**/*.h" | |
| - "**/CMakeLists.txt" | |
| - "CMakePresets.json" | |
| - "cmake/**" | |
| - "**/*.j2" | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - ".github/workflows/clang-tidy.yml" # This file | |
| - "**/*.cc" | |
| - "**/*.h" | |
| - "**/CMakeLists.txt" | |
| - "CMakePresets.json" | |
| - "cmake/**" | |
| - "**/*.j2" | |
| env: | |
| # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) | |
| BUILD_TYPE: Debug | |
| COMPILER_VERSION: 21 | |
| UV_FROZEN: 1 | |
| jobs: | |
| clang-tidy: | |
| # The CMake configure and build commands are platform agnostic and should work equally | |
| # well on Windows or Mac. You can convert this to a matrix build if you need | |
| # cross-platform coverage. | |
| # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: seanmiddleditch/gha-setup-ninja@master | |
| - name: Install Clang | |
| shell: bash | |
| run: | | |
| wget https://apt.llvm.org/llvm.sh | |
| chmod +x llvm.sh | |
| sudo ./llvm.sh ${{ env.COMPILER_VERSION }} all | |
| # We need to update symlink otherwise we end up with miss matched clang/clang++ and clang-tidy versions. | |
| sudo rm /usr/bin/clang | |
| sudo rm /usr/bin/clang++ | |
| sudo rm /usr/bin/clang-tidy | |
| sudo ln -s /usr/bin/clang-${{ env.COMPILER_VERSION }} /usr/bin/clang | |
| sudo ln -s /usr/bin/clang++-${{ env.COMPILER_VERSION }} /usr/bin/clang++ | |
| sudo ln -s /usr/bin/clang-tidy-${{ env.COMPILER_VERSION }} /usr/bin/clang-tidy | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Set up Python | |
| run: uv sync | |
| - uses: reviewdog/action-setup@v1.5.0 | |
| with: | |
| reviewdog_version: latest # Optional. [latest,nightly,v.X.Y.Z] | |
| - name: Run CMake | |
| run: | | |
| ./scripts/cmake.sh --debug -DCLANG_TIDY_ENABLE=1 2>&1 | tee build.log | |
| - name: Run reviewdog | |
| env: | |
| REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| cat build.log | reviewdog -reporter=github-pr-review -efm="%W%f:%l:%c: warning: %m" -efm="%E%f:%l:%c: error: %m" |