Repository navigation
103 lines (95 loc) · 3.84 KB
/
Copy pathci.yml
File metadata and controls
103 lines (95 loc) · 3.84 KB
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
92
93
94
95
96
97
98
99
100
101
102
103
name: CI
on:
push:
branches: [main, devel]
pull_request:
branches: [main, devel]
workflow_dispatch:
jobs:
build-and-test:
name: build & test (${{ matrix.ros_distro }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ros_distro: [jazzy, kilted, rolling, lyrical]
container:
image: ros:${{ matrix.ros_distro }}-ros-base
# Default Docker /dev/shm is 64MB; one domain registry mmap is ~37MB
# and rmw_shutdown doesn't shm_unlink, so tests that init multiple
# domains across processes exhaust tmpfs and crash with SIGBUS.
options: --shm-size=1g
steps:
- name: Install build prerequisites
shell: bash
run: |
apt-get update
apt-get install -y --no-install-recommends \
git \
python3-colcon-common-extensions \
python3-rosdep
- uses: actions/checkout@v4
- name: Resolve package dependencies
shell: bash
run: |
rosdep update --rosdistro=${{ matrix.ros_distro }}
# rosdep's --from-paths defaults exclude test deps, so list types
# explicitly. Without this, test_msgs/rosidl_typesupport_cpp/etc.
# are skipped and BUILD_TESTING=ON (colcon build default) fails to
# configure.
rosdep install --from-paths rmw_unix_socket_cpp --ignore-src -r -y \
--rosdistro=${{ matrix.ros_distro }} \
--dependency-types=buildtool \
--dependency-types=build \
--dependency-types=build_export \
--dependency-types=exec \
--dependency-types=test
# Belt & suspenders: on Rolling, rosdep -r silently skips
# test_msgs when its key drifts between syncs. Install the
# test-only deps explicitly so find_package(test_msgs REQUIRED)
# in the BUILD_TESTING block always has what it needs. Also pull
# rosidl-runtime-cpp by name so apt upgrades it: the base image
# is months behind the rolling sync, and a stale rosidl-runtime-cpp
# is missing buffer__traits.hpp which the latest test_msgs headers
# reference.
apt-get install -y --no-install-recommends \
ros-${{ matrix.ros_distro }}-test-msgs \
ros-${{ matrix.ros_distro }}-rosidl-typesupport-cpp \
ros-${{ matrix.ros_distro }}-rosidl-runtime-cpp
# rosidl_buffer was introduced after Jazzy/Kilted were branched and
# test_msgs' exported imported targets reference it; Lyrical branched
# from Rolling after it landed, so both ship it. CMake side:
# find_package(rosidl_buffer QUIET) in CMakeLists handles the
# apt-missing case on older distros.
if [ "${{ matrix.ros_distro }}" = "rolling" ] || [ "${{ matrix.ros_distro }}" = "lyrical" ]; then
apt-get install -y --no-install-recommends \
ros-${{ matrix.ros_distro }}-rosidl-buffer
fi
- name: Build
shell: bash
run: |
source /opt/ros/${{ matrix.ros_distro }}/setup.bash
colcon build \
--paths rmw_unix_socket_cpp \
--event-handlers console_direct+ \
--cmake-args -DCMAKE_BUILD_TYPE=Release
- name: Test
shell: bash
run: |
source /opt/ros/${{ matrix.ros_distro }}/setup.bash
source install/setup.bash
colcon test \
--paths rmw_unix_socket_cpp \
--event-handlers console_direct+ \
--return-code-on-test-failure
- name: Test summary
if: always()
shell: bash
run: colcon test-result --verbose
- name: Upload test logs on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-logs-${{ matrix.ros_distro }}
path: log/
retention-days: 7