From a8302c33a3a3834a5adcaf1a3a492a652b7fce7c Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Fri, 9 Feb 2024 13:16:55 +0000 Subject: [PATCH 1/8] Make source build reusable wf independent of repository --- .../reusable-industrial-ci-with-cache.yml | 5 ++++ .../reusable-ros-tooling-source-build.yml | 27 ++++++++++--------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/.github/workflows/reusable-industrial-ci-with-cache.yml b/.github/workflows/reusable-industrial-ci-with-cache.yml index acefeebfac..a5e54a8fe5 100644 --- a/.github/workflows/reusable-industrial-ci-with-cache.yml +++ b/.github/workflows/reusable-industrial-ci-with-cache.yml @@ -55,14 +55,19 @@ jobs: CCACHE_DIR: ${{ github.workspace }}/${{ inputs.ccache_dir }} BASEDIR: ${{ github.workspace }}/${{ inputs.basedir }} CACHE_PREFIX: ${{ inputs.ros_distro }}-${{ inputs.upstream_workspace }}-${{ inputs.ros_repo }}-${{ github.job }} + # this will be src/{repo-owner}/{repo-name} + path: src/${{ github.repository }} steps: - name: Checkout ${{ inputs.ref }} when build is not scheduled if: ${{ github.event_name != 'schedule' }} uses: actions/checkout@v4 + with: + path: ${{ env.path }} - name: Checkout ${{ inputs.ref }} on scheduled build if: ${{ github.event_name == 'schedule' }} uses: actions/checkout@v4 with: + path: ${{ env.path }} ref: ${{ inputs.ref_for_scheduled_build }} - name: cache target_ws if: ${{ ! matrix.env.CCOV }} diff --git a/.github/workflows/reusable-ros-tooling-source-build.yml b/.github/workflows/reusable-ros-tooling-source-build.yml index fa96b7288c..dee65152e8 100644 --- a/.github/workflows/reusable-ros-tooling-source-build.yml +++ b/.github/workflows/reusable-ros-tooling-source-build.yml @@ -14,7 +14,7 @@ on: required: true type: string ros2_repo_branch: - description: 'Branch in the ros2/ros2 repository from which ".repos" should be used. Possible values: master (Rolling), humble.' + description: 'Branch in the ros2/ros2 repository from which ".repos" should be used.' default: 'master' required: false type: string @@ -23,6 +23,9 @@ jobs: reusable_ros_tooling_source_build: name: ${{ inputs.ros_distro }} ubuntu-22.04 runs-on: ubuntu-22.04 + env: + # this will be src/{repo-owner}/{repo-name} + path: src/${{ github.repository }} strategy: fail-fast: false steps: @@ -32,23 +35,21 @@ jobs: - uses: actions/checkout@v4 with: ref: ${{ inputs.ref }} + path: ${{ env.path }} + - 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 "REPO_NAME=$(echo ${{ github.repository }} | cut -d '/' -f 2)" >> $GITHUB_ENV + echo "package_list=$(colcon list --paths ${{ env.path }} --names-only) $(colcon list --paths ${{ env.path }}/* --names-only)" >> $GITHUB_ENV + echo "repo ${{ env.REPO_NAME}} has packages: ${{ env.package_list }}" - uses: ros-tooling/action-ros-ci@0.3.6 with: target-ros2-distro: ${{ inputs.ros_distro }} - # build all packages listed in the meta package - ref: ${{ inputs.ref }} # otherwise the default branch is used for scheduled workflows - package-name: - controller_interface - controller_manager - controller_manager_msgs - hardware_interface - ros2controlcli - ros2_control - ros2_control_test_assets - transmission_interface + ref: ${{ inputs.ref }} + package-name: ${{ env.package_list }} vcs-repo-file-url: | https://raw.githubusercontent.com/ros2/ros2/${{ inputs.ros2_repo_branch }}/ros2.repos - https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}/ros2_control.${{ inputs.ros_distro }}.repos?token=${{ secrets.GITHUB_TOKEN }} + ${{ env.path }}/${{ env.REPO_NAME}}.${{ inputs.ros_distro }}.repos colcon-mixin-repository: https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml - uses: actions/upload-artifact@v4.3.0 with: From 316524f303a2030760407787ee0b92ef32449daf Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Fri, 9 Feb 2024 13:16:55 +0000 Subject: [PATCH 2/8] Use reusable wfs for debian and RHEL --- .github/workflows/humble-debian-build.yml | 39 +++------ .../workflows/humble-rhel-binary-build.yml | 43 +++------- .github/workflows/iron-debian-build.yml | 39 +++------ .github/workflows/iron-rhel-binary-build.yml | 44 +++------- .github/workflows/reusable-debian-build.yml | 75 +++++++++++++++++ .../workflows/reusable-rhel-binary-build.yml | 81 +++++++++++++++++++ .github/workflows/rolling-debian-build.yml | 38 +++------ .../workflows/rolling-rhel-binary-build.yml | 45 +++-------- 8 files changed, 224 insertions(+), 180 deletions(-) create mode 100644 .github/workflows/reusable-debian-build.yml create mode 100644 .github/workflows/reusable-rhel-binary-build.yml diff --git a/.github/workflows/humble-debian-build.yml b/.github/workflows/humble-debian-build.yml index 482504c59a..461e3cfd76 100644 --- a/.github/workflows/humble-debian-build.yml +++ b/.github/workflows/humble-debian-build.yml @@ -1,4 +1,4 @@ -name: Debian Humble Build +name: Debian Humble Source Build on: workflow_dispatch: pull_request: @@ -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 diff --git a/.github/workflows/humble-rhel-binary-build.yml b/.github/workflows/humble-rhel-binary-build.yml index 9d3b095e39..d1c08e7860 100644 --- a/.github/workflows/humble-rhel-binary-build.yml +++ b/.github/workflows/humble-rhel-binary-build.yml @@ -1,4 +1,4 @@ -name: RHEL Humble Binary Build +name: RHEL Humble Semi-Binary Build on: workflow_dispatch: pull_request: @@ -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 diff --git a/.github/workflows/iron-debian-build.yml b/.github/workflows/iron-debian-build.yml index 35db1eb8d9..5934064de9 100644 --- a/.github/workflows/iron-debian-build.yml +++ b/.github/workflows/iron-debian-build.yml @@ -1,4 +1,4 @@ -name: Debian Iron Build +name: Debian Iron Source Build on: workflow_dispatch: pull_request: @@ -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 diff --git a/.github/workflows/iron-rhel-binary-build.yml b/.github/workflows/iron-rhel-binary-build.yml index 435c3e9316..8ac5bdd954 100644 --- a/.github/workflows/iron-rhel-binary-build.yml +++ b/.github/workflows/iron-rhel-binary-build.yml @@ -1,4 +1,4 @@ -name: RHEL Iron Binary Build +name: RHEL Iron Semi-Binary Build on: workflow_dispatch: pull_request: @@ -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 diff --git a/.github/workflows/reusable-debian-build.yml b/.github/workflows/reusable-debian-build.yml new file mode 100644 index 0000000000..6fca63e767 --- /dev/null +++ b/.github/workflows/reusable-debian-build.yml @@ -0,0 +1,75 @@ +name: Reusable Debian Source Build +# Reusable action to simplify dealing with debian source builds +# author: Christoph Froehlich + +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 diff --git a/.github/workflows/reusable-rhel-binary-build.yml b/.github/workflows/reusable-rhel-binary-build.yml new file mode 100644 index 0000000000..d123fd933a --- /dev/null +++ b/.github/workflows/reusable-rhel-binary-build.yml @@ -0,0 +1,81 @@ +name: Reusable RHEL Binary Build +# Reusable action to simplify dealing with RHEL binary builds +# author: Christoph Froehlich + +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 diff --git a/.github/workflows/rolling-debian-build.yml b/.github/workflows/rolling-debian-build.yml index efe1422404..a6de78ff51 100644 --- a/.github/workflows/rolling-debian-build.yml +++ b/.github/workflows/rolling-debian-build.yml @@ -1,4 +1,4 @@ -name: Debian Rolling Build +name: Debian Rolling Source Build on: workflow_dispatch: pull_request: @@ -10,29 +10,13 @@ on: jobs: - rolling_debian: - name: Rolling debian build - 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 - with: - path: src/ros2_control - # 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_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 }} - - 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 + debian_source_build: + uses: ./.github/workflows/reusable-debian-build.yml + strategy: + matrix: + ROS_DISTRO: [rolling] + with: + ros_distro: ${{ matrix.ROS_DISTRO }} + upstream_workspace: ros2_control.${{ matrix.ROS_DISTRO }}.repos + ref_for_scheduled_build: master + skip_packages: rqt_controller_manager diff --git a/.github/workflows/rolling-rhel-binary-build.yml b/.github/workflows/rolling-rhel-binary-build.yml index 8f2638405b..b511883b77 100644 --- a/.github/workflows/rolling-rhel-binary-build.yml +++ b/.github/workflows/rolling-rhel-binary-build.yml @@ -1,4 +1,4 @@ -name: RHEL Rolling Binary Build +name: RHEL Rolling Semi-Binary Build on: workflow_dispatch: pull_request: @@ -9,36 +9,13 @@ on: - cron: '03 1 * * *' jobs: - rolling_rhel_binary: - name: Rolling RHEL binary build - 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 - with: - path: src/ros2_control - # 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_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: [rolling] + with: + ros_distro: ${{ matrix.ROS_DISTRO }} + upstream_workspace: ros2_control.${{ matrix.ROS_DISTRO }}.repos + ref_for_scheduled_build: master + skip_packages: rqt_controller_manager From 9852bd7ec4fe013ef80e7564892967f490eb00cf Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Fri, 9 Feb 2024 15:54:58 +0000 Subject: [PATCH 3/8] No need for path with industrial_ci --- .github/workflows/reusable-industrial-ci-with-cache.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/reusable-industrial-ci-with-cache.yml b/.github/workflows/reusable-industrial-ci-with-cache.yml index a5e54a8fe5..acefeebfac 100644 --- a/.github/workflows/reusable-industrial-ci-with-cache.yml +++ b/.github/workflows/reusable-industrial-ci-with-cache.yml @@ -55,19 +55,14 @@ jobs: CCACHE_DIR: ${{ github.workspace }}/${{ inputs.ccache_dir }} BASEDIR: ${{ github.workspace }}/${{ inputs.basedir }} CACHE_PREFIX: ${{ inputs.ros_distro }}-${{ inputs.upstream_workspace }}-${{ inputs.ros_repo }}-${{ github.job }} - # this will be src/{repo-owner}/{repo-name} - path: src/${{ github.repository }} steps: - name: Checkout ${{ inputs.ref }} when build is not scheduled if: ${{ github.event_name != 'schedule' }} uses: actions/checkout@v4 - with: - path: ${{ env.path }} - name: Checkout ${{ inputs.ref }} on scheduled build if: ${{ github.event_name == 'schedule' }} uses: actions/checkout@v4 with: - path: ${{ env.path }} ref: ${{ inputs.ref_for_scheduled_build }} - name: cache target_ws if: ${{ ! matrix.env.CCOV }} From 7a1796c6cd3c703641cf53c5cf50d7ea48ee1f6f Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Fri, 9 Feb 2024 16:15:52 +0000 Subject: [PATCH 4/8] Fix colcon list for more than one package --- .github/workflows/reusable-debian-build.yml | 2 +- .github/workflows/reusable-rhel-binary-build.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/reusable-debian-build.yml b/.github/workflows/reusable-debian-build.yml index 6fca63e767..fe6b7ddee1 100644 --- a/.github/workflows/reusable-debian-build.yml +++ b/.github/workflows/reusable-debian-build.yml @@ -60,7 +60,7 @@ jobs: - 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 + echo "package_list=$(colcon list --paths ${{ env.path }} --names-only | tr '\n' ' ') $(colcon list --paths ${{ env.path }}/* --names-only | tr '\n' ' ')" >> $GITHUB_ENV - name: Build workspace shell: bash run: | diff --git a/.github/workflows/reusable-rhel-binary-build.yml b/.github/workflows/reusable-rhel-binary-build.yml index d123fd933a..e5c1e0b1a6 100644 --- a/.github/workflows/reusable-rhel-binary-build.yml +++ b/.github/workflows/reusable-rhel-binary-build.yml @@ -63,7 +63,7 @@ jobs: - 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 + echo "package_list=$(colcon list --paths ${{ env.path }} --names-only | tr '\n' ' ') $(colcon list --paths ${{ env.path }}/* --names-only | tr '\n' ' ')" >> $GITHUB_ENV - name: Build workspace shell: bash # source also underlay workspace with generate_parameter_library on rhel9 From d931f961b00dc1096edbab6079cfe6b3b5cbd7f4 Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Fri, 9 Feb 2024 16:17:07 +0000 Subject: [PATCH 5/8] Fix colcon list for more than one package also for ros-tooling-source wf --- .github/workflows/reusable-ros-tooling-source-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/reusable-ros-tooling-source-build.yml b/.github/workflows/reusable-ros-tooling-source-build.yml index dee65152e8..f15501cd11 100644 --- a/.github/workflows/reusable-ros-tooling-source-build.yml +++ b/.github/workflows/reusable-ros-tooling-source-build.yml @@ -40,7 +40,7 @@ jobs: # we need both paths, there is no wildcard/glob for packages defined in the root folder and subfolders at the same time run: | echo "REPO_NAME=$(echo ${{ github.repository }} | cut -d '/' -f 2)" >> $GITHUB_ENV - echo "package_list=$(colcon list --paths ${{ env.path }} --names-only) $(colcon list --paths ${{ env.path }}/* --names-only)" >> $GITHUB_ENV + echo "package_list=$(colcon list --paths ${{ env.path }} --names-only | tr '\n' ' ') $(colcon list --paths ${{ env.path }}/* --names-only | tr '\n' ' ')" >> $GITHUB_ENV echo "repo ${{ env.REPO_NAME}} has packages: ${{ env.package_list }}" - uses: ros-tooling/action-ros-ci@0.3.6 with: From 2a3cb96e3eb21d65ce0f8e241a0a8a979168c2b5 Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Fri, 9 Feb 2024 16:27:04 +0000 Subject: [PATCH 6/8] Use strategy matrix for main/testing --- ...ld-testing.yml => humble-binary-build.yml} | 12 ++++++--- .../humble-semi-binary-build-main.yml | 23 ----------------- .../humble-semi-binary-build-testing.yml | 23 ----------------- ...-main.yml => humble-semi-binary-build.yml} | 12 ++++++--- ...y-build-main.yml => iron-binary-build.yml} | 10 +++++--- .../workflows/iron-semi-binary-build-main.yml | 23 ----------------- .../iron-semi-binary-build-testing.yml | 23 ----------------- ...testing.yml => iron-semi-binary-build.yml} | 12 ++++++--- ...d-testing.yml => rolling-binary-build.yml} | 14 ++++++----- .../rolling-semi-binary-build-main.yml | 25 ------------------- .../rolling-semi-binary-build-testing.yml | 23 ----------------- ...main.yml => rolling-semi-binary-build.yml} | 12 ++++++--- 12 files changed, 47 insertions(+), 165 deletions(-) rename .github/workflows/{humble-binary-build-testing.yml => humble-binary-build.yml} (62%) delete mode 100644 .github/workflows/humble-semi-binary-build-main.yml delete mode 100644 .github/workflows/humble-semi-binary-build-testing.yml rename .github/workflows/{humble-binary-build-main.yml => humble-semi-binary-build.yml} (63%) rename .github/workflows/{iron-binary-build-main.yml => iron-binary-build.yml} (73%) delete mode 100644 .github/workflows/iron-semi-binary-build-main.yml delete mode 100644 .github/workflows/iron-semi-binary-build-testing.yml rename .github/workflows/{iron-binary-build-testing.yml => iron-semi-binary-build.yml} (65%) rename .github/workflows/{rolling-binary-build-testing.yml => rolling-binary-build.yml} (62%) delete mode 100644 .github/workflows/rolling-semi-binary-build-main.yml delete mode 100644 .github/workflows/rolling-semi-binary-build-testing.yml rename .github/workflows/{rolling-binary-build-main.yml => rolling-semi-binary-build.yml} (63%) diff --git a/.github/workflows/humble-binary-build-testing.yml b/.github/workflows/humble-binary-build.yml similarity index 62% rename from .github/workflows/humble-binary-build-testing.yml rename to .github/workflows/humble-binary-build.yml index 99ff6ccd4a..5fd3cc9d01 100644 --- a/.github/workflows/humble-binary-build-testing.yml +++ b/.github/workflows/humble-binary-build.yml @@ -1,4 +1,4 @@ -name: Humble Binary Build - testing +name: Humble Binary Build # author: Denis Štogl # description: 'Build & test all dependencies from released (binary) packages.' @@ -17,8 +17,12 @@ on: jobs: binary: uses: ./.github/workflows/reusable-industrial-ci-with-cache.yml + strategy: + matrix: + ROS_DISTRO: [humble] + ROS_REPO: [main, testing] with: - ros_distro: humble - ros_repo: testing - upstream_workspace: ros2_control-not-released.humble.repos + ros_distro: ${{ matrix.ROS_DISTRO }} + ros_repo: ${{ matrix.ROS_REPO }} + upstream_workspace: ros2_control-not-released.${{ matrix.ROS_DISTRO }}.repos ref_for_scheduled_build: humble diff --git a/.github/workflows/humble-semi-binary-build-main.yml b/.github/workflows/humble-semi-binary-build-main.yml deleted file mode 100644 index 88591b69f7..0000000000 --- a/.github/workflows/humble-semi-binary-build-main.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Humble Semi-Binary Build - main -# description: 'Build & test that compiles the main dependencies from source.' - -on: - workflow_dispatch: - pull_request: - branches: - - humble - push: - branches: - - humble - schedule: - # Run every morning to detect flakiness and broken dependencies - - cron: '33 1 * * *' - -jobs: - semi_binary: - uses: ./.github/workflows/reusable-industrial-ci-with-cache.yml - with: - ros_distro: humble - ros_repo: main - upstream_workspace: ros2_control.humble.repos - ref_for_scheduled_build: humble diff --git a/.github/workflows/humble-semi-binary-build-testing.yml b/.github/workflows/humble-semi-binary-build-testing.yml deleted file mode 100644 index 3d6b2717e3..0000000000 --- a/.github/workflows/humble-semi-binary-build-testing.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Humble Semi-Binary Build - testing -# description: 'Build & test that compiles the main dependencies from source.' - -on: - workflow_dispatch: - pull_request: - branches: - - humble - push: - branches: - - humble - schedule: - # Run every morning to detect flakiness and broken dependencies - - cron: '33 1 * * *' - -jobs: - semi_binary: - uses: ./.github/workflows/reusable-industrial-ci-with-cache.yml - with: - ros_distro: humble - ros_repo: testing - upstream_workspace: ros2_control.humble.repos - ref_for_scheduled_build: humble diff --git a/.github/workflows/humble-binary-build-main.yml b/.github/workflows/humble-semi-binary-build.yml similarity index 63% rename from .github/workflows/humble-binary-build-main.yml rename to .github/workflows/humble-semi-binary-build.yml index 1fafd01c9e..8a11e9137d 100644 --- a/.github/workflows/humble-binary-build-main.yml +++ b/.github/workflows/humble-semi-binary-build.yml @@ -1,4 +1,4 @@ -name: Humble Binary Build - main +name: Humble Semi-Binary Build # author: Denis Štogl # description: 'Build & test all dependencies from released (binary) packages.' @@ -17,8 +17,12 @@ on: jobs: binary: uses: ./.github/workflows/reusable-industrial-ci-with-cache.yml + strategy: + matrix: + ROS_DISTRO: [humble] + ROS_REPO: [main, testing] with: - ros_distro: humble - ros_repo: main - upstream_workspace: ros2_control-not-released.humble.repos + ros_distro: ${{ matrix.ROS_DISTRO }} + ros_repo: ${{ matrix.ROS_REPO }} + upstream_workspace: ros2_control.${{ matrix.ROS_DISTRO }}.repos ref_for_scheduled_build: humble diff --git a/.github/workflows/iron-binary-build-main.yml b/.github/workflows/iron-binary-build.yml similarity index 73% rename from .github/workflows/iron-binary-build-main.yml rename to .github/workflows/iron-binary-build.yml index 440b573cb9..3c619de77c 100644 --- a/.github/workflows/iron-binary-build-main.yml +++ b/.github/workflows/iron-binary-build.yml @@ -1,4 +1,4 @@ -name: Iron Binary Build - main +name: Iron Binary Build # author: Denis Štogl # description: 'Build & test all dependencies from released (binary) packages.' @@ -17,8 +17,12 @@ on: jobs: binary: uses: ./.github/workflows/reusable-industrial-ci-with-cache.yml + strategy: + matrix: + ROS_DISTRO: [iron] + ROS_REPO: [main, testing] with: - ros_distro: iron - ros_repo: main + ros_distro: ${{ matrix.ROS_DISTRO }} + ros_repo: ${{ matrix.ROS_REPO }} upstream_workspace: ros2_control-not-released.iron.repos ref_for_scheduled_build: iron diff --git a/.github/workflows/iron-semi-binary-build-main.yml b/.github/workflows/iron-semi-binary-build-main.yml deleted file mode 100644 index c5697d6e74..0000000000 --- a/.github/workflows/iron-semi-binary-build-main.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Iron Semi-Binary Build - main -# description: 'Build & test that compiles the main dependencies from source.' - -on: - workflow_dispatch: - pull_request: - branches: - - iron - push: - branches: - - iron - schedule: - # Run every morning to detect flakiness and broken dependencies - - cron: '33 1 * * *' - -jobs: - semi_binary: - uses: ./.github/workflows/reusable-industrial-ci-with-cache.yml - with: - ros_distro: iron - ros_repo: main - upstream_workspace: ros2_control.iron.repos - ref_for_scheduled_build: iron diff --git a/.github/workflows/iron-semi-binary-build-testing.yml b/.github/workflows/iron-semi-binary-build-testing.yml deleted file mode 100644 index 0055e38cba..0000000000 --- a/.github/workflows/iron-semi-binary-build-testing.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Iron Semi-Binary Build - testing -# description: 'Build & test that compiles the main dependencies from source.' - -on: - workflow_dispatch: - pull_request: - branches: - - iron - push: - branches: - - iron - schedule: - # Run every morning to detect flakiness and broken dependencies - - cron: '33 1 * * *' - -jobs: - semi_binary: - uses: ./.github/workflows/reusable-industrial-ci-with-cache.yml - with: - ros_distro: iron - ros_repo: testing - upstream_workspace: ros2_control.iron.repos - ref_for_scheduled_build: iron diff --git a/.github/workflows/iron-binary-build-testing.yml b/.github/workflows/iron-semi-binary-build.yml similarity index 65% rename from .github/workflows/iron-binary-build-testing.yml rename to .github/workflows/iron-semi-binary-build.yml index 78e13f2528..3dab236df1 100644 --- a/.github/workflows/iron-binary-build-testing.yml +++ b/.github/workflows/iron-semi-binary-build.yml @@ -1,4 +1,4 @@ -name: Iron Binary Build - testing +name: Iron Semi-Binary Build # author: Denis Štogl # description: 'Build & test all dependencies from released (binary) packages.' @@ -17,8 +17,12 @@ on: jobs: binary: uses: ./.github/workflows/reusable-industrial-ci-with-cache.yml + strategy: + matrix: + ROS_DISTRO: [iron] + ROS_REPO: [main, testing] with: - ros_distro: iron - ros_repo: testing - upstream_workspace: ros2_control-not-released.iron.repos + ros_distro: ${{ matrix.ROS_DISTRO }} + ros_repo: ${{ matrix.ROS_REPO }} + upstream_workspace: ros2_control.iron.repos ref_for_scheduled_build: iron diff --git a/.github/workflows/rolling-binary-build-testing.yml b/.github/workflows/rolling-binary-build.yml similarity index 62% rename from .github/workflows/rolling-binary-build-testing.yml rename to .github/workflows/rolling-binary-build.yml index 811c96fce4..c6a81cea2c 100644 --- a/.github/workflows/rolling-binary-build-testing.yml +++ b/.github/workflows/rolling-binary-build.yml @@ -1,11 +1,9 @@ -name: Rolling Binary Build - testing +name: Rolling Binary Build # author: Denis Štogl # description: 'Build & test all dependencies from released (binary) packages.' on: workflow_dispatch: - branches: - - master pull_request: branches: - master @@ -19,8 +17,12 @@ on: jobs: binary: uses: ./.github/workflows/reusable-industrial-ci-with-cache.yml + strategy: + matrix: + ROS_DISTRO: [rolling] + ROS_REPO: [main, testing] with: - ros_distro: rolling - ros_repo: testing - upstream_workspace: ros2_control-not-released.rolling.repos + ros_distro: ${{ matrix.ROS_DISTRO }} + ros_repo: ${{ matrix.ROS_REPO }} + upstream_workspace: ros2_control-not-released.${{ matrix.ROS_DISTRO }}.repos ref_for_scheduled_build: master diff --git a/.github/workflows/rolling-semi-binary-build-main.yml b/.github/workflows/rolling-semi-binary-build-main.yml deleted file mode 100644 index 1033dd1e6c..0000000000 --- a/.github/workflows/rolling-semi-binary-build-main.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Rolling Semi-Binary Build - main -# description: 'Build & test that compiles the main dependencies from source.' - -on: - workflow_dispatch: - branches: - - master - pull_request: - branches: - - master - push: - branches: - - master - schedule: - # Run every morning to detect flakiness and broken dependencies - - cron: '33 1 * * *' - -jobs: - semi_binary: - uses: ./.github/workflows/reusable-industrial-ci-with-cache.yml - with: - ros_distro: rolling - ros_repo: main - upstream_workspace: ros2_control.rolling.repos - ref_for_scheduled_build: master diff --git a/.github/workflows/rolling-semi-binary-build-testing.yml b/.github/workflows/rolling-semi-binary-build-testing.yml deleted file mode 100644 index 17d290c45b..0000000000 --- a/.github/workflows/rolling-semi-binary-build-testing.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Rolling Semi-Binary Build - testing -# description: 'Build & test that compiles the main dependencies from source.' - -on: - workflow_dispatch: - pull_request: - branches: - - master - push: - branches: - - master - schedule: - # Run every morning to detect flakiness and broken dependencies - - cron: '33 1 * * *' - -jobs: - semi_binary: - uses: ./.github/workflows/reusable-industrial-ci-with-cache.yml - with: - ros_distro: rolling - ros_repo: testing - upstream_workspace: ros2_control.rolling.repos - ref_for_scheduled_build: master diff --git a/.github/workflows/rolling-binary-build-main.yml b/.github/workflows/rolling-semi-binary-build.yml similarity index 63% rename from .github/workflows/rolling-binary-build-main.yml rename to .github/workflows/rolling-semi-binary-build.yml index 1777810661..5ffaf0a880 100644 --- a/.github/workflows/rolling-binary-build-main.yml +++ b/.github/workflows/rolling-semi-binary-build.yml @@ -1,4 +1,4 @@ -name: Rolling Binary Build - main +name: Rolling Semi-Binary Build # author: Denis Štogl # description: 'Build & test all dependencies from released (binary) packages.' @@ -17,8 +17,12 @@ on: jobs: binary: uses: ./.github/workflows/reusable-industrial-ci-with-cache.yml + strategy: + matrix: + ROS_DISTRO: [rolling] + ROS_REPO: [main, testing] with: - ros_distro: rolling - ros_repo: main - upstream_workspace: ros2_control-not-released.rolling.repos + ros_distro: ${{ matrix.ROS_DISTRO }} + ros_repo: ${{ matrix.ROS_REPO }} + upstream_workspace: ros2_control.${{ matrix.ROS_DISTRO }}.repos ref_for_scheduled_build: master From 6707672f7352468709af60d1940128d10fa27863 Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Sun, 11 Feb 2024 21:52:12 +0000 Subject: [PATCH 7/8] Move reusable wfs to ros2_control_ci --- .github/workflows/reusable-debian-build.yml | 75 --------------- .../reusable-industrial-ci-with-cache.yml | 96 ------------------- .../workflows/reusable-rhel-binary-build.yml | 81 ---------------- .../reusable-ros-tooling-source-build.yml | 57 ----------- 4 files changed, 309 deletions(-) delete mode 100644 .github/workflows/reusable-debian-build.yml delete mode 100644 .github/workflows/reusable-industrial-ci-with-cache.yml delete mode 100644 .github/workflows/reusable-rhel-binary-build.yml delete mode 100644 .github/workflows/reusable-ros-tooling-source-build.yml diff --git a/.github/workflows/reusable-debian-build.yml b/.github/workflows/reusable-debian-build.yml deleted file mode 100644 index fe6b7ddee1..0000000000 --- a/.github/workflows/reusable-debian-build.yml +++ /dev/null @@ -1,75 +0,0 @@ -name: Reusable Debian Source Build -# Reusable action to simplify dealing with debian source builds -# author: Christoph Froehlich - -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 | tr '\n' ' ') $(colcon list --paths ${{ env.path }}/* --names-only | tr '\n' ' ')" >> $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 diff --git a/.github/workflows/reusable-industrial-ci-with-cache.yml b/.github/workflows/reusable-industrial-ci-with-cache.yml deleted file mode 100644 index acefeebfac..0000000000 --- a/.github/workflows/reusable-industrial-ci-with-cache.yml +++ /dev/null @@ -1,96 +0,0 @@ -name: Reusable industrial_ci Workflow with Cache -# Reusable action to simplify dealing with ROS/ROS2 industrial_ci builds with cache -# author: Denis Štogl - -on: - workflow_call: - inputs: - 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: 'UPSTREAM_WORKSPACE variable for industrial_ci. Usually path to local .repos file.' - required: true - type: string - ros_distro: - description: 'ROS_DISTRO variable for industrial_ci' - required: true - type: string - ros_repo: - description: 'ROS_REPO to run for industrial_ci. Possible values: "main", "testing"' - default: 'main' - required: false - type: string - os_code_name: - description: 'OS_CODE_NAME variable for industrial_ci' - default: '' - required: false - type: string - before_install_upstream_dependencies: - description: 'BEFORE_INSTALL_UPSTREAM_DEPENDENCIES variable for industrial_ci' - default: '' - required: false - type: string - - ccache_dir: - description: 'Local path to store cache (from "github.workspace"). For standard industrial_ci configuration do not have to be changed' - default: '.ccache' - required: false - type: string - basedir: - description: 'Local path to workspace base directory to cache (from "github.workspace"). For standard industrial_ci configuration do not have to be changed' - default: '.work' - required: false - type: string - - -jobs: - reusable_industrial_ci_with_cache: - name: ${{ inputs.ros_distro }} ${{ inputs.ros_repo }} ${{ inputs.os_code_name }} - runs-on: ubuntu-latest - env: - CCACHE_DIR: ${{ github.workspace }}/${{ inputs.ccache_dir }} - 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 - if: ${{ github.event_name != 'schedule' }} - uses: actions/checkout@v4 - - name: Checkout ${{ inputs.ref }} on scheduled build - if: ${{ github.event_name == 'schedule' }} - uses: actions/checkout@v4 - with: - ref: ${{ inputs.ref_for_scheduled_build }} - - name: cache target_ws - if: ${{ ! matrix.env.CCOV }} - uses: pat-s/always-upload-cache@v3.0.11 - with: - path: ${{ env.BASEDIR }}/target_ws - key: target_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('**/CMakeLists.txt', '**/package.xml') }}-${{ github.run_id }} - restore-keys: | - target_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('**/CMakeLists.txt', '**/package.xml') }} - - name: cache ccache - uses: pat-s/always-upload-cache@v3.0.11 - with: - path: ${{ env.CCACHE_DIR }} - key: ccache-${{ env.CACHE_PREFIX }}-${{ github.sha }}-${{ github.run_id }} - restore-keys: | - ccache-${{ env.CACHE_PREFIX }}-${{ github.sha }} - ccache-${{ env.CACHE_PREFIX }} - - uses: 'ros-industrial/industrial_ci@master' - env: - UPSTREAM_WORKSPACE: ${{ inputs.upstream_workspace }} - ROS_DISTRO: ${{ inputs.ros_distro }} - ROS_REPO: ${{ inputs.ros_repo }} - OS_CODE_NAME: ${{ inputs.os_code_name }} - BEFORE_INSTALL_UPSTREAM_DEPENDENCIES: ${{ inputs.before_install_upstream_dependencies }} - - name: prepare target_ws for cache - if: ${{ always() && ! matrix.env.CCOV }} - run: | - du -sh ${{ env.BASEDIR }}/target_ws - sudo find ${{ env.BASEDIR }}/target_ws -wholename '*/test_results/*' -delete - sudo rm -rf ${{ env.BASEDIR }}/target_ws/src - du -sh ${{ env.BASEDIR }}/target_ws diff --git a/.github/workflows/reusable-rhel-binary-build.yml b/.github/workflows/reusable-rhel-binary-build.yml deleted file mode 100644 index e5c1e0b1a6..0000000000 --- a/.github/workflows/reusable-rhel-binary-build.yml +++ /dev/null @@ -1,81 +0,0 @@ -name: Reusable RHEL Binary Build -# Reusable action to simplify dealing with RHEL binary builds -# author: Christoph Froehlich - -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 | tr '\n' ' ') $(colcon list --paths ${{ env.path }}/* --names-only | tr '\n' ' ')" >> $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 diff --git a/.github/workflows/reusable-ros-tooling-source-build.yml b/.github/workflows/reusable-ros-tooling-source-build.yml deleted file mode 100644 index f15501cd11..0000000000 --- a/.github/workflows/reusable-ros-tooling-source-build.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: Reusable industrial_ci Workflow with Cache -# Reusable action to simplify dealing with ROS/ROS2 industrial_ci builds with cache -# author: Denis Štogl - -on: - workflow_call: - inputs: - ros_distro: - description: 'ROS2 distribution name' - required: true - type: string - ref: - description: 'Reference on which the repo should be checkout. Usually is this name of a branch or a tag.' - required: true - type: string - ros2_repo_branch: - description: 'Branch in the ros2/ros2 repository from which ".repos" should be used.' - default: 'master' - required: false - type: string - -jobs: - reusable_ros_tooling_source_build: - name: ${{ inputs.ros_distro }} ubuntu-22.04 - runs-on: ubuntu-22.04 - env: - # this will be src/{repo-owner}/{repo-name} - path: src/${{ github.repository }} - strategy: - fail-fast: false - steps: - - uses: ros-tooling/setup-ros@0.7.1 - with: - required-ros-distributions: ${{ inputs.ros_distro }} - - uses: actions/checkout@v4 - with: - ref: ${{ inputs.ref }} - path: ${{ env.path }} - - 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 "REPO_NAME=$(echo ${{ github.repository }} | cut -d '/' -f 2)" >> $GITHUB_ENV - echo "package_list=$(colcon list --paths ${{ env.path }} --names-only | tr '\n' ' ') $(colcon list --paths ${{ env.path }}/* --names-only | tr '\n' ' ')" >> $GITHUB_ENV - echo "repo ${{ env.REPO_NAME}} has packages: ${{ env.package_list }}" - - uses: ros-tooling/action-ros-ci@0.3.6 - with: - target-ros2-distro: ${{ inputs.ros_distro }} - ref: ${{ inputs.ref }} - package-name: ${{ env.package_list }} - vcs-repo-file-url: | - https://raw.githubusercontent.com/ros2/ros2/${{ inputs.ros2_repo_branch }}/ros2.repos - ${{ env.path }}/${{ env.REPO_NAME}}.${{ inputs.ros_distro }}.repos - colcon-mixin-repository: https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml - - uses: actions/upload-artifact@v4.3.0 - with: - name: colcon-logs-ubuntu-22.04 - path: ros_ws/log From 2b1be53c16c19cc3e7f524d247b34e88fba2d1a7 Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Sun, 11 Feb 2024 22:32:46 +0000 Subject: [PATCH 8/8] Use reusable wfs from ros2_control_ci --- .github/workflows/humble-binary-build.yml | 2 +- .github/workflows/humble-debian-build.yml | 2 +- .github/workflows/humble-rhel-binary-build.yml | 2 +- .github/workflows/humble-semi-binary-build.yml | 2 +- .github/workflows/humble-source-build.yml | 2 +- .github/workflows/iron-binary-build.yml | 2 +- .github/workflows/iron-debian-build.yml | 2 +- .github/workflows/iron-rhel-binary-build.yml | 2 +- .github/workflows/iron-semi-binary-build.yml | 2 +- .github/workflows/iron-source-build.yml | 2 +- .github/workflows/rolling-binary-build.yml | 2 +- .github/workflows/rolling-debian-build.yml | 2 +- .github/workflows/rolling-rhel-binary-build.yml | 2 +- .github/workflows/rolling-semi-binary-build.yml | 2 +- .github/workflows/rolling-source-build.yml | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/humble-binary-build.yml b/.github/workflows/humble-binary-build.yml index 5fd3cc9d01..dd7119d878 100644 --- a/.github/workflows/humble-binary-build.yml +++ b/.github/workflows/humble-binary-build.yml @@ -16,7 +16,7 @@ on: jobs: binary: - uses: ./.github/workflows/reusable-industrial-ci-with-cache.yml + uses: ros-controls/ros2_control_ci/.github/workflows/reusable-industrial-ci-with-cache.yml@master strategy: matrix: ROS_DISTRO: [humble] diff --git a/.github/workflows/humble-debian-build.yml b/.github/workflows/humble-debian-build.yml index 461e3cfd76..f5af601316 100644 --- a/.github/workflows/humble-debian-build.yml +++ b/.github/workflows/humble-debian-build.yml @@ -11,7 +11,7 @@ on: jobs: debian_source_build: - uses: ./.github/workflows/reusable-debian-build.yml + uses: ros-controls/ros2_control_ci/.github/workflows/reusable-debian-build.yml@master strategy: matrix: ROS_DISTRO: [humble] diff --git a/.github/workflows/humble-rhel-binary-build.yml b/.github/workflows/humble-rhel-binary-build.yml index d1c08e7860..c541b00636 100644 --- a/.github/workflows/humble-rhel-binary-build.yml +++ b/.github/workflows/humble-rhel-binary-build.yml @@ -10,7 +10,7 @@ on: jobs: rhel_semi_binary_build: - uses: ./.github/workflows/reusable-rhel-binary-build.yml + uses: ros-controls/ros2_control_ci/.github/workflows/reusable-rhel-binary-build.yml@master strategy: matrix: ROS_DISTRO: [humble] diff --git a/.github/workflows/humble-semi-binary-build.yml b/.github/workflows/humble-semi-binary-build.yml index 8a11e9137d..edfcfa1734 100644 --- a/.github/workflows/humble-semi-binary-build.yml +++ b/.github/workflows/humble-semi-binary-build.yml @@ -16,7 +16,7 @@ on: jobs: binary: - uses: ./.github/workflows/reusable-industrial-ci-with-cache.yml + uses: ros-controls/ros2_control_ci/.github/workflows/reusable-industrial-ci-with-cache.yml@master strategy: matrix: ROS_DISTRO: [humble] diff --git a/.github/workflows/humble-source-build.yml b/.github/workflows/humble-source-build.yml index a40d53f8e3..7b4427d6d6 100644 --- a/.github/workflows/humble-source-build.yml +++ b/.github/workflows/humble-source-build.yml @@ -10,7 +10,7 @@ on: jobs: source: - uses: ./.github/workflows/reusable-ros-tooling-source-build.yml + uses: ros-controls/ros2_control_ci/.github/workflows/reusable-ros-tooling-source-build.yml@master with: ros_distro: humble ref: humble diff --git a/.github/workflows/iron-binary-build.yml b/.github/workflows/iron-binary-build.yml index 3c619de77c..245b075ae7 100644 --- a/.github/workflows/iron-binary-build.yml +++ b/.github/workflows/iron-binary-build.yml @@ -16,7 +16,7 @@ on: jobs: binary: - uses: ./.github/workflows/reusable-industrial-ci-with-cache.yml + uses: ros-controls/ros2_control_ci/.github/workflows/reusable-industrial-ci-with-cache.yml@master strategy: matrix: ROS_DISTRO: [iron] diff --git a/.github/workflows/iron-debian-build.yml b/.github/workflows/iron-debian-build.yml index 5934064de9..738fff8acb 100644 --- a/.github/workflows/iron-debian-build.yml +++ b/.github/workflows/iron-debian-build.yml @@ -11,7 +11,7 @@ on: jobs: debian_source_build: - uses: ./.github/workflows/reusable-debian-build.yml + uses: ros-controls/ros2_control_ci/.github/workflows/reusable-debian-build.yml@master strategy: matrix: ROS_DISTRO: [iron] diff --git a/.github/workflows/iron-rhel-binary-build.yml b/.github/workflows/iron-rhel-binary-build.yml index 8ac5bdd954..e1c80435eb 100644 --- a/.github/workflows/iron-rhel-binary-build.yml +++ b/.github/workflows/iron-rhel-binary-build.yml @@ -10,7 +10,7 @@ on: jobs: rhel_semi_binary_build: - uses: ./.github/workflows/reusable-rhel-binary-build.yml + uses: ros-controls/ros2_control_ci/.github/workflows/reusable-rhel-binary-build.yml@master strategy: matrix: ROS_DISTRO: [iron] diff --git a/.github/workflows/iron-semi-binary-build.yml b/.github/workflows/iron-semi-binary-build.yml index 3dab236df1..fde8d065e7 100644 --- a/.github/workflows/iron-semi-binary-build.yml +++ b/.github/workflows/iron-semi-binary-build.yml @@ -16,7 +16,7 @@ on: jobs: binary: - uses: ./.github/workflows/reusable-industrial-ci-with-cache.yml + uses: ros-controls/ros2_control_ci/.github/workflows/reusable-industrial-ci-with-cache.yml@master strategy: matrix: ROS_DISTRO: [iron] diff --git a/.github/workflows/iron-source-build.yml b/.github/workflows/iron-source-build.yml index 34372a4178..3609dcfc41 100644 --- a/.github/workflows/iron-source-build.yml +++ b/.github/workflows/iron-source-build.yml @@ -10,7 +10,7 @@ on: jobs: source: - uses: ./.github/workflows/reusable-ros-tooling-source-build.yml + uses: ros-controls/ros2_control_ci/.github/workflows/reusable-ros-tooling-source-build.yml@master with: ros_distro: iron ref: iron diff --git a/.github/workflows/rolling-binary-build.yml b/.github/workflows/rolling-binary-build.yml index c6a81cea2c..c17799922a 100644 --- a/.github/workflows/rolling-binary-build.yml +++ b/.github/workflows/rolling-binary-build.yml @@ -16,7 +16,7 @@ on: jobs: binary: - uses: ./.github/workflows/reusable-industrial-ci-with-cache.yml + uses: ros-controls/ros2_control_ci/.github/workflows/reusable-industrial-ci-with-cache.yml@master strategy: matrix: ROS_DISTRO: [rolling] diff --git a/.github/workflows/rolling-debian-build.yml b/.github/workflows/rolling-debian-build.yml index a6de78ff51..c175f41e5b 100644 --- a/.github/workflows/rolling-debian-build.yml +++ b/.github/workflows/rolling-debian-build.yml @@ -11,7 +11,7 @@ on: jobs: debian_source_build: - uses: ./.github/workflows/reusable-debian-build.yml + uses: ros-controls/ros2_control_ci/.github/workflows/reusable-debian-build.yml@master strategy: matrix: ROS_DISTRO: [rolling] diff --git a/.github/workflows/rolling-rhel-binary-build.yml b/.github/workflows/rolling-rhel-binary-build.yml index b511883b77..d3544d53a2 100644 --- a/.github/workflows/rolling-rhel-binary-build.yml +++ b/.github/workflows/rolling-rhel-binary-build.yml @@ -10,7 +10,7 @@ on: jobs: rhel_semi_binary_build: - uses: ./.github/workflows/reusable-rhel-binary-build.yml + uses: ros-controls/ros2_control_ci/.github/workflows/reusable-rhel-binary-build.yml@master strategy: matrix: ROS_DISTRO: [rolling] diff --git a/.github/workflows/rolling-semi-binary-build.yml b/.github/workflows/rolling-semi-binary-build.yml index 5ffaf0a880..743b472c32 100644 --- a/.github/workflows/rolling-semi-binary-build.yml +++ b/.github/workflows/rolling-semi-binary-build.yml @@ -16,7 +16,7 @@ on: jobs: binary: - uses: ./.github/workflows/reusable-industrial-ci-with-cache.yml + uses: ros-controls/ros2_control_ci/.github/workflows/reusable-industrial-ci-with-cache.yml@master strategy: matrix: ROS_DISTRO: [rolling] diff --git a/.github/workflows/rolling-source-build.yml b/.github/workflows/rolling-source-build.yml index 475e509e0f..f34a8e6bb5 100644 --- a/.github/workflows/rolling-source-build.yml +++ b/.github/workflows/rolling-source-build.yml @@ -10,7 +10,7 @@ on: jobs: source: - uses: ./.github/workflows/reusable-ros-tooling-source-build.yml + uses: ros-controls/ros2_control_ci/.github/workflows/reusable-ros-tooling-source-build.yml@master with: ros_distro: rolling ref: master