Skip to content

Add CI for ROS2.

Add CI for ROS2. #9

Workflow file for this run

name: Build & Test
on:
push:
branches: [ jazzy ]
pull_request:
branches: [ jazzy ]
jobs:
Linting:
name: Lint Code Base
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup
run: |
sudo apt-get update && sudo apt-get install -y clang-format cppcheck libxml2-utils
- name: Lint C++
run: |
clang-format -Werror -n -style=file $(find . -name '*.cpp' -o -name '*.hpp' -o -name '*.h' -o -name '*.c' -o -name '*.cc')
- name: Check C++
run: |
cppcheck --force --quiet --error-exitcode=1 .
- name: Lint package.xml
run: |
xmllint --noout --schema http://download.ros.org/schema/package_format3.xsd $(find . -name 'package.xml')
build-and-test:
needs: Linting
runs-on: ubuntu-latest
strategy:
matrix:
ros_distro: [humble, jazzy]
container:
image: ros:${{matrix.ros_distro}}-ros-base
steps:
- uses: ros-tooling/setup-ros@v0.7
with:
required-ros-distributions: ${{ matrix.ros_distro }}
- uses: ros-tooling/action-ros-ci@v0.3
with:
target-ros2-distro: ${{ matrix.ros_distro }}
colcon-defaults: | # Use asan to find memory issues
{
"build": {
"mixin": ["asan-gcc"]
}
}