Skip to content

Commit

Permalink
ci(clang-tidy): support target files input (#178)
Browse files Browse the repository at this point in the history
* refactor: change order of parameters

Signed-off-by: Kenji Miyake <[email protected]>

* ci(clang-tidy): support target files input

Signed-off-by: Kenji Miyake <[email protected]>

* fix

Signed-off-by: Kenji Miyake <[email protected]>

Signed-off-by: Kenji Miyake <[email protected]>
  • Loading branch information
kenji-miyake authored Sep 1, 2022
1 parent f6693b5 commit bd16c65
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
5 changes: 3 additions & 2 deletions clang-tidy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ jobs:
uses: autowarefoundation/autoware-github-actions/clang-tidy@v1
with:
rosdistro: galactic
target-packages: ${{ steps.get-modified-packages.outputs.modified-packages }}
clang-tidy-config-url: https://raw.githubusercontent.com/autowarefoundation/autoware/main/.clang-tidy
target-packages: ${{ steps.get-modified-packages.outputs.modified-packages }}
build-depends-repos: build_depends.repos
```
Expand All @@ -36,8 +36,9 @@ jobs:
| Name | Required | Description |
| --------------------- | -------- | --------------------------------------------------- |
| rosdistro | true | The ROS distro. |
| target-packages | true | The target packages to analyze by Clang-Tidy. |
| clang-tidy-config-url | true | The URL to `.clang-tidy`. |
| target-packages | true | The target packages to analyze by Clang-Tidy. |
| target-files | false | The target files. |
| build-depends-repos | false | The `.repos` file that includes build dependencies. |
| token | false | The token for build dependencies and `.clang-tidy`. |

Expand Down
19 changes: 14 additions & 5 deletions clang-tidy/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@ inputs:
rosdistro:
description: ""
required: true
target-packages:
clang-tidy-config-url:
description: ""
required: true
clang-tidy-config-url:
target-packages:
description: ""
required: true
target-files:
description: ""
required: false
build-depends-repos:
description: ""
required: false
Expand All @@ -22,9 +25,10 @@ inputs:
runs:
using: composite
steps:
- name: Show target files
- name: Show targets
run: |
echo "target packages: ${{ inputs.target-packages }}"
echo "target files: ${{ inputs.target-files }}"
shell: bash

- name: Install curl
Expand Down Expand Up @@ -93,8 +97,13 @@ runs:
- name: Get target files
id: get-target-files
run: |
package_path=$(colcon list --paths-only --packages-select ${{ inputs.target-packages }})
target_files=$(find $package_path -name "*.cpp" -or -name "*.hpp")
if [ "${{ inputs.target-files }}" != "" ]; then
target_files="${{ inputs.target-files }}"
else
package_path=$(colcon list --paths-only --packages-select ${{ inputs.target-packages }})
target_files=$(find $package_path -name "*.cpp" -or -name "*.hpp")
fi
echo ::set-output name=target-files::$target_files
shell: bash

Expand Down

0 comments on commit bd16c65

Please sign in to comment.