From e8946adc5279904132371cb5d7b125b5f3638f87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20Fr=C3=B6hlich?= Date: Mon, 11 Dec 2023 18:22:49 +0100 Subject: [PATCH] [CI] Touchups (#166) * Remove EOL workflows * Update readme * Fix coverage builds * Rename file * Fix ubuntu version in lint workflow * Remove cppcheck duplicate * Fix binary and source builds * Exclude test folder from codecov stats --- .github/workflows/build-coverage.yml | 36 +++++++------ .github/workflows/build-coverage_humble.yml | 49 ++++++++++++++++++ .github/workflows/build-coverage_iron.yml | 49 ++++++++++++++++++ .../{build-foxy.yml => build-iron.yml} | 10 ++-- .github/workflows/build-source-foxy.yml | 30 ----------- .github/workflows/build-source-rollling.yml | 30 ----------- .github/workflows/build-source_humble.yml | 17 +++++++ .github/workflows/build-source_iron.yml | 17 +++++++ .github/workflows/build-source_rollling.yml | 17 +++++++ .github/workflows/build_source_humble.yml | 30 ----------- .../reusable-ros-tooling-source-build.yml | 50 +++++++++++++++++++ .github/workflows/ros-lint.yml | 26 ++++++++-- README.md | 14 +++--- codecov.yml | 15 ++++++ ...lbox.repos => control_toolbox.humble.repos | 2 +- control_toolbox.iron.repos | 9 ++++ control_toolbox.rolling.repos | 9 ++++ 17 files changed, 290 insertions(+), 120 deletions(-) create mode 100644 .github/workflows/build-coverage_humble.yml create mode 100644 .github/workflows/build-coverage_iron.yml rename .github/workflows/{build-foxy.yml => build-iron.yml} (92%) delete mode 100644 .github/workflows/build-source-foxy.yml delete mode 100644 .github/workflows/build-source-rollling.yml create mode 100644 .github/workflows/build-source_humble.yml create mode 100644 .github/workflows/build-source_iron.yml create mode 100644 .github/workflows/build-source_rollling.yml delete mode 100644 .github/workflows/build_source_humble.yml create mode 100644 .github/workflows/reusable-ros-tooling-source-build.yml rename control_toolbox.repos => control_toolbox.humble.repos (89%) create mode 100644 control_toolbox.iron.repos create mode 100644 control_toolbox.rolling.repos diff --git a/.github/workflows/build-coverage.yml b/.github/workflows/build-coverage.yml index cd3060dd..b80550ee 100644 --- a/.github/workflows/build-coverage.yml +++ b/.github/workflows/build-coverage.yml @@ -1,28 +1,36 @@ -name: Build Source +name: Coverage Build - Rolling on: + workflow_dispatch: push: branches: - ros2-master - schedule: - # Run every day to detect flakiness and broken dependencies - - cron: '28 3 * * *' + pull_request: + branches: + - ros2-master jobs: - source: - name: source build - runs-on: ubuntu-20.04 + coverage: + name: coverage build + runs-on: ubuntu-22.04 strategy: fail-fast: false + env: + ROS_DISTRO: rolling steps: - - uses: ros-tooling/setup-ros@v0.7 - - uses: ros-tooling/action-ros-ci@v0.3 + - uses: ros-tooling/setup-ros@0.7.1 with: - target-ros2-distro: rolling - # build all packages listed in the meta package + required-ros-distributions: ${{ env.ROS_DISTRO }} + - uses: actions/checkout@v4 + - uses: ros-tooling/action-ros-ci@0.3.5 + with: + target-ros2-distro: ${{ env.ROS_DISTRO }} + import-token: ${{ secrets.GITHUB_TOKEN }} + # build all packages listed here package-name: control_toolbox + vcs-repo-file-url: | - https://raw.githubusercontent.com/ros-controls/control_toolbox/ros2-master/control_toolbox.repos + https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}/control_toolbox.${{ env.ROS_DISTRO }}.repos?token=${{ secrets.GITHUB_TOKEN }} colcon-defaults: | { "build": { @@ -35,7 +43,7 @@ jobs: file: ros_ws/lcov/total_coverage.info flags: unittests name: codecov-umbrella - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v3.1.3 with: - name: colcon-logs-${{ matrix.os }} + name: colcon-logs-coverage-rolling path: ros_ws/log diff --git a/.github/workflows/build-coverage_humble.yml b/.github/workflows/build-coverage_humble.yml new file mode 100644 index 00000000..6b5d4cbd --- /dev/null +++ b/.github/workflows/build-coverage_humble.yml @@ -0,0 +1,49 @@ +name: Coverage Build - Humble +on: + workflow_dispatch: + push: + branches: + - ros2-master + pull_request: + branches: + - ros2-master + +jobs: + coverage: + name: coverage build + runs-on: ubuntu-22.04 + strategy: + fail-fast: false + env: + ROS_DISTRO: humble + steps: + - uses: ros-tooling/setup-ros@0.7.1 + with: + required-ros-distributions: ${{ env.ROS_DISTRO }} + - uses: actions/checkout@v4 + - uses: ros-tooling/action-ros-ci@0.3.5 + with: + target-ros2-distro: ${{ env.ROS_DISTRO }} + import-token: ${{ secrets.GITHUB_TOKEN }} + # build all packages listed here + package-name: + control_toolbox + + vcs-repo-file-url: | + https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}/control_toolbox.${{ env.ROS_DISTRO }}.repos?token=${{ secrets.GITHUB_TOKEN }} + colcon-defaults: | + { + "build": { + "mixin": ["coverage-gcc"] + } + } + colcon-mixin-repository: https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml + - uses: codecov/codecov-action@v3.1.4 + with: + file: ros_ws/lcov/total_coverage.info + flags: unittests + name: codecov-umbrella + - uses: actions/upload-artifact@v3.1.3 + with: + name: colcon-logs-coverage-humble + path: ros_ws/log diff --git a/.github/workflows/build-coverage_iron.yml b/.github/workflows/build-coverage_iron.yml new file mode 100644 index 00000000..5e0f1954 --- /dev/null +++ b/.github/workflows/build-coverage_iron.yml @@ -0,0 +1,49 @@ +name: Coverage Build - Iron +on: + workflow_dispatch: + push: + branches: + - ros2-master + pull_request: + branches: + - ros2-master + +jobs: + coverage: + name: coverage build + runs-on: ubuntu-22.04 + strategy: + fail-fast: false + env: + ROS_DISTRO: iron + steps: + - uses: ros-tooling/setup-ros@0.7.1 + with: + required-ros-distributions: ${{ env.ROS_DISTRO }} + - uses: actions/checkout@v4 + - uses: ros-tooling/action-ros-ci@0.3.5 + with: + target-ros2-distro: ${{ env.ROS_DISTRO }} + import-token: ${{ secrets.GITHUB_TOKEN }} + # build all packages listed here + package-name: + control_toolbox + + vcs-repo-file-url: | + https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}/control_toolbox.${{ env.ROS_DISTRO }}.repos?token=${{ secrets.GITHUB_TOKEN }} + colcon-defaults: | + { + "build": { + "mixin": ["coverage-gcc"] + } + } + colcon-mixin-repository: https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml + - uses: codecov/codecov-action@v3.1.4 + with: + file: ros_ws/lcov/total_coverage.info + flags: unittests + name: codecov-umbrella + - uses: actions/upload-artifact@v3.1.3 + with: + name: colcon-logs-coverage-iron + path: ros_ws/log diff --git a/.github/workflows/build-foxy.yml b/.github/workflows/build-iron.yml similarity index 92% rename from .github/workflows/build-foxy.yml rename to .github/workflows/build-iron.yml index 38ee40df..55c7933d 100644 --- a/.github/workflows/build-foxy.yml +++ b/.github/workflows/build-iron.yml @@ -1,14 +1,12 @@ # This config uses industrial_ci (https://github.com/ros-industrial/industrial_ci.git). # For troubleshooting, see readme (https://github.com/ros-industrial/industrial_ci/blob/master/README.rst) -name: Build foxy +name: Build iron on: pull_request: - branches: - - foxy push: branches: - - foxy + - ros2-master schedule: # Run every day to detect flakiness and broken dependencies - cron: '28 6 * * *' @@ -20,8 +18,8 @@ jobs: strategy: matrix: env: - - {ROS_DISTRO: foxy, ROS_REPO: main} - - {ROS_DISTRO: foxy, ROS_REPO: testing} + - {ROS_DISTRO: iron, ROS_REPO: main} + - {ROS_DISTRO: iron, ROS_REPO: testing} env: CCACHE_DIR: ${{ github.workspace }}/.ccache BASEDIR: ${{ github.workspace }}/.work diff --git a/.github/workflows/build-source-foxy.yml b/.github/workflows/build-source-foxy.yml deleted file mode 100644 index 4f083933..00000000 --- a/.github/workflows/build-source-foxy.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Build Source foxy -on: - push: - branches: - - foxy - schedule: - # Run every day to detect flakiness and broken dependencies - - cron: '28 3 * * *' - -jobs: - source: - name: source build - runs-on: ubuntu-20.04 - strategy: - fail-fast: false - steps: - - uses: ros-tooling/setup-ros@v0.7 - - uses: ros-tooling/action-ros-ci@v0.3 - with: - vcs-repo-file-url: | - https://raw.githubusercontent.com/ros-controls/control_toolbox/ros2-master/control_toolbox.repos - https://raw.githubusercontent.com/ros2/ros2/master/ros2.repos - package-name: control_toolbox - colcon-mixin-name: coverage-gcc - colcon-mixin-repository: https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml - target-ros2-distro: foxy - - uses: actions/upload-artifact@v3 - with: - name: colcon-logs-${{ matrix.os }} - path: ros_ws/log diff --git a/.github/workflows/build-source-rollling.yml b/.github/workflows/build-source-rollling.yml deleted file mode 100644 index a2f79119..00000000 --- a/.github/workflows/build-source-rollling.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Build Source rolling -on: - push: - branches: - - ros2-master - schedule: - # Run every day to detect flakiness and broken dependencies - - cron: '28 3 * * *' - -jobs: - source: - name: source build - runs-on: ubuntu-20.04 - strategy: - fail-fast: false - steps: - - uses: ros-tooling/setup-ros@v0.7 - - uses: ros-tooling/action-ros-ci@v0.3 - with: - vcs-repo-file-url: | - https://raw.githubusercontent.com/ros-controls/control_toolbox/ros2-master/control_toolbox.repos - https://raw.githubusercontent.com/ros2/ros2/master/ros2.repos - package-name: control_toolbox - colcon-mixin-name: coverage-gcc - colcon-mixin-repository: https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml - target-ros2-distro: rolling - - uses: actions/upload-artifact@v3 - with: - name: colcon-logs-${{ matrix.os }} - path: ros_ws/log diff --git a/.github/workflows/build-source_humble.yml b/.github/workflows/build-source_humble.yml new file mode 100644 index 00000000..9d423c16 --- /dev/null +++ b/.github/workflows/build-source_humble.yml @@ -0,0 +1,17 @@ +name: Rolling Source Build +on: + workflow_dispatch: + push: + branches: + - ros2-master + schedule: + # Run every day to detect flakiness and broken dependencies + - cron: '03 3 * * *' + +jobs: + source: + uses: ./.github/workflows/reusable-ros-tooling-source-build.yml + with: + ros_distro: humble + ref: ros2-master + ros2_repo_branch: humble diff --git a/.github/workflows/build-source_iron.yml b/.github/workflows/build-source_iron.yml new file mode 100644 index 00000000..125d18ed --- /dev/null +++ b/.github/workflows/build-source_iron.yml @@ -0,0 +1,17 @@ +name: Rolling Source Build +on: + workflow_dispatch: + push: + branches: + - ros2-master + schedule: + # Run every day to detect flakiness and broken dependencies + - cron: '03 3 * * *' + +jobs: + source: + uses: ./.github/workflows/reusable-ros-tooling-source-build.yml + with: + ros_distro: iron + ref: ros2-master + ros2_repo_branch: iron diff --git a/.github/workflows/build-source_rollling.yml b/.github/workflows/build-source_rollling.yml new file mode 100644 index 00000000..7942aaa8 --- /dev/null +++ b/.github/workflows/build-source_rollling.yml @@ -0,0 +1,17 @@ +name: Rolling Source Build +on: + workflow_dispatch: + push: + branches: + - ros2-master + schedule: + # Run every day to detect flakiness and broken dependencies + - cron: '03 3 * * *' + +jobs: + source: + uses: ./.github/workflows/reusable-ros-tooling-source-build.yml + with: + ros_distro: rolling + ref: master + ros2_repo_branch: rolling diff --git a/.github/workflows/build_source_humble.yml b/.github/workflows/build_source_humble.yml deleted file mode 100644 index 275b529a..00000000 --- a/.github/workflows/build_source_humble.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Build Source humble -on: - push: - branches: - - ros2-master - schedule: - # Run every day to detect flakiness and broken dependencies - - cron: '28 3 * * *' - -jobs: - source: - name: source build - runs-on: ubuntu-20.04 - strategy: - fail-fast: false - steps: - - uses: ros-tooling/setup-ros@v0.7 - - uses: ros-tooling/action-ros-ci@v0.3 - with: - vcs-repo-file-url: | - https://raw.githubusercontent.com/ros-controls/control_toolbox/ros2-master/control_toolbox.repos - https://raw.githubusercontent.com/ros2/ros2/master/ros2.repos - package-name: control_toolbox - colcon-mixin-name: coverage-gcc - colcon-mixin-repository: https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml - target-ros2-distro: humble - - uses: actions/upload-artifact@v3 - with: - name: colcon-logs-${{ matrix.os }} - path: ros_ws/log diff --git a/.github/workflows/reusable-ros-tooling-source-build.yml b/.github/workflows/reusable-ros-tooling-source-build.yml new file mode 100644 index 00000000..4f4ad7dd --- /dev/null +++ b/.github/workflows/reusable-ros-tooling-source-build.yml @@ -0,0 +1,50 @@ +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 repozitory from which ".repos" should be used. Possible values: master (Rolling), humble.' + default: 'master' + required: false + type: string + +jobs: + reusable_ros_tooling_source_build: + name: ${{ inputs.ros_distro }} ubuntu-22.04 + runs-on: ubuntu-22.04 + 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 }} + - uses: ros-tooling/action-ros-ci@0.3.5 + with: + target-ros2-distro: ${{ inputs.ros_distro }} + ref: ${{ inputs.ref }} + # build all packages listed in the meta package + package-name: + control_toolbox + + 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_controllers.${{ inputs.ros_distro }}.repos?token=${{ secrets.GITHUB_TOKEN }} + colcon-mixin-repository: https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml + - uses: actions/upload-artifact@v3.1.3 + with: + name: colcon-logs-ubuntu-22.04 + path: ros_ws/log diff --git a/.github/workflows/ros-lint.yml b/.github/workflows/ros-lint.yml index 41df9183..11060a32 100644 --- a/.github/workflows/ros-lint.yml +++ b/.github/workflows/ros-lint.yml @@ -5,11 +5,11 @@ on: jobs: ament_lint: name: ament_${{ matrix.linter }} - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest strategy: fail-fast: false matrix: - linter: [cppcheck, copyright, lint_cmake] + linter: [copyright, lint_cmake] steps: - uses: actions/checkout@v4 - uses: ros-tooling/setup-ros@v0.7 @@ -22,7 +22,7 @@ jobs: ament_lint_100: name: ament_${{ matrix.linter }} - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest strategy: fail-fast: false matrix: @@ -37,3 +37,23 @@ jobs: arguments: "--linelength=100 --filter=-whitespace/newline" package-name: control_toolbox + + ament_cppcheck: + name: ament_${{ matrix.linter }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + linter: [cppcheck] + env: + AMENT_CPPCHECK_ALLOW_SLOW_VERSIONS: true + steps: + - uses: actions/checkout@v4 + - uses: ros-tooling/setup-ros@0.7.1 + - uses: ros-tooling/action-ros-lint@v0.1 + with: + distribution: rolling + linter: ${{ matrix.linter }} + arguments: "--language=c++" + package-name: + control_toolbox diff --git a/README.md b/README.md index 21acbbc7..6c6ac611 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,15 @@ control_toolbox =========== +[![codecov](https://codecov.io/gh/ros-controls/control_toolbox/graph/badge.svg?token=0o4dFzADHj)](https://codecov.io/gh/ros-controls/control_toolbox) -See [ros_control](http://wiki.ros.org/ros_control) and [control_toolbox](http://wiki.ros.org/control_toolbox) documentation on ros.org +See the documentation of [ros2_control](http://control.ros.org) and release infos on [index.ros.org](http://index.ros.org/p/control_toolbox). - - -### Build Status - -[![Build Status](https://travis-ci.org/ros-controls/control_toolbox.png?branch=kinetic-devel)](https://travis-ci.org/ros-controls/control_toolbox) +## Build status +ROS2 Distro | Branch | Build status | Documentation | Released packages +:---------: | :----: | :----------: | :-----------: | :---------------: +**Rolling** | [`master`](https://github.com/ros-controls/control_toolbox/tree/master) | [![Build rolling](https://github.com/ros-controls/control_toolbox/actions/workflows/build-rolling.yml/badge.svg)](https://github.com/ros-controls/control_toolbox/actions/workflows/build-rolling.yml)
[![Build Source rolling](https://github.com/ros-controls/control_toolbox/actions/workflows/build-source-rollling.yml/badge.svg)](https://github.com/ros-controls/control_toolbox/actions/workflows/build-source-rollling.yml) | [API](http://docs.ros.org/en/rolling/p/control_toolbox/) | [control_toolbox](https://index.ros.org/p/control_toolbox/#rolling) +**Iron** | [`master`](https://github.com/ros-controls/control_toolbox/tree/master) | n/a | [API](http://docs.ros.org/en/iron/p/control_toolbox/) | [control_toolbox](https://index.ros.org/p/control_toolbox/#iron) +**Humble** | [`master`](https://github.com/ros-controls/control_toolbox/tree/master) | [![Build humble](https://github.com/ros-controls/control_toolbox/actions/workflows/build-humble.yml/badge.svg)](https://github.com/ros-controls/control_toolbox/actions/workflows/build-humble.yml)
[![Build Source humble](https://github.com/ros-controls/control_toolbox/actions/workflows/build_source_humble.yml/badge.svg)](https://github.com/ros-controls/control_toolbox/actions/workflows/build_source_humble.yml) | [API](http://docs.ros.org/en/humble/p/control_toolbox/) | [control_toolbox](https://index.ros.org/p/control_toolbox/#humble) ## Publication diff --git a/codecov.yml b/codecov.yml index 2a02240d..ef5ea832 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,2 +1,17 @@ +coverage: + precision: 2 + round: down + range: "35...100" + status: + project: + default: + informational: true + patch: off fixes: - "ros_ws/src/control_toolbox/::" +ignore: + - "**/test" + - "test" +comment: + layout: "diff, flags, files" + behavior: default diff --git a/control_toolbox.repos b/control_toolbox.humble.repos similarity index 89% rename from control_toolbox.repos rename to control_toolbox.humble.repos index b327fa8d..9f9d3a69 100644 --- a/control_toolbox.repos +++ b/control_toolbox.humble.repos @@ -2,7 +2,7 @@ repositories: control_msgs: type: git url: https://github.com/ros-controls/control_msgs.git - version: foxy-devel + version: humble realtime_tools: type: git url: https://github.com/ros-controls/realtime_tools diff --git a/control_toolbox.iron.repos b/control_toolbox.iron.repos new file mode 100644 index 00000000..f8ef4ecb --- /dev/null +++ b/control_toolbox.iron.repos @@ -0,0 +1,9 @@ +repositories: + control_msgs: + type: git + url: https://github.com/ros-controls/control_msgs.git + version: master + realtime_tools: + type: git + url: https://github.com/ros-controls/realtime_tools + version: master diff --git a/control_toolbox.rolling.repos b/control_toolbox.rolling.repos new file mode 100644 index 00000000..f8ef4ecb --- /dev/null +++ b/control_toolbox.rolling.repos @@ -0,0 +1,9 @@ +repositories: + control_msgs: + type: git + url: https://github.com/ros-controls/control_msgs.git + version: master + realtime_tools: + type: git + url: https://github.com/ros-controls/realtime_tools + version: master