From 15f9ff124b6f7159d9e162ca0267df828f74f608 Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Sun, 18 Feb 2024 18:10:52 +0000 Subject: [PATCH 1/9] Add reusable workflow for coverage build --- .github/workflows/reusable-build-coverage.yml | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/reusable-build-coverage.yml diff --git a/.github/workflows/reusable-build-coverage.yml b/.github/workflows/reusable-build-coverage.yml new file mode 100644 index 0000000..36d169a --- /dev/null +++ b/.github/workflows/reusable-build-coverage.yml @@ -0,0 +1,57 @@ +name: Reusable Coverage Build +on: + workflow_call: + inputs: + ros_distro: + description: 'ROS2 distribution name' + required: true + type: string + os_name: + description: 'On which OS to run the linter' + required: false + default: 'ubuntu-latest' + type: string + +env: + # this will be src/{repo-owner}/{repo-name} + path: src/${{ github.repository }} + +jobs: + coverage: + name: coverage build ${{ inputs.ros_distro }} + runs-on: ${{ inputs.os_name }} + steps: + - uses: ros-tooling/setup-ros@0.7.1 + with: + required-ros-distributions: ${{ inputs.ros_distro }} + - uses: actions/checkout@v4 + - id: package_list_action + uses: ros-controls/ros2_control_ci/.github/actions/set-package-list@ci_lint + with: + path: ${{ env.path }} + - uses: ros-tooling/action-ros-ci@0.3.6 + with: + target-ros2-distro: ${{ inputs.ros_distro }} + import-token: ${{ secrets.GITHUB_TOKEN }} + # build all packages listed here + package-name: ${{ steps.package_list_action.outputs.package_list }} + + vcs-repo-file-url: | + https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}/${{ steps.package_list_action.outputs.repo_name }}.${{ inputs.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@v4.0.1 + with: + file: ros_ws/lcov/total_coverage.info + flags: unittests + name: codecov-umbrella + token: ${{ secrets.CODECOV_TOKEN }} + - uses: actions/upload-artifact@v4.3.1 + with: + name: colcon-logs-coverage-${{ inputs.ros_distro }} + path: ros_ws/log From 5b3644417706cbf6bc5d569650d5e3e71be99248 Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Sun, 18 Feb 2024 18:19:21 +0000 Subject: [PATCH 2/9] Add path --- .github/workflows/reusable-build-coverage.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/reusable-build-coverage.yml b/.github/workflows/reusable-build-coverage.yml index 36d169a..f33501f 100644 --- a/.github/workflows/reusable-build-coverage.yml +++ b/.github/workflows/reusable-build-coverage.yml @@ -25,6 +25,8 @@ jobs: with: required-ros-distributions: ${{ inputs.ros_distro }} - uses: actions/checkout@v4 + with: + path: ${{ env.path }} - id: package_list_action uses: ros-controls/ros2_control_ci/.github/actions/set-package-list@ci_lint with: From 0e0ebaa408fed3586879c4e4ec343271e024aad8 Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Sun, 18 Feb 2024 18:30:52 +0000 Subject: [PATCH 3/9] Update comment --- .github/workflows/reusable-build-coverage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/reusable-build-coverage.yml b/.github/workflows/reusable-build-coverage.yml index f33501f..2204cc6 100644 --- a/.github/workflows/reusable-build-coverage.yml +++ b/.github/workflows/reusable-build-coverage.yml @@ -7,7 +7,7 @@ on: required: true type: string os_name: - description: 'On which OS to run the linter' + description: 'On which OS to run the workflow, e.g. ubuntu-22.04' required: false default: 'ubuntu-latest' type: string From c904d7ae018b048d8e6baf90fd6222f8accdc4ec Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Sun, 18 Feb 2024 18:36:19 +0000 Subject: [PATCH 4/9] Add debug output --- .github/workflows/reusable-build-coverage.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/reusable-build-coverage.yml b/.github/workflows/reusable-build-coverage.yml index 2204cc6..cb2cde1 100644 --- a/.github/workflows/reusable-build-coverage.yml +++ b/.github/workflows/reusable-build-coverage.yml @@ -31,6 +31,10 @@ jobs: uses: ros-controls/ros2_control_ci/.github/actions/set-package-list@ci_lint with: path: ${{ env.path }} + - name: Debug output + run: | + echo "repo_name: ${{ steps.package_list_action.outputs.repo_name }}" + echo "package_list: ${{ steps.package_list_action.outputs.package_list }}" - uses: ros-tooling/action-ros-ci@0.3.6 with: target-ros2-distro: ${{ inputs.ros_distro }} From 115e5e166e293607f0a5c9b084bd74166059d622 Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Sun, 18 Feb 2024 18:41:28 +0000 Subject: [PATCH 5/9] Revert "Add debug output" This reverts commit e167667dcb40c7d549d716f2333ceb772f79c5d6. --- .github/workflows/reusable-build-coverage.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/reusable-build-coverage.yml b/.github/workflows/reusable-build-coverage.yml index cb2cde1..2204cc6 100644 --- a/.github/workflows/reusable-build-coverage.yml +++ b/.github/workflows/reusable-build-coverage.yml @@ -31,10 +31,6 @@ jobs: uses: ros-controls/ros2_control_ci/.github/actions/set-package-list@ci_lint with: path: ${{ env.path }} - - name: Debug output - run: | - echo "repo_name: ${{ steps.package_list_action.outputs.repo_name }}" - echo "package_list: ${{ steps.package_list_action.outputs.package_list }}" - uses: ros-tooling/action-ros-ci@0.3.6 with: target-ros2-distro: ${{ inputs.ros_distro }} From 78c56693bf876220ee64bf291dfef048bac0adc4 Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Sun, 18 Feb 2024 19:00:48 +0000 Subject: [PATCH 6/9] Add CODECOV_TOKEN secret --- .github/workflows/reusable-build-coverage.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/reusable-build-coverage.yml b/.github/workflows/reusable-build-coverage.yml index 2204cc6..fab1118 100644 --- a/.github/workflows/reusable-build-coverage.yml +++ b/.github/workflows/reusable-build-coverage.yml @@ -11,6 +11,10 @@ on: required: false default: 'ubuntu-latest' type: string + secrets: + CODECOV_TOKEN: + description: 'Repository upload token - get it from codecov.io' + required: true env: # this will be src/{repo-owner}/{repo-name} From 2680f6e448ec6b4646af47f483f547a8cc04ef6d Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Sun, 18 Feb 2024 19:08:52 +0000 Subject: [PATCH 7/9] Remove token again --- .github/workflows/reusable-build-coverage.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/reusable-build-coverage.yml b/.github/workflows/reusable-build-coverage.yml index fab1118..7b5eaaa 100644 --- a/.github/workflows/reusable-build-coverage.yml +++ b/.github/workflows/reusable-build-coverage.yml @@ -11,10 +11,6 @@ on: required: false default: 'ubuntu-latest' type: string - secrets: - CODECOV_TOKEN: - description: 'Repository upload token - get it from codecov.io' - required: true env: # this will be src/{repo-owner}/{repo-name} @@ -56,6 +52,8 @@ jobs: file: ros_ws/lcov/total_coverage.info flags: unittests name: codecov-umbrella + # Repository upload token - get it from codecov.io and add it to the repository secrets + # from a public fork it is not necessary token: ${{ secrets.CODECOV_TOKEN }} - uses: actions/upload-artifact@v4.3.1 with: From 3714078869171be4c5805296e4b4cef9e221451a Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Sun, 18 Feb 2024 19:11:47 +0000 Subject: [PATCH 8/9] Remove CODECOV_TOKEN secret completely --- .github/workflows/reusable-build-coverage.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/reusable-build-coverage.yml b/.github/workflows/reusable-build-coverage.yml index 7b5eaaa..1f221c8 100644 --- a/.github/workflows/reusable-build-coverage.yml +++ b/.github/workflows/reusable-build-coverage.yml @@ -52,9 +52,6 @@ jobs: file: ros_ws/lcov/total_coverage.info flags: unittests name: codecov-umbrella - # Repository upload token - get it from codecov.io and add it to the repository secrets - # from a public fork it is not necessary - token: ${{ secrets.CODECOV_TOKEN }} - uses: actions/upload-artifact@v4.3.1 with: name: colcon-logs-coverage-${{ inputs.ros_distro }} From 4077481850b557b03ac1725ce6e52a92f9f7eae4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20Fr=C3=B6hlich?= Date: Sun, 18 Feb 2024 23:12:10 +0100 Subject: [PATCH 9/9] Switch to master branch of ros2_control_ci --- .github/workflows/reusable-build-coverage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/reusable-build-coverage.yml b/.github/workflows/reusable-build-coverage.yml index 1f221c8..608fcf7 100644 --- a/.github/workflows/reusable-build-coverage.yml +++ b/.github/workflows/reusable-build-coverage.yml @@ -28,7 +28,7 @@ jobs: with: path: ${{ env.path }} - id: package_list_action - uses: ros-controls/ros2_control_ci/.github/actions/set-package-list@ci_lint + uses: ros-controls/ros2_control_ci/.github/actions/set-package-list@master with: path: ${{ env.path }} - uses: ros-tooling/action-ros-ci@0.3.6