Skip to content

Commit

Permalink
Use reusable workflows for rhel and debian
Browse files Browse the repository at this point in the history
  • Loading branch information
christophfroehlich committed Feb 8, 2024
1 parent 3bc809c commit b2aee2c
Show file tree
Hide file tree
Showing 8 changed files with 168 additions and 160 deletions.
29 changes: 6 additions & 23 deletions .github/workflows/humble-debian-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,9 @@ on:
jobs:
humble_debian:
name: Humble debian build
runs-on: ubuntu-latest
env:
ROS_DISTRO: humble
skip-packages: rqt_joint_trajectory_controller
container: ghcr.io/ros-controls/ros:humble-debian
steps:
- uses: actions/checkout@v4
with:
path: src/ros2_controllers
ref: ${{ github.event_name == 'schedule' && 'humble' || '' }}
- name: Build workspace
shell: bash
run: |
source /opt/ros2_ws/install/setup.bash
vcs import src < src/ros2_controllers/ros2_controllers.${{ env.ROS_DISTRO }}.repos
colcon build --packages-up-to $(colcon list --paths src/ros2_controllers/* --names-only) --packages-skip ${{ env.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 src/ros2_controllers/* --names-only) --packages-skip ${{ env.skip-packages }}
colcon test-result --verbose
uses: ./.github/workflows/reusable-debian-build.yml
with:
ros_distro: humble
upstream_workspace: ros2_controllers.humble.repos
ref_for_scheduled_build: humble
skip_packages: rqt_joint_trajectory_controller
35 changes: 6 additions & 29 deletions .github/workflows/humble-rhel-binary-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,9 @@ on:
jobs:
humble_rhel_binary:
name: Humble RHEL binary build
runs-on: ubuntu-latest
env:
ROS_DISTRO: humble
skip-packages: rqt_joint_trajectory_controller
container: ghcr.io/ros-controls/ros:humble-rhel
steps:
- uses: actions/checkout@v4
with:
path: src/ros2_controllers
ref: ${{ github.event_name == 'schedule' && 'humble' || '' }}
- name: Install dependencies
run: |
source /opt/ros/${{ env.ROS_DISTRO }}/setup.bash
source /opt/ros2_ws/install/local_setup.bash
rosdep update
rosdep install -iyr --from-path src/ros2_controllers || true
- name: Build workspace
run: |
source /opt/ros/${{ env.ROS_DISTRO }}/setup.bash
source /opt/ros2_ws/install/local_setup.bash
colcon build --packages-up-to $(colcon list --paths src/ros2_controllers/* --names-only) --packages-skip ${{ env.skip-packages }}
- name: Test workspace
shell: bash
continue-on-error: true
run: |
source /opt/ros/${{ env.ROS_DISTRO }}/setup.bash
source /opt/ros2_ws/install/local_setup.bash
colcon test --packages-select $(colcon list --paths src/ros2_controllers/* --names-only) --packages-skip ${{ env.skip-packages }}
colcon test-result --verbose
uses: ./.github/workflows/reusable-rhel-binary-build.yml
with:
ros_distro: humble
upstream_workspace: ros2_controllers.humble.repos
ref_for_scheduled_build: humble
skip_packages: rqt_joint_trajectory_controller
29 changes: 6 additions & 23 deletions .github/workflows/iron-debian-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,9 @@ on:
jobs:
iron_debian:
name: Iron debian build
runs-on: ubuntu-latest
env:
ROS_DISTRO: iron
skip-packages: rqt_joint_trajectory_controller
container: ghcr.io/ros-controls/ros:iron-debian
steps:
- uses: actions/checkout@v4
with:
path: src/ros2_controllers
ref: ${{ github.event_name == 'schedule' && 'iron' || '' }}
- name: Build workspace
shell: bash
run: |
source /opt/ros2_ws/install/setup.bash
vcs import src < src/ros2_controllers/ros2_controllers.${{ env.ROS_DISTRO }}.repos
colcon build --packages-up-to $(colcon list --paths src/ros2_controllers/* --names-only) --packages-skip ${{ env.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 src/ros2_controllers/* --names-only) --packages-skip ${{ env.skip-packages }}
colcon test-result --verbose
uses: ./.github/workflows/reusable-debian-build.yml
with:
ros_distro: iron
upstream_workspace: ros2_controllers.iron.repos
ref_for_scheduled_build: iron
skip_packages: rqt_joint_trajectory_controller
36 changes: 6 additions & 30 deletions .github/workflows/iron-rhel-binary-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,33 +12,9 @@ on:
jobs:
iron_rhel_binary:
name: Iron RHEL binary build
runs-on: ubuntu-latest
env:
ROS_DISTRO: iron
skip-packages: rqt_joint_trajectory_controller
container: ghcr.io/ros-controls/ros:iron-rhel
steps:
- uses: actions/checkout@v4
with:
path: src/ros2_controllers
ref: ${{ github.event_name == 'schedule' && 'iron' || '' }}
- name: Install dependencies
run: |
source /opt/ros/${{ env.ROS_DISTRO }}/setup.bash
source /opt/ros2_ws/install/local_setup.bash
rosdep update
rosdep install -iyr --from-path src/ros2_controllers || true
- name: Build workspace
# source also underlay workspace with generate_parameter_library on rhel9
run: |
source /opt/ros/${{ env.ROS_DISTRO }}/setup.bash
source /opt/ros2_ws/install/local_setup.bash
colcon build --packages-up-to $(colcon list --paths src/ros2_controllers/* --names-only) --packages-skip ${{ env.skip-packages }}
- name: Test workspace
shell: bash
continue-on-error: true
run: |
source /opt/ros/${{ env.ROS_DISTRO }}/setup.bash
source /opt/ros2_ws/install/local_setup.bash
colcon test --packages-select $(colcon list --paths src/ros2_controllers/* --names-only) --packages-skip ${{ env.skip-packages }}
colcon test-result --verbose
uses: ./.github/workflows/reusable-rhel-binary-build.yml
with:
ros_distro: iron
upstream_workspace: ros2_controllers.iron.repos
ref_for_scheduled_build: iron
skip_packages: rqt_joint_trajectory_controller
63 changes: 63 additions & 0 deletions .github/workflows/reusable-debian-build.yml
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
69 changes: 69 additions & 0 deletions .github/workflows/reusable-rhel-binary-build.yml
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
30 changes: 6 additions & 24 deletions .github/workflows/rolling-debian-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,9 @@ on:
jobs:
rolling_debian:
name: Rolling debian build
runs-on: ubuntu-latest
env:
ROS_DISTRO: rolling
skip-packages: rqt_joint_trajectory_controller
container: ghcr.io/ros-controls/ros:rolling-debian
steps:
- uses: actions/checkout@v4
with:
path: src/ros2_controllers
# default behavior is correct on master branch
# ref: ${{ github.event_name == 'schedule' && 'master' || '' }}
- name: Build workspace
shell: bash
run: |
source /opt/ros2_ws/install/setup.bash
vcs import src < src/ros2_controllers/ros2_controllers.${{ env.ROS_DISTRO }}.repos
colcon build --packages-up-to $(colcon list --paths src/ros2_controllers/* --names-only) --packages-skip ${{ env.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 src/ros2_controllers/* --names-only) --packages-skip ${{ env.skip-packages }}
colcon test-result --verbose
uses: ./.github/workflows/reusable-debian-build.yml
with:
ros_distro: rolling
upstream_workspace: ros2_controllers.rolling.repos
ref_for_scheduled_build: master
skip_packages: rqt_joint_trajectory_controller
37 changes: 6 additions & 31 deletions .github/workflows/rolling-rhel-binary-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,34 +12,9 @@ on:
jobs:
rolling_rhel_binary:
name: Rolling RHEL binary build
runs-on: ubuntu-latest
env:
ROS_DISTRO: rolling
skip-packages: rqt_joint_trajectory_controller
container: ghcr.io/ros-controls/ros:rolling-rhel
steps:
- uses: actions/checkout@v4
with:
path: src/ros2_controllers
# default behavior is correct on master branch
# ref: ${{ github.event_name == 'schedule' && 'master' || '' }}
- name: Install dependencies
run: |
source /opt/ros/${{ env.ROS_DISTRO }}/setup.bash
source /opt/ros2_ws/install/local_setup.bash
rosdep update
rosdep install -iyr --from-path src/ros2_controllers || true
- name: Build workspace
# source also underlay workspace with generate_parameter_library on rhel9
run: |
source /opt/ros/${{ env.ROS_DISTRO }}/setup.bash
source /opt/ros2_ws/install/local_setup.bash
colcon build --packages-up-to $(colcon list --paths src/ros2_controllers/* --names-only) --packages-skip ${{ env.skip-packages }}
- name: Test workspace
shell: bash
continue-on-error: true
run: |
source /opt/ros/${{ env.ROS_DISTRO }}/setup.bash
source /opt/ros2_ws/install/local_setup.bash
colcon test --packages-select $(colcon list --paths src/ros2_controllers/* --names-only) --packages-skip ${{ env.skip-packages }}
colcon test-result --verbose
uses: ./.github/workflows/reusable-rhel-binary-build.yml
with:
ros_distro: rolling
upstream_workspace: ros2_controllers.rolling.repos
ref_for_scheduled_build: master
skip_packages: rqt_joint_trajectory_controller

0 comments on commit b2aee2c

Please sign in to comment.