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
1 change: 1 addition & 0 deletions modules/libmicroros/libmicroros.mk
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ $(COMPONENT_PATH)/micro_ros_dev/install:
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; \
touch src/ament_cmake_ros/rmw_test_fixture/COLCON_IGNORE; \
colcon build --cmake-args -DBUILD_TESTING=OFF;

$(COMPONENT_PATH)/micro_ros_src/src:
Expand Down
Loading