Repository: micro-ROS/micro_ros_zephyr_module
Pull request #146: updates project to work with zephyr v4.0.x
Author: login: Z0rdon
Created: 2025-01-14T02:22:57Z | Merged: 2025-03-17T07:06:23Z

Upticks the compatible zephyr version.
The 'zephyr_library_import' needed to be replaced with 'zephyr_link_libraries' to avoid the 'whole-archive' linking behavior (which would consume massive amounts of RAM).
Other miscellaneous fixes were made in order to build.


Diff:
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
old mode 100755
new mode 100644
index 34ab831..4f7c599
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -1,71 +1,48 @@
 name: CI
 
 on:
+  workflow_dispatch:
+    inputs:
+      name:
+        description: "Manual trigger"
   pull_request:
-    branches:
-      - '**'
+    branches: ["rolling", "jazzy", "humble"]
 
 jobs:
 
   micro_ros_zephyr_module:
     runs-on: ubuntu-latest
-    container: ubuntu:22.04
+    container: 
+      image: zephyrprojectrtos/ci:v0.26.17
+      options: --user root
+    env:
+      CMAKE_PREFIX_PATH: /opt/toolchains
     strategy:
       fail-fast: false
       matrix:
-        zephyr_version: ["zephyr-v3.1.0", "zephyr-v2.7.2"]
-        include:
-          - zephyr_version: zephyr-v2.7.2
-            zephyr_sdk: 0.14.2
-            sdk_filename: zephyr-sdk-$TOOLCHAIN_VERSION\_linux-x86_64_minimal.tar.gz
-          - zephyr_version: zephyr-v3.1.0
-            zephyr_sdk: 0.14.2
-            sdk_filename: zephyr-sdk-$TOOLCHAIN_VERSION\_linux-x86_64_minimal.tar.gz
+        zephyr_version: ["v4.0.0", "v4.1.0"]
     steps:
-      - uses: actions/checkout@v2
+      - uses: actions/checkout@v4
         with:
           path: micro_ros_zephyr_module
 
       - name: Build
         shell: bash
         run: |
-          # Install dependencies
-          apt update
-          export DEBIAN_FRONTEND=noninteractive
-          apt install -y --no-install-recommends wget git cmake ninja-build gperf \
-            ccache dfu-util device-tree-compiler wget \
-            python3-dev python3-pip python3-setuptools python3-tk python3-wheel xz-utils file \
-            make gcc gcc-multilib g++-multilib libsdl2-dev
-
-          # Install Zephyr environment
-          pip3 install --user -U west
-          export PATH=~/.local/bin:/github/home/.local/bin:"$PATH"
-          west init zephyrproject
-          cd zephyrproject
+          # Zephyr setup
+          apt -y update
+          west init 
           cd zephyr
           git checkout ${{ matrix.zephyr_version }}
           cd ..
-          west update
-          west zephyr-export
-          pip3 install --user -r zephyr/scripts/requirements.txt
-          cd ..
-          export TOOLCHAIN_VERSION=${{ matrix.zephyr_sdk }}
-          export TOOLCHAIN_FILE_NAME=${{ matrix.sdk_filename }}
-          wget https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v$TOOLCHAIN_VERSION/$TOOLCHAIN_FILE_NAME
-          tar xvf $TOOLCHAIN_FILE_NAME
-          cd zephyr-sdk-$TOOLCHAIN_VERSION
-          ./setup.sh -h -t arm-zephyr-eabi -c
-          cd ..
-          source zephyr-sdk-$TOOLCHAIN_VERSION/environment-setup-x86_64-pokysdk-linux
-          export ZEPHYR_TOOLCHAIN_VARIANT=zephyr
-          export ZEPHYR_SDK_INSTALL_DIR=$(pwd)/zephyr-sdk-$TOOLCHAIN_VERSION
-          source zephyrproject/zephyr/zephyr-env.sh
+          west update --narrow
 
           # Installing micro-ROS prerequisites
           pip3 install catkin_pkg lark-parser empy colcon-common-extensions
 
           # Build with Serial USB transport
