From c0429546ca8a2c669e87159c38e1759a5d4ad22a Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Wed, 6 Dec 2023 20:03:31 +0000 Subject: [PATCH] Fix coverage builds --- .github/workflows/build-coverage.yml | 36 +++++++++------ .github/workflows/build-coverage_humble.yml | 49 +++++++++++++++++++++ .github/workflows/build-coverage_iron.yml | 49 +++++++++++++++++++++ README.md | 1 + codecov.yml | 14 ++++++ 5 files changed, 135 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/build-coverage_humble.yml create mode 100644 .github/workflows/build-coverage_iron.yml 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/README.md b/README.md index ada1b242..6c6ac611 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ 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 the documentation of [ros2_control](http://control.ros.org) and release infos on [index.ros.org](http://index.ros.org/p/control_toolbox). diff --git a/codecov.yml b/codecov.yml index 2a02240d..ea5ed5b1 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,2 +1,16 @@ +coverage: + precision: 2 + round: down + range: "35...100" + status: + project: + default: + informational: true + patch: off fixes: - "ros_ws/src/control_toolbox/::" +ignore: + - "**/test" +comment: + layout: "diff, flags, files" + behavior: default