Skip to content

Commit

Permalink
Use reusable wfs for debian and RHEL
Browse files Browse the repository at this point in the history
  • Loading branch information
christophfroehlich committed Feb 9, 2024
1 parent a7a2d02 commit ddc63b1
Show file tree
Hide file tree
Showing 8 changed files with 224 additions and 180 deletions.
39 changes: 12 additions & 27 deletions .github/workflows/humble-debian-build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Debian Humble Build
name: Debian Humble Source Build
on:
workflow_dispatch:
pull_request:
Expand All @@ -10,29 +10,14 @@ on:


jobs:
humble_debian:
name: Humble debian build
runs-on: ubuntu-latest
env:
ROS_DISTRO: humble
skip-packages-build: rqt_controller_manager
skip-packages-test: rqt_controller_manager controller_manager_msgs
container: ghcr.io/ros-controls/ros:humble-debian
steps:
- uses: actions/checkout@v4
with:
path: src/ros2_control
ref: ${{ github.event_name == 'schedule' && 'humble' || '' }}
- name: Build workspace
shell: bash
run: |
source /opt/ros2_ws/install/setup.bash
vcs import src < src/ros2_control/ros2_control.${{ env.ROS_DISTRO }}.repos
colcon build --packages-up-to $(colcon list --paths src/ros2_control/* --names-only) --packages-skip ${{ env.skip-packages-build }}
- 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_control/* --names-only) --packages-skip ${{ env.skip-packages-test }}
colcon test-result --verbose
debian_source_build:
uses: ./.github/workflows/reusable-debian-build.yml
strategy:
matrix:
ROS_DISTRO: [humble]
with:
ros_distro: ${{ matrix.ROS_DISTRO }}
upstream_workspace: ros2_control.${{ matrix.ROS_DISTRO }}.repos
ref_for_scheduled_build: master
skip_packages: rqt_controller_manager
skip_packages_test: controller_manager_msgs
43 changes: 11 additions & 32 deletions .github/workflows/humble-rhel-binary-build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: RHEL Humble Binary Build
name: RHEL Humble Semi-Binary Build
on:
workflow_dispatch:
pull_request:
Expand All @@ -9,34 +9,13 @@ on:
- cron: '03 1 * * *'

jobs:
humble_rhel_binary:
name: Humble RHEL binary build
runs-on: ubuntu-latest
env:
ROS_DISTRO: humble
skip-packages: rqt_controller_manager
container: ghcr.io/ros-controls/ros:humble-rhel
steps:
- uses: actions/checkout@v4
with:
path: src/ros2_control
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_control || 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_control/* --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_control/* --names-only) --packages-skip ${{ env.skip-packages }}
colcon test-result --verbose
rhel_semi_binary_build:
uses: ./.github/workflows/reusable-rhel-binary-build.yml
strategy:
matrix:
ROS_DISTRO: [humble]
with:
ros_distro: ${{ matrix.ROS_DISTRO }}
upstream_workspace: ros2_control.${{ matrix.ROS_DISTRO }}.repos
ref_for_scheduled_build: humble
skip_packages: rqt_controller_manager
39 changes: 12 additions & 27 deletions .github/workflows/iron-debian-build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Debian Iron Build
name: Debian Iron Source Build
on:
workflow_dispatch:
pull_request:
Expand All @@ -10,29 +10,14 @@ on:


jobs:
iron_debian:
name: Iron debian build
runs-on: ubuntu-latest
env:
ROS_DISTRO: iron
skip-packages-build: rqt_controller_manager
skip-packages-test: rqt_controller_manager controller_manager_msgs
container: ghcr.io/ros-controls/ros:iron-debian
steps:
- uses: actions/checkout@v4
with:
path: src/ros2_control
ref: ${{ github.event_name == 'schedule' && 'iron' || '' }}
- name: Build workspace
shell: bash
run: |
source /opt/ros2_ws/install/setup.bash
vcs import src < src/ros2_control/ros2_control.${{ env.ROS_DISTRO }}.repos
colcon build --packages-up-to $(colcon list --paths src/ros2_control/* --names-only) --packages-skip ${{ env.skip-packages-build }}
- 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_control/* --names-only) --packages-skip ${{ env.skip-packages-test }}
colcon test-result --verbose
debian_source_build:
uses: ./.github/workflows/reusable-debian-build.yml
strategy:
matrix:
ROS_DISTRO: [iron]
with:
ros_distro: ${{ matrix.ROS_DISTRO }}
upstream_workspace: ros2_control.${{ matrix.ROS_DISTRO }}.repos
ref_for_scheduled_build: master
skip_packages: rqt_controller_manager
skip_packages_test: controller_manager_msgs
44 changes: 11 additions & 33 deletions .github/workflows/iron-rhel-binary-build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: RHEL Iron Binary Build
name: RHEL Iron Semi-Binary Build
on:
workflow_dispatch:
pull_request:
Expand All @@ -9,35 +9,13 @@ on:
- cron: '03 1 * * *'

jobs:
iron_rhel_binary:
name: Iron RHEL binary build
runs-on: ubuntu-latest
env:
ROS_DISTRO: iron
skip-packages: rqt_controller_manager
container: ghcr.io/ros-controls/ros:iron-rhel
steps:
- uses: actions/checkout@v4
with:
path: src/ros2_control
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_control || 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_control/* --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_control/* --names-only) --packages-skip ${{ env.skip-packages }}
colcon test-result --verbose
rhel_semi_binary_build:
uses: ./.github/workflows/reusable-rhel-binary-build.yml
strategy:
matrix:
ROS_DISTRO: [iron]
with:
ros_distro: ${{ matrix.ROS_DISTRO }}
upstream_workspace: ros2_control.${{ matrix.ROS_DISTRO }}.repos
ref_for_scheduled_build: iron
skip_packages: rqt_controller_manager
75 changes: 75 additions & 0 deletions .github/workflows/reusable-debian-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Reusable Debian Source Build
# Reusable action to simplify dealing with debian source builds
# author: Christoph Froehlich <christoph.froehlich@ait.ac.at>

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
skip_packages_test:
description: 'Packages to skip from test additionally to skip_packages'
default: ''
required: false
type: string


jobs:
debian_source:
name: ${{ inputs.ros_distro }} debian build
runs-on: ubuntu-latest
env:
# this will be src/{repo-owner}/{repo-name}
path: src/${{ github.repository }}
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: Import upstream workspace
shell: bash
run: |
if [[ -n "${{ inputs.upstream_workspace }}" ]]; then
vcs import src < ${{ env.path }}/${{ inputs.upstream_workspace }}
fi
- 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 "package_list=$(colcon list --paths ${{ env.path }} --names-only) $(colcon list --paths ${{ env.path }}/* --names-only)" >> $GITHUB_ENV
- name: Build workspace
shell: bash
run: |
source /opt/ros2_ws/install/setup.bash
colcon build --packages-up-to ${{ env.package_list }} --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 ${{ env.package_list }} --packages-skip ${{ inputs.skip_packages }} ${{ inputs.skip_packages_test }}
colcon test-result --verbose
81 changes: 81 additions & 0 deletions .github/workflows/reusable-rhel-binary-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Reusable RHEL Binary Build
# Reusable action to simplify dealing with RHEL binary builds
# author: Christoph Froehlich <christoph.froehlich@ait.ac.at>

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
skip_packages_test:
description: 'Packages to skip from test additionally to skip_packages'
default: ''
required: false
type: string

jobs:
rhel_binary:
name: ${{ inputs.ros_distro }} RHEL binary build
runs-on: ubuntu-latest
container: ghcr.io/ros-controls/ros:${{ inputs.ros_distro }}-rhel
env:
# this will be src/{repo-owner}/{repo-name}
path: src/${{ github.repository }}
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
shell: bash
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: 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 "package_list=$(colcon list --paths ${{ env.path }} --names-only) $(colcon list --paths ${{ env.path }}/* --names-only)" >> $GITHUB_ENV
- name: Build workspace
shell: bash
# 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 ${{ env.package_list }} --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 ${{ env.package_list }} --packages-skip ${{ inputs.skip_packages }} ${{ inputs.skip_packages_test }}
colcon test-result --verbose
Loading

0 comments on commit ddc63b1

Please sign in to comment.