-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add reusable workflow for coverage build (#12)
- Loading branch information
1 parent
ec7c2ac
commit 1d61b35
Showing
1 changed file
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |