Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 31 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ jobs:

micro_ros_zephyr_module:
runs-on: ubuntu-latest
container:
image: zephyrprojectrtos/ci:v0.26.17
options: --user root
env:
CMAKE_PREFIX_PATH: /opt/toolchains
strategy:
fail-fast: false
matrix:
Expand All @@ -26,28 +21,52 @@ jobs:
with:
path: micro_ros_zephyr_module

- name: Build
shell: bash
- name: Free disk space
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
sudo docker image prune --all --force

- name: Create build script
run: |
cat << 'EOF' > build.sh
#!/bin/bash
set -e

# Zephyr setup
apt -y update
west init
west init
cd zephyr
git checkout ${{ matrix.zephyr_version }}
git checkout $ZEPHYR_VERSION
cd ..
west update --narrow

# Installing micro-ROS prerequisites
pip3 install catkin_pkg lark-parser empy colcon-common-extensions

if [[ ${{ github.ref_name }} == "humble" ]] || [[ ${{ github.head_ref }} == *"humble"* ]]; then
if [[ "$REF_NAME" == "humble" ]] || [[ "$HEAD_REF" == *"humble"* ]]; then
# Use empy version 3.3.4 for Humble
pip3 install empy==3.3.4
fi

# Build with Serial USB transport
west build -b disco_l475_iot1 $GITHUB_WORKSPACE/micro_ros_zephyr_module -p -- -DCONFIG_MICROROS_TRANSPORT_SERIAL_USB=y
west build -b disco_l475_iot1 /github/workspace/micro_ros_zephyr_module -p -- -DCONFIG_MICROROS_TRANSPORT_SERIAL_USB=y

# Build with Serial transport
west build -b disco_l475_iot1 $GITHUB_WORKSPACE/micro_ros_zephyr_module -p -- -DCONFIG_MICROROS_TRANSPORT_SERIAL=y
west build -b disco_l475_iot1 /github/workspace/micro_ros_zephyr_module -p -- -DCONFIG_MICROROS_TRANSPORT_SERIAL=y
EOF
chmod +x build.sh

- name: Build
run: |
sudo docker run --rm \
--user root \
-v ${{ github.workspace }}:/github/workspace \
-w /github/workspace \
-e CMAKE_PREFIX_PATH=/opt/toolchains \
-e ZEPHYR_VERSION=${{ matrix.zephyr_version }} \
-e REF_NAME=${{ github.ref_name }} \
-e HEAD_REF=${{ github.head_ref }} \
zephyrprojectrtos/ci:v0.26.17 \
/github/workspace/build.sh
43 changes: 31 additions & 12 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ jobs:

nightly_micro_ros_zephyr_module:
runs-on: ubuntu-latest
container:
image: zephyrprojectrtos/ci:v0.26.17
options: --user root
env:
CMAKE_PREFIX_PATH: /opt/toolchains
strategy:
fail-fast: false
matrix:
Expand All @@ -35,27 +30,51 @@ jobs:
path: micro_ros_zephyr_module
ref: ${{ matrix.branch }}

- name: Build
shell: bash
- name: Free disk space
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
sudo docker image prune --all --force

- name: Create build script
run: |
cat << 'EOF' > build.sh
#!/bin/bash
set -e

# Zephyr setup
apt -y update
west init
west init
cd zephyr
git checkout ${{ matrix.zephyr_version }}
git checkout $ZEPHYR_VERSION
cd ..
west update --narrow

# Installing micro-ROS prerequisites
pip3 install catkin_pkg lark-parser empy colcon-common-extensions

if [[ ${{ matrix.branch }} == "humble" ]]; then
if [[ "$BRANCH_NAME" == "humble" ]]; then
# Use empy version 3.3.4 for Humble
pip3 install empy==3.3.4
fi

# Build with Serial USB transport
west build -b disco_l475_iot1 $GITHUB_WORKSPACE/micro_ros_zephyr_module -p -- -DCONFIG_MICROROS_TRANSPORT_SERIAL_USB=y
west build -b disco_l475_iot1 /github/workspace/micro_ros_zephyr_module -p -- -DCONFIG_MICROROS_TRANSPORT_SERIAL_USB=y

# Build with Serial transport
west build -b disco_l475_iot1 $GITHUB_WORKSPACE/micro_ros_zephyr_module -p -- -DCONFIG_MICROROS_TRANSPORT_SERIAL=y
west build -b disco_l475_iot1 /github/workspace/micro_ros_zephyr_module -p -- -DCONFIG_MICROROS_TRANSPORT_SERIAL=y
EOF
chmod +x build.sh

- name: Build
run: |
sudo docker run --rm \
--user root \
-v ${{ github.workspace }}:/github/workspace \
-w /github/workspace \
-e CMAKE_PREFIX_PATH=/opt/toolchains \
-e ZEPHYR_VERSION=${{ matrix.zephyr_version }} \
-e BRANCH_NAME=${{ matrix.branch }} \
zephyrprojectrtos/ci:v0.26.17 \
/github/workspace/build.sh
53 changes: 29 additions & 24 deletions modules/libmicroros/libmicroros.mk
Original file line number Diff line number Diff line change
Expand Up @@ -61,40 +61,45 @@ configure_toolchain: $(COMPONENT_PATH)/zephyr_toolchain.cmake.in
$(COMPONENT_PATH)/micro_ros_dev/install:
rm -rf micro_ros_dev; \
mkdir micro_ros_dev; cd micro_ros_dev; \
git clone -b humble https://github.com/ament/ament_cmake src/ament_cmake; \
git clone -b humble https://github.com/ament/ament_lint src/ament_lint; \
git clone -b humble https://github.com/ament/ament_package src/ament_package; \
git clone -b humble https://github.com/ament/googletest src/googletest; \
git clone -b humble https://github.com/ros2/ament_cmake_ros src/ament_cmake_ros; \
git clone -b humble https://github.com/ament/ament_index src/ament_index; \
git clone -b jazzy https://github.com/ament/ament_cmake src/ament_cmake; \
git clone -b jazzy https://github.com/ament/ament_lint src/ament_lint; \
git clone -b jazzy https://github.com/ament/ament_package src/ament_package; \
git clone -b jazzy https://github.com/ament/googletest src/googletest; \
git clone -b jazzy https://github.com/ros2/ament_cmake_ros src/ament_cmake_ros; \
git clone -b jazzy https://github.com/ament/ament_index src/ament_index; \
colcon build --cmake-args -DBUILD_TESTING=OFF;

