Skip to content

Commit b56ae0f

Browse files
committed
ci: test supported ROS distros with ROS images
Signed-off-by: Esteve Fernandez <esteve@apache.org>
1 parent dfc9fd8 commit b56ae0f

3 files changed

Lines changed: 48 additions & 16 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,26 +36,44 @@ jobs:
3636

3737
ros:
3838
name: ROS build and test (${{ matrix.ros_distro }})
39-
runs-on: ${{ matrix.runner }}
39+
runs-on: ubuntu-latest
40+
container:
41+
image: ros:${{ matrix.ros_image }}
42+
env:
43+
DEBIAN_FRONTEND: noninteractive
4044
strategy:
4145
fail-fast: false
4246
matrix:
4347
include:
4448
- ros_distro: humble
45-
runner: ubuntu-22.04
49+
ros_image: humble-ros-base-jammy
4650
- ros_distro: jazzy
47-
runner: ubuntu-24.04
51+
ros_image: jazzy-ros-base-noble
52+
- ros_distro: kilted
53+
ros_image: kilted-ros-base-noble
54+
- ros_distro: lyrical
55+
ros_image: lyrical-ros-base-resolute
56+
- ros_distro: rolling
57+
ros_image: rolling-ros-base
4858
steps:
59+
- name: Install checkout dependencies
60+
run: |
61+
apt-get update
62+
apt-get install -y --no-install-recommends \
63+
ca-certificates \
64+
cargo \
65+
git \
66+
python3-colcon-common-extensions \
67+
python3-rosdep
68+
4969
- name: Checkout repository
5070
uses: actions/checkout@v6
5171

52-
- name: Set up ROS
53-
uses: ros-tooling/setup-ros@v0.7
54-
with:
55-
required-ros-distributions: ${{ matrix.ros_distro }}
56-
5772
- name: Install package dependencies
5873
run: |
74+
if [ ! -e /etc/ros/rosdep/sources.list.d/20-default.list ]; then
75+
rosdep init
76+
fi
5977
rosdep update
6078
rosdep install --from-paths . --ignore-src --rosdistro ${{ matrix.ros_distro }} -y
6179
@@ -65,6 +83,20 @@ jobs:
6583
source /opt/ros/${{ matrix.ros_distro }}/setup.bash
6684
colcon build --packages-up-to rosidl_generator_rs_tests --event-handlers console_direct+
6785
86+
- name: Check Rust keyword escaping
87+
shell: bash
88+
run: |
89+
source /opt/ros/${{ matrix.ros_distro }}/setup.bash
90+
source install/setup.bash
91+
python3 - <<'PY'
92+
from rosidl_generator_rs import get_rs_name
93+
94+
for keyword in ('try', 'type', 'const', 'async', 'match'):
95+
assert get_rs_name(keyword) == f'{keyword}_'
96+
97+
assert get_rs_name('plain_field') == 'plain_field'
98+
PY
99+
68100
- name: Test package
69101
shell: bash
70102
run: |
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# Exercises Rust keyword escaping and constant rendering.
2-
uint8 try
3-
string type
4-
int32 const
1+
# Exercises constant rendering and keyword-adjacent field names.
2+
uint8 try_value
3+
string type_name
4+
int32 const_value
55

66
uint32 ANSWER=42
77
string NAME=rosidl_rust
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# Request exercises local message fields and Rust keyword escaping.
1+
# Request exercises local message fields.
22
Complex input
3-
uint32 async
3+
uint32 async_value
44
---
5-
# Response exercises local message fields and Rust keyword escaping.
5+
# Response exercises local message fields.
66
Complex output
7-
bool match
7+
bool match_value

0 commit comments

Comments
 (0)