-
Notifications
You must be signed in to change notification settings - Fork 335
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use reusable workflows for rhel and debian
- Loading branch information
1 parent
3bc809c
commit b2aee2c
Showing
8 changed files
with
168 additions
and
160 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
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
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,63 @@ | ||
name: Reusable Debian Source Build | ||
# Reusable action to simplify dealing with debian source builds | ||
# author: Christoph Froehlich <[email protected]> | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
ros_distro: | ||
description: 'ROS2 distribution name' | ||
required: true | ||
type: string | ||
ref_for_scheduled_build: | ||
description: 'Reference on which the repo should be checkout for scheduled build. Usually is this name of a branch or a tag.' | ||
default: '' | ||
required: false | ||
type: string | ||
upstream_workspace: | ||
description: 'Path to local .repos file.' | ||
default: '' | ||
required: false | ||
type: string | ||
skip_packages: | ||
description: 'Packages to skip from build and test' | ||
default: '' | ||
required: false | ||
type: string | ||
|
||
|
||
jobs: | ||
debian_source: | ||
name: ${{ inputs.ros_distro }} debian build | ||
runs-on: ubuntu-latest | ||
env: | ||
ROS_DISTRO: ${{ inputs.ros_distro }} | ||
path: src/ros2_controllers | ||
container: ghcr.io/ros-controls/ros:${{ inputs.ros_distro }}-debian | ||
steps: | ||
- name: Checkout default ref when build is not scheduled | ||
if: ${{ github.event_name != 'schedule' }} | ||
uses: actions/checkout@v4 | ||
with: | ||
path: ${{ env.path }} | ||
- name: Checkout ${{ inputs.ref_for_scheduled_build }} on scheduled build | ||
if: ${{ github.event_name == 'schedule' }} | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.ref_for_scheduled_build }} | ||
path: ${{ env.path }} | ||
- name: Build workspace | ||
shell: bash | ||
run: | | ||
source /opt/ros2_ws/install/setup.bash | ||
if [[ -n "${{ inputs.upstream_workspace }}" ]]; then | ||
vcs import src < ${{ env.path }}/${{ inputs.upstream_workspace }} | ||
fi | ||
colcon build --packages-up-to $(colcon list --paths ${{ env.path }}/* --names-only) --packages-skip ${{ inputs.skip_packages }} | ||
- name: Test workspace | ||
shell: bash | ||
continue-on-error: true | ||
run: | | ||
source /opt/ros2_ws/install/setup.bash | ||
colcon test --packages-select $(colcon list --paths ${{ env.path }}/* --names-only) --packages-skip ${{ inputs.skip_packages }} | ||
colcon test-result --verbose |
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,69 @@ | ||
name: Reusable RHEL Binary Build | ||
# Reusable action to simplify dealing with RHEL binary builds | ||
# author: Christoph Froehlich <[email protected]> | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
ros_distro: | ||
description: 'ROS2 distribution name' | ||
required: true | ||
type: string | ||
ref_for_scheduled_build: | ||
description: 'Reference on which the repo should be checkout for scheduled build. Usually is this name of a branch or a tag.' | ||
default: '' | ||
required: false | ||
type: string | ||
upstream_workspace: | ||
description: 'Path to local .repos file.' | ||
default: '' | ||
required: false | ||
type: string | ||
skip_packages: | ||
description: 'Packages to skip from build and test' | ||
default: '' | ||
required: false | ||
type: string | ||
|
||
jobs: | ||
rhel_binary: | ||
name: ${{ inputs.ros_distro }} RHEL binary build | ||
runs-on: ubuntu-latest | ||
env: | ||
path: src/ros2_controllers | ||
container: ghcr.io/ros-controls/ros:${{ inputs.ros_distro }}-rhel | ||
steps: | ||
- name: Checkout default ref when build is not scheduled | ||
if: ${{ github.event_name != 'schedule' }} | ||
uses: actions/checkout@v4 | ||
with: | ||
path: ${{ env.path }} | ||
- name: Checkout ${{ inputs.ref_for_scheduled_build }} on scheduled build | ||
if: ${{ github.event_name == 'schedule' }} | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.ref_for_scheduled_build }} | ||
path: ${{ env.path }} | ||
- name: Install dependencies | ||
run: | | ||
source /opt/ros/${{ inputs.ros_distro }}/setup.bash | ||
source /opt/ros2_ws/install/local_setup.bash | ||
if [[ -n "${{ inputs.upstream_workspace }}" ]]; then | ||
vcs import src < ${{ env.path }}/${{ inputs.upstream_workspace }} | ||
fi | ||
rosdep update | ||
rosdep install -iyr --from-path src || true | ||
- name: Build workspace | ||
# source also underlay workspace with generate_parameter_library on rhel9 | ||
run: | | ||
source /opt/ros/${{ inputs.ros_distro }}/setup.bash | ||
source /opt/ros2_ws/install/local_setup.bash | ||
colcon build --packages-up-to $(colcon list --paths ${{ env.path }}/* --names-only) --packages-skip ${{ inputs.skip_packages }} | ||
- name: Test workspace | ||
shell: bash | ||
continue-on-error: true | ||
run: | | ||
source /opt/ros/${{ inputs.ros_distro }}/setup.bash | ||
source /opt/ros2_ws/install/local_setup.bash | ||
colcon test --packages-select $(colcon list --paths ${{ env.path }}/* --names-only) --packages-skip ${{ inputs.skip_packages }} | ||
colcon test-result --verbose |
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