Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add reusable workflow for coverage build #12

Merged
merged 10 commits into from
Feb 21, 2024
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
Loading