-
Notifications
You must be signed in to change notification settings - Fork 2
50 lines (48 loc) · 1.4 KB
/
ci-ros2.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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/[email protected]
with:
required-ros-distributions: ${{ matrix.ros_distro }}
- uses: ros-tooling/[email protected]
with:
target-ros2-distro: ${{ matrix.ros_distro }}
colcon-defaults: | # Use asan to find memory issues
{
"build": {
"mixin": ["asan-gcc"]
}
}