Add a clang-tidy GH action #8
Workflow file for this run
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: mediasoup-worker-clang-tidy | |
| # It currently only works on pull requests. | |
| on: | |
| pull_request: | |
| paths: | |
| - 'worker/include/**/*.hpp' | |
| - 'worker/src/**/*.cpp' | |
| - '.github/workflows/mediasoup-worker-clang-tidy.yaml' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ZedThree/clang-tidy-review@v0.22.1 | |
| id: review | |
| with: | |
| apt_packages: 'libclang-rt-21-dev' | |
| build_dir: 'build' | |
| config_file: 'worker/.clang-tidy' | |
| clang_tidy_version: '21' | |
| # TMP until this bug is fixes https://github.com/ZedThree/clang-tidy-review/issues/157#issuecomment-3552341821. | |
| extra_arguments: '--allow-no-checks' | |
| include: 'worker/include/**/*.hpp,worker/src/**/*.cpp' | |
| install_commands: 'pip3 install --break-system-packages invoke && BUILD_DIR=${{ github.workspace }}/build invoke -r worker flatc' | |
| # Uploads an artifact containing clang_fixes.json. | |
| - uses: ZedThree/clang-tidy-review/upload@v0.22.1 | |
| id: upload-review | |
| # If there are any comments, fail the check. | |
| - if: steps.review.outputs.total_comments > 0 | |
| run: exit 1 |