-          west build -b disco_l475_iot1 micro_ros_zephyr_module -- -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 micro_ros_zephyr_module -- -DCONFIG_MICROROS_TRANSPORT_SERIAL=y
+          west build -b disco_l475_iot1 $GITHUB_WORKSPACE/micro_ros_zephyr_module -p -- -DCONFIG_MICROROS_TRANSPORT_SERIAL=y
+
diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml
index 6bab7f5..00b88c4 100644
--- a/.github/workflows/nightly.yml
+++ b/.github/workflows/nightly.yml
@@ -10,75 +10,47 @@ on:
 
 jobs:
 
-  micro_ros_zephyr_module:
+  nightly_micro_ros_zephyr_module:
     runs-on: ubuntu-latest
-    container: ubuntu:22.04
+    container: 
+      image: zephyrprojectrtos/ci:v0.26.17
+      options: --user root
+    env:
+      CMAKE_PREFIX_PATH: /opt/toolchains
     strategy:
       fail-fast: false
       matrix:
-        zephyr_version: ["zephyr-v3.1.0", "zephyr-v2.7.2"]
-        distro: ["iron", "humble", "rolling", "jazzy"]
+        zephyr_version: ["v4.0.0", "v4.1.0"]
+        distro: ["rolling", "jazzy", "humble"]
         include:
-          - distro: iron
-            branch: iron
           - distro: rolling
             branch: rolling
-          - distro: humble
-            branch: humble
           - distro: jazzy
             branch: jazzy
-          - zephyr_version: zephyr-v2.7.2
-            zephyr_sdk: 0.14.2
-            sdk_filename: zephyr-sdk-$TOOLCHAIN_VERSION\_linux-x86_64_minimal.tar.gz
-          - zephyr_version: zephyr-v3.1.0
-            zephyr_sdk: 0.14.2
-            sdk_filename: zephyr-sdk-$TOOLCHAIN_VERSION\_linux-x86_64_minimal.tar.gz
+          - distro: humble
+            branch: humble
     steps:
-      - uses: actions/checkout@v2
+      - uses: actions/checkout@v4
         with:
           path: micro_ros_zephyr_module
-          branch: ${{ matrix.branch }}
+          ref: ${{ matrix.branch }}
 
       - name: Build
         shell: bash
         run: |
-          # Install dependencies
-          apt update
-          export DEBIAN_FRONTEND=noninteractive
-          apt install -y --no-install-recommends wget git cmake ninja-build gperf \
-            ccache dfu-util device-tree-compiler wget \
-            python3-dev python3-pip python3-setuptools python3-tk python3-wheel xz-utils file \
-            make gcc gcc-multilib g++-multilib libsdl2-dev
-
-          # Install Zephyr environment
-          pip3 install --user -U west
-          export PATH=~/.local/bin:/github/home/.local/bin:"$PATH"
-          west init zephyrproject
-          cd zephyrproject
+          # Zephyr setup
+          apt -y update
+          west init 
           cd zephyr
           git checkout ${{ matrix.zephyr_version }}
           cd ..
-          west update
-          west zephyr-export
-          pip3 install --user -r zephyr/scripts/requirements.txt
-          cd ..
-          export TOOLCHAIN_VERSION=${{ matrix.zephyr_sdk }}
-          export TOOLCHAIN_FILE_NAME=${{ matrix.sdk_filename }}
-          wget https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v$TOOLCHAIN_VERSION/$TOOLCHAIN_FILE_NAME
-          tar xvf $TOOLCHAIN_FILE_NAME
-          cd zephyr-sdk-$TOOLCHAIN_VERSION
-          ./setup.sh -h -t arm-zephyr-eabi -c
-          cd ..
-          source zephyr-sdk-$TOOLCHAIN_VERSION/environment-setup-x86_64-pokysdk-linux
-          export ZEPHYR_TOOLCHAIN_VARIANT=zephyr
-          export ZEPHYR_SDK_INSTALL_DIR=$(pwd)/zephyr-sdk-$TOOLCHAIN_VERSION
-          source zephyrproject/zephyr/zephyr-env.sh
+          west update --narrow
 
           # Installing micro-ROS prerequisites
           pip3 install catkin_pkg lark-parser empy colcon-common-extensions
 
           # Build with Serial USB transport
