-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CI] Composite action and
os_name
(#11)
- Loading branch information
1 parent
aa86661
commit 3dfe127
Showing
4 changed files
with
56 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: 'Get package list' | ||
# has to be run after ROS 2 setup, i.e., by ros-tooling/setup-ros | ||
description: 'Get a list of packages in the given path' | ||
inputs: | ||
path: | ||
description: 'Path to the repository after checkout' | ||
required: true | ||
outputs: | ||
package_list: | ||
description: "A white-space separated list of packages" | ||
value: ${{ steps.colcon.outputs.package_list }} | ||
repo_name: | ||
description: "The name of the repo, last part of github.repository" | ||
value: ${{ steps.split_repo.outputs.repo_name }} | ||
|
||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- id: colcon | ||
run: | | ||
echo "package_list=$(colcon list --paths ${{ inputs.path }} --names-only | tr '\n' ' ') $(colcon list --paths ${{ inputs.path }}/* --names-only | tr '\n' ' ')" >> $GITHUB_OUTPUT | ||
shell: bash | ||
- id: split_repo | ||
run: | | ||
echo "repo_name=$(echo ${{ github.repository }} | cut -d '/' -f 2)" >> $GITHUB_OUTPUT | ||
shell: bash | ||
- run: | | ||
echo "repo ${{ steps.split_repo.outputs.repo_name }} contains the packages: ${{ steps.colcon.outputs.package_list }}" | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,11 +18,16 @@ on: | |
default: 'master' | ||
required: false | ||
type: string | ||
os_name: | ||
description: 'On which OS to run the linter' | ||
required: false | ||
default: 'ubuntu-latest' | ||
type: string | ||
|
||
jobs: | ||
reusable_ros_tooling_source_build: | ||
name: ${{ inputs.ros_distro }} ubuntu-22.04 | ||
runs-on: ubuntu-22.04 | ||
name: ${{ inputs.ros_distro }} ${{ inputs.os_name }} | ||
runs-on: ${{ inputs.os_name }} | ||
env: | ||
# this will be src/{repo-owner}/{repo-name} | ||
path: src/${{ github.repository }} | ||
|
@@ -36,22 +41,20 @@ jobs: | |
with: | ||
ref: ${{ inputs.ref }} | ||
path: ${{ env.path }} | ||
- name: Get list of packages | ||
# we need both paths, there is no wildcard/glob for packages defined in the root folder and subfolders at the same time | ||
run: | | ||
echo "REPO_NAME=$(echo ${{ github.repository }} | cut -d '/' -f 2)" >> $GITHUB_ENV | ||
echo "package_list=$(colcon list --paths ${{ env.path }} --names-only | tr '\n' ' ') $(colcon list --paths ${{ env.path }}/* --names-only | tr '\n' ' ')" >> $GITHUB_ENV | ||
echo "repo ${{ env.REPO_NAME}} has packages: ${{ env.package_list }}" | ||
- id: package_list_action | ||
uses: ros-controls/ros2_control_ci/.github/actions/set-package-list@master | ||
with: | ||
path: ${{ env.path }} | ||
- uses: ros-tooling/[email protected] | ||
with: | ||
target-ros2-distro: ${{ inputs.ros_distro }} | ||
ref: ${{ inputs.ref }} | ||
package-name: ${{ env.package_list }} | ||
package-name: ${{ steps.package_list_action.outputs.package_list }} | ||
vcs-repo-file-url: | | ||
https://raw.githubusercontent.com/ros2/ros2/${{ inputs.ros2_repo_branch }}/ros2.repos | ||
${{ env.path }}/${{ env.REPO_NAME}}.${{ inputs.ros_distro }}.repos | ||
${{ env.path }}/${{ steps.package_list_action.outputs.repo_name }}.${{ inputs.ros_distro }}.repos | ||
colcon-mixin-repository: https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml | ||
- uses: actions/[email protected] | ||
with: | ||
name: colcon-logs-ubuntu-22.04-${{ inputs.ros_distro }} | ||
name: colcon-logs-${{ inputs.os_name }}-${{ inputs.ros_distro }} | ||
path: ros_ws/log |