Skip to content

Commit 9281a6f

Browse files
committed
ci: cargo check generated action crate
Signed-off-by: Esteve Fernandez <esteve@apache.org>
1 parent 1c3c9d0 commit 9281a6f

3 files changed

Lines changed: 38 additions & 2 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,27 @@ jobs:
6464
cargo \
6565
git \
6666
python3-colcon-common-extensions \
67-
python3-rosdep
67+
python3-rosdep \
68+
python3-vcs2l
6869
6970
- name: Checkout repository
7071
uses: actions/checkout@v6
7172

73+
- name: Import action dependency sources
74+
run: |
75+
cat > action-dependency-sources.repos <<EOF
76+
repositories:
77+
rcl_interfaces:
78+
type: git
79+
url: https://github.com/ros2/rcl_interfaces.git
80+
version: ${{ matrix.ros_distro }}
81+
unique_identifier_msgs:
82+
type: git
83+
url: https://github.com/ros2/unique_identifier_msgs.git
84+
version: ${{ matrix.ros_distro }}
85+
EOF
86+
vcs import --shallow . < action-dependency-sources.repos
87+
7288
- name: Install package dependencies
7389
run: |
7490
if [ ! -e /etc/ros/rosdep/sources.list.d/20-default.list ]; then
@@ -81,7 +97,10 @@ jobs:
8197
shell: bash
8298
run: |
8399
source /opt/ros/${{ matrix.ros_distro }}/setup.bash
84-
colcon build --packages-up-to rosidl_generator_rs_tests --event-handlers console_direct+
100+
colcon build \
101+
--packages-up-to rosidl_generator_rs_tests \
102+
--allow-overriding action_msgs builtin_interfaces unique_identifier_msgs \
103+
--event-handlers console_direct+
85104
86105
- name: Test package
87106
shell: bash
@@ -95,4 +114,11 @@ jobs:
95114
shell: bash
96115
run: |
97116
tests_crate="$PWD/build/rosidl_generator_rs_tests/rosidl_generator_rs/rosidl_generator_rs_tests/rust"
117+
mkdir -p "$tests_crate/.cargo"
118+
cat > "$tests_crate/.cargo/config.toml" <<EOF
119+
[patch.crates-io]
120+
action_msgs = { path = "$PWD/build/action_msgs/rosidl_generator_rs/action_msgs/rust" }
121+
builtin_interfaces = { path = "$PWD/build/builtin_interfaces/rosidl_generator_rs/builtin_interfaces/rust" }
122+
unique_identifier_msgs = { path = "$PWD/build/unique_identifier_msgs/rosidl_generator_rs/unique_identifier_msgs/rust" }
123+
EOF
98124
cargo check --manifest-path "$tests_crate/Cargo.toml"

rosidl_generator_rs_tests/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,18 @@ cmake_minimum_required(VERSION 3.12)
33
project(rosidl_generator_rs_tests)
44

55
find_package(ament_cmake REQUIRED)
6+
find_package(action_msgs REQUIRED)
7+
find_package(builtin_interfaces REQUIRED)
68
find_package(rosidl_default_generators REQUIRED)
79
find_package(rosidl_generator_rs REQUIRED)
10+
find_package(unique_identifier_msgs REQUIRED)
811

912
rosidl_generate_interfaces(${PROJECT_NAME}
1013
"msg/Complex.msg"
1114
"msg/Keywords.msg"
1215
"srv/Compute.srv"
1316
"action/DoThing.action"
17+
DEPENDENCIES action_msgs builtin_interfaces unique_identifier_msgs
1418
)
1519

1620
ament_package()

rosidl_generator_rs_tests/package.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,15 @@
1010
<buildtool_depend>ament_cmake</buildtool_depend>
1111
<buildtool_depend>rosidl_default_generators</buildtool_depend>
1212

13+
<build_depend>action_msgs</build_depend>
14+
<build_depend>builtin_interfaces</build_depend>
1315
<build_depend>rosidl_generator_rs</build_depend>
16+
<build_depend>unique_identifier_msgs</build_depend>
1417

18+
<exec_depend>action_msgs</exec_depend>
19+
<exec_depend>builtin_interfaces</exec_depend>
1520
<exec_depend>rosidl_default_runtime</exec_depend>
21+
<exec_depend>unique_identifier_msgs</exec_depend>
1622

1723
<member_of_group>rosidl_interface_packages</member_of_group>
1824

0 commit comments

Comments
 (0)