-
Notifications
You must be signed in to change notification settings - Fork 20
91 lines (88 loc) · 3.18 KB
/
ci.yaml
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: CI
on:
workflow_dispatch:
pull_request:
push:
jobs:
cmake:
name: cmake (${{ matrix.ros_distro }}, ${{ matrix.preset }}, ${{ matrix.compiler.name }})
strategy:
matrix:
ros_distro: [humble, rolling]
preset: [debug, release, asan, codecov]
compiler:
- { name: gcc }
- { name: clang, flags: -DCMAKE_CXX_COMPILER=clang++ }
exclude:
- preset: codecov
compiler: { name: clang }
runs-on: ubuntu-22.04
container: ghcr.io/picknikrobotics/rsl:upstream-${{ matrix.ros_distro }}
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Cache ccache
uses: pat-s/always-upload-cache@v3
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-cmake-${{ matrix.ros_distro }}-${{ matrix.preset }}-${{ github.sha }}-${{ github.run_id }}
restore-keys: |
ccache-cmake-${{ matrix.ros_distro }}-${{ matrix.preset }}-${{ github.sha }}
ccache-cmake-${{ matrix.ros_distro }}-${{ matrix.preset }}
- name: Source ROS
run: |
. /opt/ros/${{ matrix.ros_distro }}/setup.sh
echo "$(env)" >> $GITHUB_ENV
- name: Install Clang
if: matrix.compiler.name == 'clang'
run: sudo apt update && sudo apt install clang
- name: Configure
run: cmake --preset ${{ matrix.preset }} ${{ matrix.compiler.flags }} -DCMAKE_INSTALL_PREFIX=install -DCMAKE_VERBOSE_MAKEFILE=ON
- name: Build
run: cmake --build build/${{ matrix.preset }} --target install
- name: Test
run: ctest --test-dir build/${{ matrix.preset }} --rerun-failed --output-on-failure
- name: Build Doxygen Site
run: cmake --build build/${{ matrix.preset }} --target docs
- name: Analyze
run: cmake --build build/${{ matrix.preset }} --target tidy
- name: Generate LCOV report
if: ${{ matrix.preset == 'codecov' }}
run: lcov -c -d . -o coverage.info --no-external --exclude "*/build/**"
- uses: codecov/codecov-action@v3
if: ${{ matrix.preset == 'codecov' }}
with:
files: ./coverage.info
name: codecov-umbrella
flags: ${{ matrix.ros_distro }}
ros:
strategy:
matrix:
ros_distro: [humble, rolling]
runs-on: ubuntu-22.04
container: ghcr.io/picknikrobotics/rsl:upstream-${{ matrix.ros_distro }}
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Cache ccache
uses: pat-s/always-upload-cache@v3
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-ros-${{ matrix.ros_distro }}-${{ github.sha }}-${{ github.run_id }}
restore-keys: |
ccache-ros-${{ matrix.ros_distro }}-${{ github.sha }}
ccache-ros-${{ matrix.ros_distro }}
- uses: ros-tooling/[email protected]
with:
package-name: rsl
target-ros2-distro: ${{ matrix.ros_distro }}
colcon-defaults: |
{
"build": {
"mixin": ["ccache", "lld"]
}
}