|
| 1 | +name: clang-tidy-review |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + |
| 6 | +env: |
| 7 | + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |
| 8 | + |
| 9 | +jobs: |
| 10 | + clang-tidy-review: |
| 11 | + strategy: |
| 12 | + matrix: |
| 13 | + BUILD_TYPE: [Release] |
| 14 | + |
| 15 | + # See: [About GitHub-hosted runners](https://docs.github.com/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners) |
| 16 | + # See: [Choosing the runner for a job](https://docs.github.com/actions/writing-workflows/choosing-where-your-workflow-runs/choosing-the-runner-for-a-job) |
| 17 | + # See: https://github.com/actions/runner-images/ |
| 18 | + runs-on: ubuntu-latest |
| 19 | + |
| 20 | + env: |
| 21 | + BUILD_TYPE: ${{matrix.BUILD_TYPE}} |
| 22 | + BUILD_DIR: ${{github.workspace}}/build |
| 23 | + SOURCE_DIR: ${{github.workspace}}/.cache/source |
| 24 | + TOOLS_DIR: ${{github.workspace}}/.cache/tools |
| 25 | + INSTALL_DIR: ${{github.workspace}}/.cache/install |
| 26 | + |
| 27 | + steps: |
| 28 | + - name: Checkout Repository |
| 29 | + uses: actions/checkout@v6 |
| 30 | + with: |
| 31 | + submodules: recursive |
| 32 | + |
| 33 | + - name: Make directories |
| 34 | + run: | |
| 35 | + cmake -E make_directory ${{env.BUILD_DIR}} |
| 36 | + cmake -E make_directory ${{env.SOURCE_DIR}} |
| 37 | + cmake -E make_directory ${{env.TOOLS_DIR}} |
| 38 | + cmake -E make_directory ${{env.INSTALL_DIR}} |
| 39 | +
|
| 40 | + - name: Cache installed |
| 41 | + uses: actions/cache@v5 |
| 42 | + id: cache-installed |
| 43 | + with: |
| 44 | + path: | |
| 45 | + ${{env.INSTALL_DIR}} |
| 46 | + key: install_ubuntu_${{matrix.BUILD_TYPE}} |
| 47 | + |
| 48 | + # Run clang-tidy |
| 49 | + - uses: ZedThree/clang-tidy-review@v0.23.1 |
| 50 | + env: |
| 51 | + RabbitCommon_ROOT: ${{env.SOURCE_DIR}}/RabbitCommon |
| 52 | + id: review |
| 53 | + with: |
| 54 | + split_workflow: true |
| 55 | + clang_tidy_checks: '' |
| 56 | + lgtm_comment_body: 'clang-tidy review says "All clean, LGTM! 👍"' |
| 57 | + # CMake command to run in order to generate compile_commands.json |
| 58 | + build_dir: ${{env.BUILD_DIR}} |
| 59 | + cmake_command: | |
| 60 | + ./Script/build_linux.sh --lint |
| 61 | +
|
| 62 | + # Uploads an artefact containing clang_fixes.json |
| 63 | + - uses: ZedThree/clang-tidy-review/upload@v0.19.0 |
| 64 | + id: upload-review |
0 commit comments