Skip to content

Commit

Permalink
chore(ci): change way to modified files in clang-tidy-differential (a…
Browse files Browse the repository at this point in the history
…utowarefoundation#7639)

* chore(ci): fetch full depth in clang-tidy-differential

Signed-off-by: Kotaro Yoshimoto <[email protected]>

* chore(ci): use raw git to get modified files

Signed-off-by: Kotaro Yoshimoto <[email protected]>

* chore(ci): fix deprecated GitHub actions variable operation

Signed-off-by: Kotaro Yoshimoto <[email protected]>

* chore(ci): delete unnecessary steps

Signed-off-by: Kotaro Yoshimoto <[email protected]>

* refactor(ci): unite multiple command line into one line

Signed-off-by: Kotaro Yoshimoto <[email protected]>

---------

Signed-off-by: Kotaro Yoshimoto <[email protected]>
Signed-off-by: Simon Eisenmann <[email protected]>
  • Loading branch information
HansRobo authored and simon-eisenmann-driveblocks committed Jun 26, 2024
1 parent d0d921b commit 16f62b9
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions .github/workflows/clang-tidy-differential.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,10 @@ jobs:
runs-on: ubuntu-latest
container: ghcr.io/autowarefoundation/autoware:latest-prebuilt-cuda
steps:
- name: Set PR fetch depth
run: echo "PR_FETCH_DEPTH=$(( ${{ github.event.pull_request.commits }} + 1 ))" >> "${GITHUB_ENV}"

- name: Checkout PR branch and all PR commits
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: ${{ env.PR_FETCH_DEPTH }}
fetch-depth: 0

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

- name: Get modified files
id: get-modified-files
uses: tj-actions/changed-files@v42
with:
files: |
**/*.cpp
**/*.hpp
run: |
echo "changed_files=$(git diff --name-only "origin/${{ github.base_ref }}"...HEAD | grep -E '\.(cpp|hpp)$' || true)" >> $GITHUB_OUTPUT
shell: bash

- name: Run clang-tidy
if: ${{ steps.get-modified-files.outputs.all_changed_files != '' }}
if: ${{ steps.get-modified-files.outputs.changed_files != '' }}
uses: autowarefoundation/autoware-github-actions/clang-tidy@v1
with:
rosdistro: humble
target-packages: ${{ steps.get-modified-packages.outputs.modified-packages }}
target-files: ${{ steps.get-modified-files.outputs.all_changed_files }}
target-files: ${{ steps.get-modified-files.outputs.changed_files }}
clang-tidy-config-url: https://raw.githubusercontent.com/autowarefoundation/autoware/main/.clang-tidy
build-depends-repos: build_depends.repos

Expand Down

0 comments on commit 16f62b9

Please sign in to comment.