Skip to content

Commit 3754def

Browse files
Fix CI no space left on device (#157)
* Free space in docker Signed-off-by: Eugenio Collado <eugeniocollado@eprosima.com> * Build script as step Signed-off-by: Eugenio Collado <eugeniocollado@eprosima.com> * Nightly Signed-off-by: Eugenio Collado <eugeniocollado@eprosima.com> --------- Signed-off-by: Eugenio Collado <eugeniocollado@eprosima.com>
1 parent 7ca1d14 commit 3754def

File tree

3 files changed

+63
-24
lines changed

3 files changed

+63
-24
lines changed

.github/workflows/ci.yml

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ jobs:
1212

1313
micro_ros_zephyr_module:
1414
runs-on: ubuntu-latest
15-
container:
16-
image: zephyrprojectrtos/ci:v0.26.17
17-
options: --user root
18-
env:
19-
CMAKE_PREFIX_PATH: /opt/toolchains
2015
strategy:
2116
fail-fast: false
2217
matrix:
@@ -26,28 +21,52 @@ jobs:
2621
with:
2722
path: micro_ros_zephyr_module
2823

29-
- name: Build
30-
shell: bash
24+
- name: Free disk space
25+
run: |
26+
sudo rm -rf /usr/share/dotnet
27+
sudo rm -rf /usr/local/lib/android
28+
sudo rm -rf /opt/ghc
29+
sudo docker image prune --all --force
30+
31+
- name: Create build script
3132
run: |
33+
cat << 'EOF' > build.sh
34+
#!/bin/bash
35+
set -e
36+
3237
# Zephyr setup
3338
apt -y update
34-
west init
39+
west init
3540
cd zephyr
36-
git checkout ${{ matrix.zephyr_version }}
41+
git checkout $ZEPHYR_VERSION
3742
cd ..
3843
west update --narrow
3944
4045
# Installing micro-ROS prerequisites
4146
pip3 install catkin_pkg lark-parser empy colcon-common-extensions
4247
43-
if [[ ${{ github.ref_name }} == "humble" ]] || [[ ${{ github.head_ref }} == *"humble"* ]]; then
48+
if [[ "$REF_NAME" == "humble" ]] || [[ "$HEAD_REF" == *"humble"* ]]; then
4449
# Use empy version 3.3.4 for Humble
4550
pip3 install empy==3.3.4
4651
fi
4752
4853
# Build with Serial USB transport
49-
west build -b disco_l475_iot1 $GITHUB_WORKSPACE/micro_ros_zephyr_module -p -- -DCONFIG_MICROROS_TRANSPORT_SERIAL_USB=y
54+
west build -b disco_l475_iot1 /github/workspace/micro_ros_zephyr_module -p -- -DCONFIG_MICROROS_TRANSPORT_SERIAL_USB=y
5055
5156
# Build with Serial transport
52-
west build -b disco_l475_iot1 $GITHUB_WORKSPACE/micro_ros_zephyr_module -p -- -DCONFIG_MICROROS_TRANSPORT_SERIAL=y
57+
west build -b disco_l475_iot1 /github/workspace/micro_ros_zephyr_module -p -- -DCONFIG_MICROROS_TRANSPORT_SERIAL=y
58+
EOF
59+
chmod +x build.sh
5360
61+
- name: Build
62+
run: |
63+
sudo docker run --rm \
64+
--user root \
65+
-v ${{ github.workspace }}:/github/workspace \
66+
-w /github/workspace \
67+
-e CMAKE_PREFIX_PATH=/opt/toolchains \
68+
-e ZEPHYR_VERSION=${{ matrix.zephyr_version }} \
69+
-e REF_NAME=${{ github.ref_name }} \
70+
-e HEAD_REF=${{ github.head_ref }} \
71+
zephyrprojectrtos/ci:v0.26.17 \
72+
/github/workspace/build.sh

.github/workflows/nightly.yml

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ jobs:
1212

1313
nightly_micro_ros_zephyr_module:
1414
runs-on: ubuntu-latest
15-
container:
16-
image: zephyrprojectrtos/ci:v0.26.17
17-
options: --user root
18-
env:
19-
CMAKE_PREFIX_PATH: /opt/toolchains
2015
strategy:
2116
fail-fast: false
2217
matrix:
@@ -35,27 +30,51 @@ jobs:
3530
path: micro_ros_zephyr_module
3631
ref: ${{ matrix.branch }}
3732

38-
- name: Build
39-
shell: bash
33+
- name: Free disk space
34+
run: |
35+
sudo rm -rf /usr/share/dotnet
36+
sudo rm -rf /usr/local/lib/android
37+
sudo rm -rf /opt/ghc
38+
sudo docker image prune --all --force
39+
40+
- name: Create build script
4041
run: |
42+
cat << 'EOF' > build.sh
43+
#!/bin/bash
44+
set -e
45+
4146
# Zephyr setup
4247
apt -y update
43-
west init
48+
west init
4449
cd zephyr
45-
git checkout ${{ matrix.zephyr_version }}
50+
git checkout $ZEPHYR_VERSION
4651
cd ..
4752
west update --narrow
4853
4954
# Installing micro-ROS prerequisites
5055
pip3 install catkin_pkg lark-parser empy colcon-common-extensions
5156
52-
if [[ ${{ matrix.branch }} == "humble" ]]; then
57+
if [[ "$BRANCH_NAME" == "humble" ]]; then
5358
# Use empy version 3.3.4 for Humble
5459
pip3 install empy==3.3.4
5560
fi
5661
5762
# Build with Serial USB transport
58-
west build -b disco_l475_iot1 $GITHUB_WORKSPACE/micro_ros_zephyr_module -p -- -DCONFIG_MICROROS_TRANSPORT_SERIAL_USB=y
63+
west build -b disco_l475_iot1 /github/workspace/micro_ros_zephyr_module -p -- -DCONFIG_MICROROS_TRANSPORT_SERIAL_USB=y
5964
6065
# Build with Serial transport
61-
west build -b disco_l475_iot1 $GITHUB_WORKSPACE/micro_ros_zephyr_module -p -- -DCONFIG_MICROROS_TRANSPORT_SERIAL=y
66+
west build -b disco_l475_iot1 /github/workspace/micro_ros_zephyr_module -p -- -DCONFIG_MICROROS_TRANSPORT_SERIAL=y
67+
EOF
68+
chmod +x build.sh
69+
70+
- name: Build
71+
run: |
72+
sudo docker run --rm \
73+
--user root \
74+
-v ${{ github.workspace }}:/github/workspace \
75+
-w /github/workspace \
76+
-e CMAKE_PREFIX_PATH=/opt/toolchains \
77+
-e ZEPHYR_VERSION=${{ matrix.zephyr_version }} \
78+
-e BRANCH_NAME=${{ matrix.branch }} \
79+
zephyrprojectrtos/ci:v0.26.17 \
80+
/github/workspace/build.sh

modules/libmicroros/libmicroros.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ $(COMPONENT_PATH)/micro_ros_dev/install:
6767
git clone -b jazzy https://github.com/ament/googletest src/googletest; \
6868
git clone -b jazzy https://github.com/ros2/ament_cmake_ros src/ament_cmake_ros; \
6969
git clone -b jazzy https://github.com/ament/ament_index src/ament_index; \
70+
touch src/ament_cmake_ros/rmw_test_fixture/COLCON_IGNORE; \
7071
colcon build --cmake-args -DBUILD_TESTING=OFF;
7172

7273
$(COMPONENT_PATH)/micro_ros_src/src:

0 commit comments

Comments
 (0)