Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(colcon-build, colcon-test, clang-tidy): add packages-above-repos argument #333

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion clang-tidy/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
build-depends-repos:
description: ""
required: false
packages-above-repos:
description: ""
required: false
cmake-build-type:
description: ""
required: false
Expand Down Expand Up @@ -59,7 +62,7 @@
shell: bash

- name: Set git config
if: ${{ inputs.build-depends-repos != ''}}
if: ${{ inputs.build-depends-repos != '' || inputs.packages-above-repos != '' }}
uses: autowarefoundation/autoware-github-actions/set-git-config@v1
with:
token: ${{ inputs.token }}
Expand All @@ -71,6 +74,13 @@
vcs import dependency_ws < ${{ inputs.build-depends-repos }}
shell: bash

- name: Clone above dependency packages
if: ${{ inputs.packages-above-repos != '' }}
run: |
mkdir -p dependency_ws
vcs import dependency_ws < ${{ inputs.packages-above-repos }}
shell: bash

- name: Run rosdep install
run: |
package_paths=$(colcon list -p --packages-above-and-dependencies ${{ inputs.target-packages }} --base-paths . dependency_ws)
Expand Down Expand Up @@ -113,7 +123,7 @@
if [ "${{ inputs.target-files }}" != "" ]; then
target_files="${{ inputs.target-files }}"
else
mapfile -t package_paths < <(colcon list --paths-only --packages-select ${{ inputs.target-packages }})

Check warning on line 126 in clang-tidy/action.yaml

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (mapfile)
ignore_patterns=()
ignore_patterns+=( -not -path "*/test/*" )
if [ -f ${{ inputs.clang-tidy-ignore-path }} ]; then
Expand Down
2 changes: 2 additions & 0 deletions colcon-build/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
rosdistro: galactic
target-packages: ${{ steps.get-modified-packages.outputs.modified-packages }}
build-depends-repos: build_depends.repos
packages-above-repos: packages_above.repos
```

## Inputs
Expand All @@ -35,13 +36,14 @@
| rosdistro | true | ROS distro. |
| target-packages | true | The target packages to build. |
| build-depends-repos | false | The `.repos` file that includes build dependencies. |
| packages-above-repos | false | The `.repos` file that includes above build dependencies. |
| cmake-build-type | false | The value for `CMAKE_BUILD_TYPE`. |
| token | false | The token for build dependencies. |
| include-eol-distros | false | If true, adds `--include-eol-distros` to `rosdep update`. |
| cache-key-element | false | This value is added to the github actions cache key. |
| build-pre-command | false | This command is prepended to the `colcon build` to avoid draining resources. |
| colcon-parallel-workers-flag | false | Will be appended to the colcon build command to limit number of packages built in parallel. e.g. "--parallel-workers 3" |
| makeflags | false | Will be exported as MAKEFLAGS environment variable for colcon build step. e.g. "-j 4" |

Check warning on line 46 in colcon-build/README.md

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (makeflags)

Check warning on line 46 in colcon-build/README.md

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (MAKEFLAGS)

## Outputs

Expand Down
12 changes: 11 additions & 1 deletion colcon-build/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
build-depends-repos:
description: ""
required: false
packages-above-repos:
description: ""
required: false
cmake-build-type:
description: ""
required: false
Expand All @@ -34,8 +37,8 @@
description: Will be appended to the colcon build command to limit number of packages built in parallel. e.g. "--parallel-workers 3"
default: ""
required: false
makeflags:

Check warning on line 40 in colcon-build/action.yaml

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (makeflags)
description: Will be exported as MAKEFLAGS environment variable. e.g. "-j 4"

Check warning on line 41 in colcon-build/action.yaml

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (MAKEFLAGS)
default: ""
required: false

Expand All @@ -54,7 +57,7 @@
shell: bash

- name: Set git config
if: ${{ inputs.build-depends-repos != '' }}
if: ${{ inputs.build-depends-repos != '' || inputs.packages-above-repos != '' }}
uses: autowarefoundation/autoware-github-actions/set-git-config@v1
with:
token: ${{ inputs.token }}
Expand All @@ -66,6 +69,13 @@
vcs import dependency_ws < ${{ inputs.build-depends-repos }}
shell: bash

- name: Clone above dependency packages
if: ${{ inputs.packages-above-repos != '' }}
run: |
mkdir -p dependency_ws
vcs import dependency_ws < ${{ inputs.packages-above-repos }}
shell: bash

- name: Run rosdep install
run: |
package_paths=$(colcon list -p --packages-above-and-dependencies ${{ inputs.target-packages }} --base-paths . dependency_ws)
Expand All @@ -92,8 +102,8 @@
cat /etc/nsswitch.conf
sed -e 's#hosts:\(.*\)dns\(.*\)#hosts:\1\2#g' -i.bak /etc/nsswitch.conf
cat /etc/nsswitch.conf
MAKEFLAGS="${{ inputs.makeflags }}"

Check warning on line 105 in colcon-build/action.yaml

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (MAKEFLAGS)

Check warning on line 105 in colcon-build/action.yaml

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (makeflags)
echo "MAKEFLAGS=$MAKEFLAGS" # for debugging

Check warning on line 106 in colcon-build/action.yaml

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (MAKEFLAGS)

Check warning on line 106 in colcon-build/action.yaml

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (MAKEFLAGS)
${{ inputs.build-pre-command }} colcon build ${{ inputs.colcon-parallel-workers-flag }} \
--event-handlers console_cohesion+ \
--packages-above-and-dependencies ${{ inputs.target-packages }} \
Expand Down
15 changes: 9 additions & 6 deletions colcon-test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
rosdistro: galactic
target-packages: ${{ steps.get-modified-packages.outputs.modified-packages }}
build-depends-repos: build_depends.repos
packages-above-repos: packages_above.repos

test:
needs: build
Expand Down Expand Up @@ -57,6 +58,7 @@ jobs:
rosdistro: galactic
target-packages: ${{ steps.get-modified-packages.outputs.modified-packages }}
build-depends-repos: build_depends.repos
packages-above-repos: packages_above.repos

- name: Upload coverage to Codecov
if: ${{ steps.test.outputs.coverage-report-files != '' }}
Expand All @@ -70,12 +72,13 @@ jobs:

## Inputs

| Name | Required | Description |
| ------------------- | -------- | --------------------------------------------------- |
| rosdistro | true | ROS distro. |
| target-packages | true | The target packages to test. |
| build-depends-repos | false | The `.repos` file that includes build dependencies. |
| token | false | The token for build dependencies. |
| Name | Required | Description |
| -------------------- | -------- | --------------------------------------------------------- |
| rosdistro | true | ROS distro. |
| target-packages | true | The target packages to test. |
| build-depends-repos | false | The `.repos` file that includes build dependencies. |
| packages-above-repos | false | The `.repos` file that includes above build dependencies. |
| token | false | The token for build dependencies. |

## Outputs

Expand Down
12 changes: 11 additions & 1 deletion colcon-test/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ inputs:
build-depends-repos:
description: ""
required: false
packages-above-repos:
description: ""
required: false
token:
description: ""
required: false
Expand Down Expand Up @@ -49,7 +52,7 @@ runs:
shell: bash

- name: Set git config
if: ${{ inputs.build-depends-repos != '' }}
if: ${{ inputs.build-depends-repos != '' || inputs.packages-above-repos != '' }}
uses: autowarefoundation/autoware-github-actions/set-git-config@v1
with:
token: ${{ inputs.token }}
Expand All @@ -61,6 +64,13 @@ runs:
vcs import dependency_ws < ${{ inputs.build-depends-repos }}
shell: bash

- name: Clone above dependency packages
if: ${{ inputs.packages-above-repos != '' }}
run: |
mkdir -p dependency_ws
vcs import dependency_ws < ${{ inputs.packages-above-repos }}
shell: bash

- name: Run rosdep install
run: |
package_paths=$(colcon list -p --packages-above-and-dependencies ${{ inputs.target-packages }} --base-paths . dependency_ws)
Expand Down
Loading