Skip to content

Commit 953d929

Browse files
authored
chore(ci): change way to modified files in clang-tidy-differential (#7639)
* chore(ci): fetch full depth in clang-tidy-differential Signed-off-by: Kotaro Yoshimoto <pythagora.yoshimoto@gmail.com> * chore(ci): use raw git to get modified files Signed-off-by: Kotaro Yoshimoto <pythagora.yoshimoto@gmail.com> * chore(ci): fix deprecated GitHub actions variable operation Signed-off-by: Kotaro Yoshimoto <pythagora.yoshimoto@gmail.com> * chore(ci): delete unnecessary steps Signed-off-by: Kotaro Yoshimoto <pythagora.yoshimoto@gmail.com> * refactor(ci): unite multiple command line into one line Signed-off-by: Kotaro Yoshimoto <pythagora.yoshimoto@gmail.com> --------- Signed-off-by: Kotaro Yoshimoto <pythagora.yoshimoto@gmail.com>
1 parent cfdd868 commit 953d929

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

.github/workflows/clang-tidy-differential.yaml

+6-12
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,10 @@ jobs:
2020
runs-on: ubuntu-latest
2121
container: ghcr.io/autowarefoundation/autoware:latest-prebuilt-cuda
2222
steps:
23-
- name: Set PR fetch depth
24-
run: echo "PR_FETCH_DEPTH=$(( ${{ github.event.pull_request.commits }} + 1 ))" >> "${GITHUB_ENV}"
25-
2623
- name: Checkout PR branch and all PR commits
2724
uses: actions/checkout@v4
2825
with:
29-
ref: ${{ github.event.pull_request.head.sha }}
30-
fetch-depth: ${{ env.PR_FETCH_DEPTH }}
26+
fetch-depth: 0
3127

3228
- name: Show disk space before the tasks
3329
run: df -h
@@ -41,19 +37,17 @@ jobs:
4137

4238
- name: Get modified files
4339
id: get-modified-files
44-
uses: tj-actions/changed-files@v42
45-
with:
46-
files: |
47-
**/*.cpp
48-
**/*.hpp
40+
run: |
41+
echo "changed_files=$(git diff --name-only "origin/${{ github.base_ref }}"...HEAD | grep -E '\.(cpp|hpp)$' || true)" >> $GITHUB_OUTPUT
42+
shell: bash
4943

5044
- name: Run clang-tidy
51-
if: ${{ steps.get-modified-files.outputs.all_changed_files != '' }}
45+
if: ${{ steps.get-modified-files.outputs.changed_files != '' }}
5246
uses: autowarefoundation/autoware-github-actions/clang-tidy@v1
5347
with:
5448
rosdistro: humble
5549
target-packages: ${{ steps.get-modified-packages.outputs.modified-packages }}
56-
target-files: ${{ steps.get-modified-files.outputs.all_changed_files }}
50+
target-files: ${{ steps.get-modified-files.outputs.changed_files }}
5751
clang-tidy-config-url: https://raw.githubusercontent.com/autowarefoundation/autoware/main/.clang-tidy
5852
build-depends-repos: build_depends.repos
5953

0 commit comments

Comments
 (0)