From 3252a27c4f73678b6b4e215f83d04c4aac442945 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20Fr=C3=B6hlich?= Date: Thu, 8 Feb 2024 02:51:04 +0100 Subject: [PATCH] [CI] Improvements and Cleanups (#1376) --- .github/workflows/ci-ros-lint.yml | 35 ++++++++----------- .github/workflows/humble-debian-build.yml | 13 +++++-- .../workflows/humble-rhel-binary-build.yml | 17 ++++++--- .github/workflows/iron-debian-build.yml | 13 +++++-- .github/workflows/iron-rhel-binary-build.yml | 18 +++++++--- .github/workflows/rolling-debian-build.yml | 12 +++++-- .../workflows/rolling-rhel-binary-build.yml | 18 +++++++--- 7 files changed, 84 insertions(+), 42 deletions(-) diff --git a/.github/workflows/ci-ros-lint.yml b/.github/workflows/ci-ros-lint.yml index 52da5edfe4..785afa5ede 100644 --- a/.github/workflows/ci-ros-lint.yml +++ b/.github/workflows/ci-ros-lint.yml @@ -2,6 +2,18 @@ name: ROS Lint on: pull_request: +env: + package-name: + controller_interface + controller_manager + controller_manager_msgs + hardware_interface + hardware_interface_testing + ros2controlcli + ros2_control + ros2_control_test_assets + transmission_interface + jobs: ament_lint: name: ament_${{ matrix.linter }} @@ -19,17 +31,7 @@ jobs: with: distribution: rolling linter: ${{ matrix.linter }} - package-name: - controller_interface - controller_manager - controller_manager_msgs - hardware_interface - hardware_interface_testing - ros2controlcli - ros2_control - ros2_control_test_assets - transmission_interface - + package-name: ${{ env.package-name }} ament_lint_100: name: ament_${{ matrix.linter }} runs-on: ubuntu-latest @@ -45,13 +47,4 @@ jobs: distribution: rolling linter: cpplint arguments: "--linelength=100 --filter=-whitespace/newline" - package-name: - controller_interface - controller_manager - controller_manager_msgs - hardware_interface - hardware_interface_testing - ros2controlcli - ros2_control - ros2_control_test_assets - transmission_interface + package-name: ${{ env.package-name }} diff --git a/.github/workflows/humble-debian-build.yml b/.github/workflows/humble-debian-build.yml index a3b070355c..482504c59a 100644 --- a/.github/workflows/humble-debian-build.yml +++ b/.github/workflows/humble-debian-build.yml @@ -15,17 +15,24 @@ jobs: 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 and test + - 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-skip rqt_controller_manager - colcon test --packages-skip rqt_controller_manager control_msgs controller_manager_msgs + 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 diff --git a/.github/workflows/humble-rhel-binary-build.yml b/.github/workflows/humble-rhel-binary-build.yml index 774a04753f..9d3b095e39 100644 --- a/.github/workflows/humble-rhel-binary-build.yml +++ b/.github/workflows/humble-rhel-binary-build.yml @@ -14,6 +14,7 @@ jobs: 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 @@ -22,12 +23,20 @@ jobs: 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 and test + - 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/setup.bash - colcon build --packages-skip rqt_controller_manager - colcon test --packages-skip rqt_controller_manager ros2controlcli + 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 diff --git a/.github/workflows/iron-debian-build.yml b/.github/workflows/iron-debian-build.yml index 75714c5c2a..35db1eb8d9 100644 --- a/.github/workflows/iron-debian-build.yml +++ b/.github/workflows/iron-debian-build.yml @@ -15,17 +15,24 @@ jobs: 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 and test + - 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-skip rqt_controller_manager - colcon test --packages-skip rqt_controller_manager control_msgs controller_manager_msgs + 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 diff --git a/.github/workflows/iron-rhel-binary-build.yml b/.github/workflows/iron-rhel-binary-build.yml index 8e8851e448..435c3e9316 100644 --- a/.github/workflows/iron-rhel-binary-build.yml +++ b/.github/workflows/iron-rhel-binary-build.yml @@ -14,6 +14,7 @@ jobs: 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 @@ -22,12 +23,21 @@ jobs: 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 and test + - 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/setup.bash - colcon build --packages-skip rqt_controller_manager - colcon test --packages-skip rqt_controller_manager ros2controlcli + 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 diff --git a/.github/workflows/rolling-debian-build.yml b/.github/workflows/rolling-debian-build.yml index b94fd800f9..efe1422404 100644 --- a/.github/workflows/rolling-debian-build.yml +++ b/.github/workflows/rolling-debian-build.yml @@ -15,6 +15,7 @@ jobs: runs-on: ubuntu-latest env: ROS_DISTRO: rolling + skip-packages: rqt_controller_manager container: ghcr.io/ros-controls/ros:rolling-debian steps: - uses: actions/checkout@v4 @@ -22,11 +23,16 @@ jobs: path: src/ros2_control # default behavior is correct on master branch # ref: ${{ github.event_name == 'schedule' && 'master' || '' }} - - name: Build and test + - 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-skip rqt_controller_manager - colcon test --packages-skip rqt_controller_manager + 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/ros2_ws/install/setup.bash + colcon test --packages-select $(colcon list --paths src/ros2_control/* --names-only) --packages-skip ${{ env.skip-packages }} colcon test-result --verbose diff --git a/.github/workflows/rolling-rhel-binary-build.yml b/.github/workflows/rolling-rhel-binary-build.yml index e8ebf6eb2c..8f2638405b 100644 --- a/.github/workflows/rolling-rhel-binary-build.yml +++ b/.github/workflows/rolling-rhel-binary-build.yml @@ -14,6 +14,7 @@ jobs: runs-on: ubuntu-latest env: ROS_DISTRO: rolling + skip-packages: rqt_controller_manager container: ghcr.io/ros-controls/ros:rolling-rhel steps: - uses: actions/checkout@v4 @@ -23,12 +24,21 @@ jobs: # 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_control || true - - name: Build and test + - 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/setup.bash - colcon build --packages-skip rqt_controller_manager - colcon test --packages-skip rqt_controller_manager ros2controlcli + 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