Skip to content

Commit

Permalink
[CI] Improvements and Cleanups (#1028)
Browse files Browse the repository at this point in the history
  • Loading branch information
christophfroehlich authored Feb 9, 2024
1 parent 89109a0 commit 1266941
Show file tree
Hide file tree
Showing 24 changed files with 199 additions and 207 deletions.
70 changes: 26 additions & 44 deletions .github/workflows/ci-ros-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,30 @@ name: ROS Lint
on:
pull_request:

env:
package-name:
ackermann_steering_controller
admittance_controller
bicycle_steering_controller
diff_drive_controller
effort_controllers
force_torque_sensor_broadcaster
forward_command_controller
gripper_controllers
imu_sensor_broadcaster
joint_state_broadcaster
joint_trajectory_controller
pid_controller
position_controllers
range_sensor_broadcaster
ros2_controllers
ros2_controllers_test_nodes
rqt_joint_trajectory_controller
steering_controllers_library
tricycle_controller
tricycle_steering_controller
velocity_controllers

jobs:
ament_lint:
name: ament_${{ matrix.linter }}
Expand All @@ -19,28 +43,7 @@ jobs:
with:
distribution: rolling
linter: ${{ matrix.linter }}
package-name:
ackermann_steering_controller
admittance_controller
bicycle_steering_controller
diff_drive_controller
effort_controllers
force_torque_sensor_broadcaster
forward_command_controller
gripper_controllers
imu_sensor_broadcaster
joint_state_broadcaster
joint_trajectory_controller
pid_controller
position_controllers
range_sensor_broadcaster
ros2_controllers
ros2_controllers_test_nodes
rqt_joint_trajectory_controller
steering_controllers_library
tricycle_controller
tricycle_steering_controller
velocity_controllers
package-name: ${{ env.package-name }}


ament_lint_100:
Expand All @@ -58,25 +61,4 @@ jobs:
distribution: rolling
linter: cpplint
arguments: "--linelength=100 --filter=-whitespace/newline"
package-name:
ackermann_steering_controller
admittance_controller
bicycle_steering_controller
diff_drive_controller
effort_controllers
force_torque_sensor_broadcaster
forward_command_controller
gripper_controllers
imu_sensor_broadcaster
joint_state_broadcaster
joint_trajectory_controller
pid_controller
position_controllers
range_sensor_broadcaster
ros2_controllers
ros2_controllers_test_nodes
rqt_joint_trajectory_controller
steering_controllers_library
tricycle_controller
tricycle_steering_controller
velocity_controllers
package-name: ${{ env.package-name }}
2 changes: 0 additions & 2 deletions .github/workflows/humble-binary-build-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ name: Humble Binary Build - main

on:
workflow_dispatch:
branches:
- humble
pull_request:
branches:
- humble
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/humble-binary-build-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ name: Humble Binary Build - testing

on:
workflow_dispatch:
branches:
- humble
pull_request:
branches:
- humble
Expand Down
25 changes: 7 additions & 18 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 @@ -12,20 +12,9 @@ on:
jobs:
humble_debian:
name: Humble debian build
runs-on: ubuntu-latest
env:
ROS_DISTRO: humble
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 and test
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-skip rqt_controller_manager rqt_joint_trajectory_controller
colcon test --packages-skip rqt_controller_manager rqt_joint_trajectory_controller control_msgs controller_manager_msgs
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
25 changes: 6 additions & 19 deletions .github/workflows/humble-rhel-binary-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,9 @@ on:
jobs:
humble_rhel_binary:
name: Humble RHEL binary build
runs-on: ubuntu-latest
env:
ROS_DISTRO: humble
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: |
rosdep update
rosdep install -iyr --from-path src/ros2_controllers || true
- name: Build and test
run: |
source /opt/ros/${{ env.ROS_DISTRO }}/setup.bash
colcon build --packages-skip rqt_joint_trajectory_controller
colcon test --packages-skip rqt_joint_trajectory_controller
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
2 changes: 0 additions & 2 deletions .github/workflows/humble-semi-binary-build-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ name: Humble Semi-Binary Build - main

on:
workflow_dispatch:
branches:
- humble
pull_request:
branches:
- humble
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/humble-semi-binary-build-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ name: Humble Semi-Binary Build - testing

on:
workflow_dispatch:
branches:
- humble
pull_request:
branches:
- humble
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/humble-source-build.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: Humble Source Build
on:
workflow_dispatch:
branches:
- humble
push:
branches:
- humble
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/iron-binary-build-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ name: Iron Binary Build - main

on:
workflow_dispatch:
branches:
- iron
- '*feature*'
- '*feature/**'
pull_request:
branches:
- iron
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/iron-binary-build-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ name: Iron Binary Build - testing

on:
workflow_dispatch:
branches:
- iron
- '*feature*'
- '*feature/**'
pull_request:
branches:
- iron
Expand Down
25 changes: 7 additions & 18 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 @@ -12,20 +12,9 @@ on:
jobs:
iron_debian:
name: Iron debian build
runs-on: ubuntu-latest
env:
ROS_DISTRO: iron
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 and test
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-skip rqt_controller_manager rqt_joint_trajectory_controller
colcon test --packages-skip rqt_controller_manager rqt_joint_trajectory_controller control_msgs controller_manager_msgs
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
27 changes: 6 additions & 21 deletions .github/workflows/iron-rhel-binary-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,9 @@ on:
jobs:
iron_rhel_binary:
name: Iron RHEL binary build
runs-on: ubuntu-latest
env:
ROS_DISTRO: iron
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: |
rosdep update
rosdep install -iyr --from-path src/ros2_controllers || true
- name: Build and test
# source also underlay workspace with generate_parameter_library on rhel9
run: |
source /opt/ros/${{ env.ROS_DISTRO }}/setup.bash
source /opt/ros2_ws/install/setup.bash
colcon build --packages-skip rqt_joint_trajectory_controller
colcon test --packages-skip rqt_joint_trajectory_controller
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
4 changes: 0 additions & 4 deletions .github/workflows/iron-semi-binary-build-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ name: Iron Semi-Binary Build - main

on:
workflow_dispatch:
branches:
- iron
- '*feature*'
- '*feature/**'
pull_request:
branches:
- iron
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/iron-semi-binary-build-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ name: Iron Semi-Binary Build - testing

on:
workflow_dispatch:
branches:
- iron
- '*feature*'
- '*feature/**'
pull_request:
branches:
- iron
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/iron-source-build.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: Iron Source Build
on:
workflow_dispatch:
branches:
- iron
push:
branches:
- iron
Expand Down
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
4 changes: 2 additions & 2 deletions .github/workflows/reusable-industrial-ci-with-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ jobs:
BASEDIR: ${{ github.workspace }}/${{ inputs.basedir }}
CACHE_PREFIX: ${{ inputs.ros_distro }}-${{ inputs.upstream_workspace }}-${{ inputs.ros_repo }}-${{ github.job }}
steps:
- name: Checkout ${{ inputs.ref }} when build is not scheduled
- name: Checkout default ref when build is not scheduled
if: ${{ github.event_name != 'schedule' }}
uses: actions/checkout@v4
- name: Checkout ${{ inputs.ref }} on scheduled build
- name: Checkout ${{ inputs.ref_for_scheduled_build }} on scheduled build
if: ${{ github.event_name == 'schedule' }}
uses: actions/checkout@v4
with:
Expand Down
Loading

0 comments on commit 1266941

Please sign in to comment.