Merge branch 'feature/ci-action' #9
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
# From https://github.com/marketplace/actions/ros-2-ci-action | |
name: CI Action | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
env: | |
ROS_DISTRO: humble | |
jobs: | |
ci-action: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install ROS2 and dependencies | |
uses: ros-tooling/[email protected] | |
with: | |
required-ros-distro: ${{ env.ROS_DISTRO }} | |
- name: Build and Run Tests | |
uses: ros-tooling/[email protected] | |
id: action_ros_ci_step | |
with: | |
package-name: vortex-m3-sonar-driver | |
target-ros2-distro: ${{ env.ROS_DISTRO }} | |
colcon-defaults: | | |
{ | |
"build": { | |
"mixin": ["coverage-gcc", "coverage-pytest"] | |
}, | |
"test": { | |
"mixin": ["coverage-pytest"] | |
} | |
} | |
- name: Upload Code Coverage Info | |
uses: codecov/[email protected] | |
with: | |
# token: ${{ secrets.CODECOV_TOKEN }} # only needed for private repos | |
files: ros_ws/lcov/total_coverage.info,ros_ws/coveragepy/.coverage | |
flags: unittests | |
name: codecov-umbrella | |
- name: Upload Test Results as Artifact | |
uses: actions/upload-artifact@v1 | |
with: | |
name: colcon-logs | |
path: ${{ steps.action_ros_ci_step.outputs.ros-workspace-directory-name }}/log | |
if: always() # upload the logs even when the build fails |