|
| 1 | +name: clang-tidy-differential |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + types: |
| 6 | + - opened |
| 7 | + - synchronize |
| 8 | + - reopened |
| 9 | + - labeled |
| 10 | + |
| 11 | +jobs: |
| 12 | + make-sure-label-is-present: |
| 13 | + uses: autowarefoundation/autoware-github-actions/.github/workflows/make-sure-label-is-present.yaml@v1 |
| 14 | + with: |
| 15 | + label: tag:run-clang-tidy-differential |
| 16 | + |
| 17 | + clang-tidy-differential: |
| 18 | + needs: make-sure-label-is-present |
| 19 | + if: ${{ needs.make-sure-label-is-present.outputs.result == 'true' }} |
| 20 | + runs-on: ubuntu-latest |
| 21 | + container: ghcr.io/autowarefoundation/autoware:latest-autoware-universe-cuda |
| 22 | + steps: |
| 23 | + - name: Set PR fetch depth |
| 24 | + run: echo "PR_FETCH_DEPTH=$(( ${{ github.event.pull_request.commits }} + 1 ))" >> "${GITHUB_ENV}" |
| 25 | + |
| 26 | + - name: Checkout PR branch and all PR commits |
| 27 | + uses: actions/checkout@v4 |
| 28 | + with: |
| 29 | + ref: ${{ github.event.pull_request.head.sha }} |
| 30 | + fetch-depth: ${{ env.PR_FETCH_DEPTH }} |
| 31 | + |
| 32 | + - name: Show disk space before the tasks |
| 33 | + run: df -h |
| 34 | + |
| 35 | + - name: Remove exec_depend |
| 36 | + uses: autowarefoundation/autoware-github-actions/remove-exec-depend@v1 |
| 37 | + |
| 38 | + - name: Get modified packages |
| 39 | + id: get-modified-packages |
| 40 | + uses: autowarefoundation/autoware-github-actions/get-modified-packages@v1 |
| 41 | + |
| 42 | + - name: Get modified files |
| 43 | + id: get-modified-files |
| 44 | + uses: tj-actions/changed-files@v42 |
| 45 | + with: |
| 46 | + files: | |
| 47 | + **/*.cpp |
| 48 | + **/*.hpp |
| 49 | +
|
| 50 | + - name: Run clang-tidy |
| 51 | + if: ${{ steps.get-modified-files.outputs.all_changed_files != '' }} |
| 52 | + uses: autowarefoundation/autoware-github-actions/clang-tidy@v1 |
| 53 | + with: |
| 54 | + rosdistro: humble |
| 55 | + target-packages: ${{ steps.get-modified-packages.outputs.modified-packages }} |
| 56 | + target-files: ${{ steps.get-modified-files.outputs.all_changed_files }} |
| 57 | + clang-tidy-config-url: https://raw.githubusercontent.com/autowarefoundation/autoware/main/.clang-tidy |
| 58 | + build-depends-repos: build_depends.repos |
| 59 | + |
| 60 | + - name: Show disk space after the tasks |
| 61 | + run: df -h |
0 commit comments