Skip to content

Commit 229ffc0

Browse files
Fix CI no space left on device (#157)
* Free space in docker Signed-off-by: Eugenio Collado <[email protected]> * Build script as step Signed-off-by: Eugenio Collado <[email protected]> * Nightly Signed-off-by: Eugenio Collado <[email protected]> --------- Signed-off-by: Eugenio Collado <[email protected]>
1 parent b81263f commit 229ffc0

File tree

3 files changed

+64
-24
lines changed

3 files changed

+64
-24
lines changed

.github/workflows/ci.yml

Lines changed: 32 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,27 +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
60+
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:
@@ -37,27 +32,51 @@ jobs:
3732
path: micro_ros_zephyr_module
3833
ref: ${{ matrix.branch }}
3934

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

modules/libmicroros/libmicroros.mk

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

7374
$(COMPONENT_PATH)/micro_ros_src/src:

0 commit comments

Comments
 (0)