Worker: Ensure 4-byte alignment for network packet receive buffers and test buffers to avoid UB (undefined behavior) #183
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 | |
| on: | |
| pull_request: | |
| paths: | |
| - 'worker/src/**/*.cpp' | |
| - 'worker/include/**/*.hpp' | |
| - 'worker/test/src/**/*.cpp' | |
| - 'worker/test/include/**/*.hpp' | |
| - 'worker/fuzzer/src/**/*.cpp' | |
| - 'worker/fuzzer/include/**/*.hpp' | |
| - 'worker/meson.build' | |
| - 'worker/.clang-format' | |
| - 'worker/.clang-tidy' | |
| - '.github/workflows/mediasoup-worker-clang-tidy.yaml' | |
| jobs: | |
| clang-tidy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: pip3 install --break-system-packages invoke | |
| - name: Setup Meson build (generates compile_commands.json) | |
| working-directory: worker | |
| run: invoke setup | |
| - name: Compile flatbuffers FBS files | |
| working-directory: worker | |
| run: invoke flatc | |
| - name: Install NPM worker development tools | |
| run: npm ci --prefix worker/scripts --foreground-scripts | |
| - name: Normalize compile_commands.json paths | |
| run: npm run normalize-compile-commands --prefix worker/scripts --foreground-scripts | |
| - uses: ZedThree/clang-tidy-review@v0.23.0 | |
| id: review | |
| with: | |
| apt_packages: 'libclang-rt-21-dev' | |
| build_dir: 'worker/out/Release/build' | |
| config_file: 'worker/.clang-tidy' | |
| clang_tidy_version: '21' | |
| lgtm_comment_body: '' | |
| # TMP until this bug is fixes https://github.com/ZedThree/clang-tidy-review/issues/157#issuecomment-3552341821. | |
| extra_arguments: --allow-no-checks | |
| include: 'worker/src/**/*.cpp,worker/test/src/**/*.cpp,worker/fuzzer/src/**/*.cpp' | |
| # Uploads an artifact containing clang_fixes.json. | |
| - uses: ZedThree/clang-tidy-review/upload@v0.23.0 | |
| id: upload-review | |
| # If there are any comments, fail the check. | |
| - if: steps.review.outputs.total_comments > 0 | |
| run: exit 1 |