$(COMPONENT_PATH)/micro_ros_src/src:
@rm -rf micro_ros_src; \
mkdir micro_ros_src; cd micro_ros_src; \
git clone -b ros2 https://github.com/eProsima/micro-CDR src/micro-CDR; \
git clone -b ros2 https://github.com/eProsima/Micro-XRCE-DDS-Client src/Micro-XRCE-DDS-Client; \
git clone -b humble https://github.com/micro-ROS/rcl src/rcl; \
git clone -b humble https://github.com/ros2/rclc src/rclc; \
git clone -b humble https://github.com/micro-ROS/rcutils src/rcutils; \
git clone -b humble https://github.com/micro-ROS/micro_ros_msgs src/micro_ros_msgs; \
git clone -b humble https://github.com/micro-ROS/rmw-microxrcedds src/rmw-microxrcedds; \
git clone -b humble https://github.com/micro-ROS/rosidl_typesupport src/rosidl_typesupport; \
git clone -b humble https://github.com/micro-ROS/rosidl_typesupport_microxrcedds src/rosidl_typesupport_microxrcedds; \
git clone -b humble https://github.com/ros2/rosidl src/rosidl; \
git clone -b humble https://github.com/ros2/rmw src/rmw; \
git clone -b humble https://github.com/ros2/rcl_interfaces src/rcl_interfaces; \
git clone -b humble https://github.com/ros2/rosidl_defaults src/rosidl_defaults; \
git clone -b humble https://github.com/ros2/unique_identifier_msgs src/unique_identifier_msgs; \
git clone -b humble https://github.com/ros2/common_interfaces src/common_interfaces; \
git clone -b humble https://github.com/ros2/test_interface_files src/test_interface_files; \
git clone -b humble https://github.com/ros2/rmw_implementation src/rmw_implementation; \
git clone -b humble https://github.com/ros2/rcl_logging src/rcl_logging; \
git clone -b humble https://gitlab.com/ros_tracing/ros2_tracing src/ros2_tracing; \
git clone -b humble https://github.com/micro-ROS/micro_ros_utilities src/micro_ros_utilities; \
git clone -b jazzy https://github.com/micro-ROS/rcl src/rcl; \
git clone -b jazzy https://github.com/ros2/rclc src/rclc; \
git clone -b jazzy https://github.com/micro-ROS/rcutils src/rcutils; \
git clone -b jazzy https://github.com/micro-ROS/micro_ros_msgs src/micro_ros_msgs; \
git clone -b jazzy https://github.com/micro-ROS/rmw-microxrcedds src/rmw-microxrcedds; \
git clone -b jazzy https://github.com/micro-ROS/rosidl_typesupport src/rosidl_typesupport; \
git clone -b jazzy https://github.com/micro-ROS/rosidl_typesupport_microxrcedds src/rosidl_typesupport_microxrcedds; \
git clone -b jazzy https://github.com/ros2/rosidl src/rosidl; \
git clone -b jazzy https://github.com/ros2/rosidl_dynamic_typesupport src/rosidl_dynamic_typesupport; \
git clone -b jazzy https://github.com/ros2/rmw src/rmw; \
git clone -b jazzy https://github.com/ros2/rcl_interfaces src/rcl_interfaces; \
git clone -b jazzy https://github.com/ros2/rosidl_defaults src/rosidl_defaults; \
git clone -b jazzy https://github.com/ros2/unique_identifier_msgs src/unique_identifier_msgs; \
git clone -b jazzy https://github.com/ros2/common_interfaces src/common_interfaces; \
git clone -b jazzy https://github.com/ros2/test_interface_files src/test_interface_files; \
git clone -b jazzy https://github.com/ros2/rmw_implementation src/rmw_implementation; \
git clone -b jazzy https://github.com/ros2/rcl_logging src/rcl_logging; \
git clone -b jazzy https://github.com/ros2/ros2_tracing src/ros2_tracing; \
git clone -b jazzy https://github.com/micro-ROS/micro_ros_utilities src/micro_ros_utilities; \
git clone -b jazzy https://github.com/ros2/rosidl_core src/rosidl_core; \
touch src/ros2_tracing/test_tracetools/COLCON_IGNORE; \
touch src/ros2_tracing/lttngpy/COLCON_IGNORE; \
touch src/rosidl/rosidl_typesupport_introspection_cpp/COLCON_IGNORE; \
touch src/rclc/rclc_examples/COLCON_IGNORE; \
touch src/common_interfaces/actionlib_msgs/COLCON_IGNORE; \
touch src/common_interfaces/std_srvs/COLCON_IGNORE; \
touch src/rcl/rcl_yaml_param_parser/COLCON_IGNORE; \
touch src/rcl_logging/rcl_logging_spdlog/COLCON_IGNORE; \
touch src/rcl_interfaces/test_msgs/COLCON_IGNORE;
Expand Down
Loading