-
Notifications
You must be signed in to change notification settings - Fork 44
72 lines (61 loc) · 2.06 KB
/
ci.yml
File metadata and controls
72 lines (61 loc) · 2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: CI
on:
workflow_dispatch:
inputs:
name:
description: "Manual trigger"
pull_request:
branches: ["rolling", "kilted", "jazzy", "humble"]
jobs:
micro_ros_zephyr_module:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
zephyr_version: ["v4.0.0", "v4.1.0"]
steps:
- uses: actions/checkout@v4
with:
path: micro_ros_zephyr_module
- 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
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
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