-
Notifications
You must be signed in to change notification settings - Fork 35
141 lines (122 loc) · 5.48 KB
/
firmware_build.yml
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
name: Build Spinal Firmware
on : [push, pull_request, workflow_dispatch]
jobs:
build:
runs-on: ubuntu-latest
container:
image: ghcr.io/ut-dragon-lab/stm32cubeide_1.8.0_build_env:latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
# submodules too
submodules: recursive
- name: Install ROS packages with rosdep # Setup Github ws as a catkin ws
shell: bash
run: |
source /opt/ros/noetic/setup.bash
rm /etc/ros/rosdep/sources.list.d/20-default.list
sudo rosdep init
rosdep update
mkdir -p ~/catkin_ws/src
ln -s $GITHUB_WORKSPACE ~/catkin_ws/src/jsk_aerial_robot
cd ~/catkin_ws
rosdep install -y -r --from-paths src --ignore-src --rosdistro noetic
# - name: Build Spinal as ROS Package # Build Spinal to generate ROS libraries
# run: |
# source /opt/ros/noetic/setup.bash
# cd ~/catkin_ws
# catkin config --cmake-args -Dcatkin_DIR=/opt/ros/noetic/share/catkin/cmake
# catkin build -p 1 -j 1 spinal
# source devel/setup.bash
# shell: bash
- name: Build Spinal H7 as STM32CubeIDE project # Build Spinal H7 firmware with STM32CubeIDE
shell: bash
run: |
# set default result to avoid build interruption
set +e
for i in {1..5}; do
echo "=== Attempt #$i for H7 Build ==="
#build ros packages related to spinla firmware
source /opt/ros/noetic/setup.bash
cd ~/catkin_ws
catkin config --cmake-args -Dcatkin_DIR=/opt/ros/noetic/share/catkin/cmake
catkin build -p 1 -j 1 spinal
source devel/setup.bash
# back to default workspace
cd $GITHUB_WORKSPACE
/opt/st/stm32cubeide_1.8.0/stm32cubeide -nosplash \
-application org.eclipse.cdt.managedbuilder.core.headlessbuild \
-data ~/STM32CubeIDE/workspace_1.8.0/ \
-import aerial_robot_nerve/spinal/mcu_project/boards/stm32H7/STM32CubeIDE/ \
-cleanBuild spinal/Debug \
-vmargs -Dorg.eclipse.cdt.core.build.parallel=true \
-Dorg.eclipse.cdt.core.build.parallel.threads=12
# check build result
if [ $? -eq 0 ]; then
echo "Build Spinal H7 succeeded on attempt #$i."
exit 0 # success
else
echo "Build Spinal H7 failed on attempt #$i."
fi
done
echo "All 5 attempts for Spinal H7 have failed."
exit 1
- name: Clean up STM32CubeIDE # Clean up STM32CubeIDE WS to build same name project
shell: bash
run: |
rm -rf ~/STM32CubeIDE/workspace_1.8.0/.metadata
- name: Build Spinal F7 as STM32CubeIDE project # Build Spinal F7 firmware with STM32CubeIDE
shell: bash
run: |
set +e
for i in {1..5}; do
echo "=== Attempt #$i for F7 Build ==="
#build ros packages related to spinla firmware
source /opt/ros/noetic/setup.bash
cd ~/catkin_ws
catkin config --cmake-args -Dcatkin_DIR=/opt/ros/noetic/share/catkin/cmake
catkin build -p 1 -j 1 spinal
source devel/setup.bash
# back to default workspace
cd $GITHUB_WORKSPACE
/opt/st/stm32cubeide_1.8.0/stm32cubeide -nosplash \
-application org.eclipse.cdt.managedbuilder.core.headlessbuild \
-data ~/STM32CubeIDE/workspace_1.8.0/ \
-import aerial_robot_nerve/spinal/mcu_project/boards/stm32F7/STM32CubeIDE/ \
-cleanBuild spinal/Debug \
-vmargs -Dorg.eclipse.cdt.core.build.parallel=true \
-Dorg.eclipse.cdt.core.build.parallel.threads=12
if [ $? -eq 0 ]; then
echo "Build Spinal F7 succeeded on attempt #$i."
exit 0 #success
else
echo "Build Spinal F7 failed on attempt #$i."
fi
done
echo "All 5 attempts for Spinal F7 have failed."
exit 1
- name: Build Neuron F4 as STM32CubeIDE project # Build Neuron F4 firmware with STM32CubeIDE
run: |
/opt/st/stm32cubeide_1.8.0/stm32cubeide -nosplash \
-application org.eclipse.cdt.managedbuilder.core.headlessbuild \
-data ~/STM32CubeIDE/workspace_1.8.0/ \
-import aerial_robot_nerve/neuron/neuron_f4//STM32CubeIDE/ \
-cleanBuild neuron/Debug \
-vmargs -Dorg.eclipse.cdt.core.build.parallel=true \
-Dorg.eclipse.cdt.core.build.parallel.threads=12
- name: Upload Spinal H7 artifacts # Upload required Spinal H7 files for flash.
uses: actions/upload-artifact@v4
with:
name: SpinalH7.artifacts
path: aerial_robot_nerve/spinal/mcu_project/boards/stm32H7/STM32CubeIDE/Debug/spinal.*
- name: Upload Spinal F7 artifacts # Upload required Spinal F7 files for flash.
uses: actions/upload-artifact@v4
with:
name: SpinalF7.artifacts
path: aerial_robot_nerve/spinal/mcu_project/boards/stm32F7/STM32CubeIDE/Debug/spinal.*
- name: Upload Neuron F4 artifacts # Upload required Neuron F4 files for flash.
uses: actions/upload-artifact@v4
with:
name: NeuronF4.artifacts
path: aerial_robot_nerve/neuron/neuron_f4/STM32CubeIDE/Debug/neuron.*