From 4434abdbd6ddc7803c43961006ed72d867440bdc Mon Sep 17 00:00:00 2001 From: Eugenio Collado Date: Mon, 15 Dec 2025 11:48:25 +0100 Subject: [PATCH 1/3] Free space in docker Signed-off-by: Eugenio Collado --- .github/workflows/ci.yml | 61 ++++++++++++++++-------------- modules/libmicroros/libmicroros.mk | 1 + 2 files changed, 34 insertions(+), 28 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ae17172..cf01272 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: @@ -26,27 +21,37 @@ jobs: with: path: micro_ros_zephyr_module - - name: Build - shell: bash + - name: Free disk space run: | - # Zephyr setup - apt -y update - west init - cd zephyr - git checkout ${{ matrix.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 - # 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 - - # Build with Serial transport - west build -b disco_l475_iot1 $GITHUB_WORKSPACE/micro_ros_zephyr_module -p -- -DCONFIG_MICROROS_TRANSPORT_SERIAL=y + 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: Build + uses: addnab/docker-run-action@v3 + with: + image: zephyrprojectrtos/ci:v0.26.17 + options: --user root -v ${{ github.workspace }}:/github/workspace -w /github/workspace -e CMAKE_PREFIX_PATH=/opt/toolchains + run: | + # Zephyr setup + apt -y update + west init + cd zephyr + git checkout ${{ matrix.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 + # 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 + + # Build with Serial transport + west build -b disco_l475_iot1 /github/workspace/micro_ros_zephyr_module -p -- -DCONFIG_MICROROS_TRANSPORT_SERIAL=y diff --git a/modules/libmicroros/libmicroros.mk b/modules/libmicroros/libmicroros.mk index ea15f88..a7820c8 100644 --- a/modules/libmicroros/libmicroros.mk +++ b/modules/libmicroros/libmicroros.mk @@ -68,6 +68,7 @@ $(COMPONENT_PATH)/micro_ros_dev/install: git clone -b kilted https://github.com/ros2/ament_cmake_ros src/ament_cmake_ros; \ git clone -b kilted https://github.com/ament/ament_index src/ament_index; \ touch src/ament_cmake_ros/rmw_test_fixture_implementation/COLCON_IGNORE; \ + touch src/ament_cmake_ros/rmw_test_fixture/COLCON_IGNORE; \ colcon build --cmake-args -DBUILD_TESTING=OFF; $(COMPONENT_PATH)/micro_ros_src/src: From 7423eb070f9b4de9eec2c19e3293924911d7517f Mon Sep 17 00:00:00 2001 From: Eugenio Collado Date: Mon, 15 Dec 2025 12:00:52 +0100 Subject: [PATCH 2/3] Build script as step Signed-off-by: Eugenio Collado --- .github/workflows/ci.yml | 67 ++++++++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 26 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cf01272..223f875 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,30 +28,45 @@ jobs: 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 + cd zephyr + git checkout $ZEPHYR_VERSION + cd .. + west update --narrow + + # Installing micro-ROS prerequisites + pip3 install catkin_pkg lark-parser empy colcon-common-extensions + + 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 + + # Build with Serial transport + 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 - uses: addnab/docker-run-action@v3 - with: - image: zephyrprojectrtos/ci:v0.26.17 - options: --user root -v ${{ github.workspace }}:/github/workspace -w /github/workspace -e CMAKE_PREFIX_PATH=/opt/toolchains - run: | - # Zephyr setup - apt -y update - west init - cd zephyr - git checkout ${{ matrix.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 - # 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 - - # Build with Serial transport - west build -b disco_l475_iot1 /github/workspace/micro_ros_zephyr_module -p -- -DCONFIG_MICROROS_TRANSPORT_SERIAL=y + 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 From b7bd5086eaed57259ee08ae91c6b781aafc96525 Mon Sep 17 00:00:00 2001 From: Eugenio Collado Date: Mon, 15 Dec 2025 12:31:01 +0100 Subject: [PATCH 3/3] Nightly Signed-off-by: Eugenio Collado --- .github/workflows/nightly.yml | 43 +++++++++++++++++++++++++---------- 1 file changed, 31 insertions(+), 12 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 0b05160..cb8842b 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -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: @@ -37,27 +32,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