-          west build -b disco_l475_iot1 micro_ros_zephyr_module -- -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 micro_ros_zephyr_module -- -DCONFIG_MICROROS_TRANSPORT_SERIAL=y
+          west build -b disco_l475_iot1 $GITHUB_WORKSPACE/micro_ros_zephyr_module -p -- -DCONFIG_MICROROS_TRANSPORT_SERIAL=y
diff --git a/README.md b/README.md
index af8a08e..fca59c2 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@
 
 # micro-ROS module for Zephyr
 
-This module has been tested in Zephyr RTOS v2.7.0 (SDK 0.14.2) and v3.1.0 (SDK 0.14.2).
+This module has been tested in Zephyr RTOS v4.0.0 (SDK 0.16.9-rc3), and v4.1.0 (SDK 0.16.9-rc3), using a docker image based on 'zephyrprojectrtos/zephyr-build:v0.26.17'.
 
 ## Dependencies
 
@@ -18,7 +18,7 @@ pip3 install catkin_pkg lark-parser empy colcon-common-extensions
 For example for `disco_l475_iot1` board:
 
 ```bash
-west build -b disco_l475_iot1 micro_ros_zephyr_module
+west build -b disco_l475_iot1 -p
 ```
 
 Some configuration parameters can be found using:
diff --git a/modules/libmicroros/CMakeLists.txt b/modules/libmicroros/CMakeLists.txt
index 193524d..4e8c213 100644
--- a/modules/libmicroros/CMakeLists.txt
+++ b/modules/libmicroros/CMakeLists.txt
@@ -52,10 +52,9 @@ externalproject_add(libmicroros_project
     BUILD_BYPRODUCTS ${MICROROS_DIR}/libmicroros.a
     )
 
-zephyr_library_import(libmicroros ${MICROROS_DIR}/libmicroros.a)
+zephyr_link_libraries(${MICROROS_DIR}/libmicroros.a)
 
 zephyr_interface_library_named(microros)
-add_dependencies(microros libmicroros)
 add_dependencies(microros libmicroros_project)
 target_include_directories(microros INTERFACE ${MICROROS_DIR}/include)
 
