Skip to content

Commit

Permalink
Add reusable workflow for coverage build (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
christophfroehlich authored Feb 21, 2024
1 parent ec7c2ac commit 1d61b35
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/reusable-build-coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
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 workflow, e.g. ubuntu-22.04'
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/[email protected]
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@master
with:
path: ${{ env.path }}
- uses: ros-tooling/[email protected]
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/[email protected]
with:
file: ros_ws/lcov/total_coverage.info
flags: unittests
name: codecov-umbrella
- uses: actions/[email protected]
with:
name: colcon-logs-coverage-${{ inputs.ros_distro }}
path: ros_ws/log

0 comments on commit 1d61b35

Please sign in to comment.