@@ -96,7 +95,6 @@ zephyr_library_sources(
 
 add_dependencies(microros microros_transports)
 add_dependencies(microros_transports libmicroros_project)
-add_dependencies(microros_transports libmicroros)
 
 # Cleaning
 
diff --git a/modules/libmicroros/microros_transports/serial/microros_transports.c b/modules/libmicroros/microros_transports/serial/microros_transports.c
index 32a2e95..e2eea50 100644
--- a/modules/libmicroros/microros_transports/serial/microros_transports.c
+++ b/modules/libmicroros/microros_transports/serial/microros_transports.c
@@ -24,6 +24,7 @@
 #include <stdbool.h>
 
 #define RING_BUF_SIZE 2048
+#define UART_NODE DT_NODELABEL(usart1)
 
 char uart_in_buffer[RING_BUF_SIZE];
 char uart_out_buffer[RING_BUF_SIZE];
@@ -52,9 +53,7 @@ static void uart_fifo_callback(const struct device * dev, void * args){
 bool zephyr_transport_open(struct uxrCustomTransport * transport){
     zephyr_transport_params_t * params = (zephyr_transport_params_t*) transport->args;
 
-    char uart_descriptor[8];
-    sprintf(uart_descriptor,"UART_%d", params->fd);
-    params->uart_dev = device_get_binding(uart_descriptor);
+    params->uart_dev = DEVICE_DT_GET(UART_NODE);
     if (!params->uart_dev) {
         printk("Serial device not found\n");
         return false;
diff --git a/prj.conf b/prj.conf
index aa11d31..8c8706b 100644
--- a/prj.conf
+++ b/prj.conf
@@ -1,5 +1,6 @@
 CONFIG_GPIO=y
 CONFIG_MICROROS=y
+CONFIG_CPP=y
 
 CONFIG_MAIN_STACK_SIZE=25000
 CONFIG_MAIN_THREAD_PRIORITY=3
@@ -9,7 +10,6 @@ CONFIG_NEWLIB_LIBC_NANO=n
 CONFIG_PTHREAD_IPC=n
 
 CONFIG_POSIX_API=y
-CONFIG_APP_LINK_WITH_POSIX_SUBSYS=y
 CONFIG_POSIX_CLOCK=y
 
 CONFIG_STDOUT_CONSOLE=y
diff --git a/src/main.c b/src/main.c
index d24f06b..6efe05c 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1,7 +1,7 @@
 #include <version.h>
 
 #if ZEPHYR_VERSION_CODE >= ZEPHYR_VERSION(3,1,0)
-#include <zephyr/zephyr.h>
+#include <zephyr/kernel.h>
 #include <zephyr/device.h>
 #include <zephyr/devicetree.h>
 #include <zephyr/drivers/gpio.h>
@@ -39,7 +39,7 @@ void timer_callback(rcl_timer_t * timer, int64_t last_call_time)
 	}
 }
 
-void main(void)
+int main(void)
 {
 	rmw_uros_set_custom_transport(
 		MICRO_ROS_FRAMING_REQUIRED,
@@ -91,4 +91,5 @@ void main(void)
 	// free resources
 	RCCHECK(rcl_publisher_fini(&publisher, &node))
 	RCCHECK(rcl_node_fini(&node))
+  return 0;    
 }


Reviews:
user: login: pablogs9
body: Some comments
state: CHANGES_REQUESTED
author_association: MEMBER
submitted_at: 2025-01-20T07:15:38Z
user: login: Z0rdon
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-01-25T00:15:02Z
user: login: pablogs9
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-01-27T06:50:26Z
user: login: pablogs9
state: CHANGES_REQUESTED
author_association: MEMBER
submitted_at: 2025-03-14T09:47:50Z
user: login: 4ntn
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-14T12:11:51Z
user: login: 4ntn
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-14T12:12:25Z

Review comments:
diff_hunk: @@ -1,71 +1,42 @@
 name: CI
 
 on:
+  workflow_dispatch:
+    inputs:
+      name:
+        description: "Manual trigger"
   pull_request:
-    branches:
-      - '**'
+    branches-ignore: ["iron", "rolling", "humble"]
path: .github/workflows/ci.yml
user: login: pablogs9
body: Please do not ignore PR to active branches
created_at: 2025-01-20T07:13:45Z
author_association: MEMBER
diff_hunk: @@ -10,75 +10,34 @@ on:
 
 jobs:
 
-  micro_ros_zephyr_module:
+  nightly_micro_ros_zephyr_module:
     runs-on: ubuntu-latest
-    container: ubuntu:22.04
+    container: 
+      image: zephyrprojectrtos/ci:v0.26.17
+      options: --user root
+    env:
+      CMAKE_PREFIX_PATH: /opt/toolchains
     strategy:
       fail-fast: false
-      matrix:
-        zephyr_version: ["zephyr-v3.1.0", "zephyr-v2.7.2"]
-        distro: ["iron", "humble", "rolling", "jazzy"]
-        include:
-          - distro: iron
-            branch: iron
-          - distro: rolling
-            branch: rolling
-          - distro: humble
-            branch: humble
-          - distro: jazzy
-            branch: jazzy
-          - zephyr_version: zephyr-v2.7.2
-            zephyr_sdk: 0.14.2
-            sdk_filename: zephyr-sdk-$TOOLCHAIN_VERSION\_linux-x86_64_minimal.tar.gz
-          - zephyr_version: zephyr-v3.1.0
-            zephyr_sdk: 0.14.2
-            sdk_filename: zephyr-sdk-$TOOLCHAIN_VERSION\_linux-x86_64_minimal.tar.gz
     steps:
-      - uses: actions/checkout@v2
+      - uses: actions/checkout@v4
         with:
           path: micro_ros_zephyr_module
-          branch: ${{ matrix.branch }}
+          ref: jazzy
path: .github/workflows/nightly.yml
user: login: pablogs9
body: Nightly is not running all ROS 2 distros as in previous approach
created_at: 2025-01-20T07:14:31Z
author_association: MEMBER
diff_hunk: @@ -10,75 +10,34 @@ on:
 
 jobs:
 
-  micro_ros_zephyr_module:
+  nightly_micro_ros_zephyr_module:
     runs-on: ubuntu-latest
-    container: ubuntu:22.04
+    container: 
+      image: zephyrprojectrtos/ci:v0.26.17
+      options: --user root
+    env:
+      CMAKE_PREFIX_PATH: /opt/toolchains
     strategy:
       fail-fast: false
-      matrix:
-        zephyr_version: ["zephyr-v3.1.0", "zephyr-v2.7.2"]
-        distro: ["iron", "humble", "rolling", "jazzy"]
-        include:
-          - distro: iron
-            branch: iron
-          - distro: rolling
-            branch: rolling
-          - distro: humble
-            branch: humble
-          - distro: jazzy
-            branch: jazzy
-          - zephyr_version: zephyr-v2.7.2
-            zephyr_sdk: 0.14.2
-            sdk_filename: zephyr-sdk-$TOOLCHAIN_VERSION\_linux-x86_64_minimal.tar.gz
-          - zephyr_version: zephyr-v3.1.0
-            zephyr_sdk: 0.14.2
-            sdk_filename: zephyr-sdk-$TOOLCHAIN_VERSION\_linux-x86_64_minimal.tar.gz
     steps:
-      - uses: actions/checkout@v2
+      - uses: actions/checkout@v4
         with:
           path: micro_ros_zephyr_module
-          branch: ${{ matrix.branch }}
+          ref: jazzy
path: .github/workflows/nightly.yml
user: login: Z0rdon
body: Hello @pablogs9. Thanks for the feedback.

Currently, I have split the GitHub actions into the following configurations: 

1. The iron/rolling/humble coverage was moved into GitHub actions called "legacy_ci.yml" and "legacy_nightly.yml". These "legacy" actions test the iron/rolling/humble branches against Zephyr versions v3.1.0 and v2.7.2, using the Zephyr docker image based on SDK 0.14.2. [This matches the configuration currently in use by this microROS Zephyr project.]

2. The jazzy coverage is in "ci.yml" and "nightly.yml". These actions are running with Zephyr version v4.0.99, using the Zephyr docker image based on SDK 0.16.9-rc3.

Is it imperative that the older ROS 2 distros run on the newer Zephyr setup?
created_at: 2025-01-25T00:15:01Z
author_association: CONTRIBUTOR
diff_hunk: @@ -10,75 +10,34 @@ on:
 
 jobs:
 
-  micro_ros_zephyr_module:
+  nightly_micro_ros_zephyr_module:
     runs-on: ubuntu-latest
-    container: ubuntu:22.04
+    container: 
+      image: zephyrprojectrtos/ci:v0.26.17
+      options: --user root
+    env:
+      CMAKE_PREFIX_PATH: /opt/toolchains
     strategy:
       fail-fast: false
-      matrix:
-        zephyr_version: ["zephyr-v3.1.0", "zephyr-v2.7.2"]
-        distro: ["iron", "humble", "rolling", "jazzy"]
-        include:
-          - distro: iron
-            branch: iron
-          - distro: rolling
-            branch: rolling
-          - distro: humble
-            branch: humble
-          - distro: jazzy
-            branch: jazzy
-          - zephyr_version: zephyr-v2.7.2
-            zephyr_sdk: 0.14.2
-            sdk_filename: zephyr-sdk-$TOOLCHAIN_VERSION\_linux-x86_64_minimal.tar.gz
-          - zephyr_version: zephyr-v3.1.0
-            zephyr_sdk: 0.14.2
-            sdk_filename: zephyr-sdk-$TOOLCHAIN_VERSION\_linux-x86_64_minimal.tar.gz
     steps:
-      - uses: actions/checkout@v2
+      - uses: actions/checkout@v4
         with:
           path: micro_ros_zephyr_module
-          branch: ${{ matrix.branch }}
+          ref: jazzy
path: .github/workflows/nightly.yml
user: login: pablogs9
body: Hello @Z0rdon,

Humble is an active distro until May 2027 and Rolling is "newer" than Jazzy.

I'm okay with getting rid of Iron since it is EOL.

Concerning the CI, ideally, we need to have a single workflow that tests the module for all active distros.
created_at: 2025-01-27T06:50:26Z
author_association: MEMBER
diff_hunk: @@ -1,71 +1,48 @@
 name: CI
 
 on:
+  workflow_dispatch:
+    inputs:
+      name:
+        description: "Manual trigger"
   pull_request:
-    branches:
-      - '**'
+    branches: ["rolling", "jazzy", "humble"]
 
 jobs:
 
   micro_ros_zephyr_module:
     runs-on: ubuntu-latest
-    container: ubuntu:22.04
+    container: 
+      image: zephyrprojectrtos/ci:v0.26.17
+      options: --user root
+    env:
+      CMAKE_PREFIX_PATH: /opt/toolchains
     strategy:
       fail-fast: false
       matrix:
-        zephyr_version: ["zephyr-v3.1.0", "zephyr-v2.7.2"]
-        include:
-          - zephyr_version: zephyr-v2.7.2
-            zephyr_sdk: 0.14.2
-            sdk_filename: zephyr-sdk-$TOOLCHAIN_VERSION\_linux-x86_64_minimal.tar.gz
-          - zephyr_version: zephyr-v3.1.0
-            zephyr_sdk: 0.14.2
-            sdk_filename: zephyr-sdk-$TOOLCHAIN_VERSION\_linux-x86_64_minimal.tar.gz
+        zephyr_version: ["v4.0.0"]
path: .github/workflows/ci.yml
user: login: pablogs9
body: Missing `v4.1.0 (SDK 0.17.0)` as stated in README.md @4ntn 
created_at: 2025-03-14T09:46:47Z
author_association: MEMBER
diff_hunk: @@ -10,75 +10,47 @@ on:
 
 jobs:
 
-  micro_ros_zephyr_module:
+  nightly_micro_ros_zephyr_module:
     runs-on: ubuntu-latest
-    container: ubuntu:22.04
+    container: 
+      image: zephyrprojectrtos/ci:v0.26.17
+      options: --user root
+    env:
+      CMAKE_PREFIX_PATH: /opt/toolchains
     strategy:
       fail-fast: false
       matrix:
-        zephyr_version: ["zephyr-v3.1.0", "zephyr-v2.7.2"]
-        distro: ["iron", "humble", "rolling", "jazzy"]
+        zephyr_version: ["v4.0.0"]
path: .github/workflows/nightly.yml
user: login: pablogs9
body: Missing `v4.1.0 (SDK 0.17.0)` as stated in README.md @4ntn 
created_at: 2025-03-14T09:46:53Z
author_association: MEMBER
diff_hunk: @@ -1,71 +1,48 @@
 name: CI
 
 on:
+  workflow_dispatch:
+    inputs:
+      name:
+        description: "Manual trigger"
   pull_request:
-    branches:
-      - '**'
+    branches: ["rolling", "jazzy", "humble"]
 
 jobs:
 
   micro_ros_zephyr_module:
     runs-on: ubuntu-latest
-    container: ubuntu:22.04
+    container: 
+      image: zephyrprojectrtos/ci:v0.26.17
+      options: --user root
+    env:
+      CMAKE_PREFIX_PATH: /opt/toolchains
     strategy:
       fail-fast: false
       matrix:
-        zephyr_version: ["zephyr-v3.1.0", "zephyr-v2.7.2"]
-        include:
-          - zephyr_version: zephyr-v2.7.2
-            zephyr_sdk: 0.14.2
-            sdk_filename: zephyr-sdk-$TOOLCHAIN_VERSION\_linux-x86_64_minimal.tar.gz
-          - zephyr_version: zephyr-v3.1.0
-            zephyr_sdk: 0.14.2
-            sdk_filename: zephyr-sdk-$TOOLCHAIN_VERSION\_linux-x86_64_minimal.tar.gz
+        zephyr_version: ["v4.0.0"]
path: .github/workflows/ci.yml
user: login: 4ntn
body: Addressed in cbf11fab2f2ee867acab87a47f8c9de93c2ac615 and 57496a6edc05603998d95b6f43fb926ff07985ad.
CI is passing and matching readme's specification.
created_at: 2025-03-14T12:11:51Z
author_association: CONTRIBUTOR
diff_hunk: @@ -10,75 +10,47 @@ on:
 
 jobs:
 
-  micro_ros_zephyr_module:
+  nightly_micro_ros_zephyr_module:
     runs-on: ubuntu-latest
-    container: ubuntu:22.04
+    container: 
+      image: zephyrprojectrtos/ci:v0.26.17
+      options: --user root
+    env:
+      CMAKE_PREFIX_PATH: /opt/toolchains
     strategy:
       fail-fast: false
       matrix:
-        zephyr_version: ["zephyr-v3.1.0", "zephyr-v2.7.2"]
-        distro: ["iron", "humble", "rolling", "jazzy"]
+        zephyr_version: ["v4.0.0"]
path: .github/workflows/nightly.yml
user: login: 4ntn
body: Addressed https://github.com/micro-ROS/micro_ros_zephyr_module/commit/cbf11fab2f2ee867acab87a47f8c9de93c2ac615
created_at: 2025-03-14T12:12:25Z
author_association: CONTRIBUTOR

PR comments:
user: login: pablogs9
created_at: 2025-01-14T06:12:47Z
body: Hello would you mind updating both workflows to make this compatible with your PR? 
https://github.com/micro-ROS/micro_ros_zephyr_module/tree/jazzy/.github/workflows
author_association: MEMBER
user: login: Z0rdon
created_at: 2025-01-15T05:47:02Z
body: Absolutely- I'll try to have these changes done in the next 24 hours.
author_association: CONTRIBUTOR
user: login: Z0rdon
created_at: 2025-01-16T05:18:06Z
body: I have added an attempt to update the workflows.
I haven't used github actions before so I welcome your feedback and corrections.

I was testing locally using 'act', but I was having some difficulty getting the checkout to match the 'ref'. Instead, it appeared that the microROS-zephyr-module repo in the 'act' execution environment always matched whatever was currently checked out locally. I'll have to examine the docs a bit more.

Additionally, I also could not get any workflows to automatically appear in the 'Actions' pane on the Github page of my fork of the project. Are the workflows auto-populated somehow or do I need to perform some manual setup?

Thanks!
author_association: CONTRIBUTOR
user: login: pablogs9
created_at: 2025-01-16T06:47:20Z
body: CI running, it seems that I need to approve the execution
author_association: MEMBER
user: login: Z0rdon
created_at: 2025-01-17T05:27:00Z
body: Next attempt to fix the workflows.

As for the issues I previously ran into:
First, I believe my issue when running 'act' relates to [bug #2391](https://github.com/nektos/act/issues/2392).
Second, changing the default branch of my fork allowed the workflows to become visible. Alas executing the free runner produces the error "no space left on device" due to the large size of the environment.
I may try to either cut out some of the ubuntu fluff or set up a self-hosted runner so I can iterate locally. 

I was surprised the previous ci.yml change didn't build correctly. My local execution runs were successful. Nevertheless, I have made some adjustments to hopefully get the SDK detected correctly.
author_association: CONTRIBUTOR
user: login: Z0rdon
created_at: 2025-03-09T18:54:24Z
body: Hello @pablogs9.
I hope you are well.

Here is my next workflow adjustment attempt. I believe all of the active ROS2 distros are now part of a single workflow, as you requested.

Right now the relevant commits that enable updating the zephyr version are only on the 'jazzy' branch, so the CI will likely only work for this branch until the relevant changes are applied to the other branches. 
I have not investigated yet whether these commits can simply be 'cherry picked' to the other active distro branches or if additional work will be required.
author_association: CONTRIBUTOR
user: login: pablogs9
created_at: 2025-03-10T07:02:46Z
body: Hey @Z0rdon, CI looks good, we are going to do a quick test and will merge ASAP.

Thanks for the contribution.
author_association: MEMBER
user: login: pablogs9
created_at: 2025-03-17T07:06:20Z
body: @mergify backport humble rolling
author_association: MEMBER
user: login: mergify[bot]
created_at: 2025-03-17T07:06:38Z
body: > backport humble rolling

#### ✅ Backports have been created

<details>

* [#147 updates project to work with zephyr v4.0.x (backport #146)](https://github.com/micro-ROS/micro_ros_zephyr_module/pull/147) has been created for branch `humble` but encountered conflicts
* [#148 updates project to work with zephyr v4.0.x (backport #146)](https://github.com/micro-ROS/micro_ros_zephyr_module/pull/148) has been created for branch `rolling` but encountered conflicts

</details>


<!---
DO NOT EDIT
-*- Mergify Payload -*-
{"command": "backport humble rolling", "conclusion": "success", "action_is_running": true}
-*- Mergify Payload End -*-
-->
author_association: CONTRIBUTOR