Skip to content

Commit

Permalink
[Spinal][GA] Repeat firmware build multiple times to avoid unexpected…
Browse files Browse the repository at this point in the history
… build fail.
  • Loading branch information
sugihara-16 committed Dec 28, 2024
1 parent c89afb8 commit 38f67db
Showing 1 changed file with 43 additions and 15 deletions.
58 changes: 43 additions & 15 deletions .github/workflows/spinal_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,27 +37,55 @@ jobs:

- name: Build Spinal H7 as STM32CubeIDE project # Build Spinal H7 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/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
# build firmware five times and it's determined as successful if just one of five was succeeded.
for i in {1..5}; do
echo "=== Attempt #$i for H7 Build ==="
/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
if [ $? -eq 0 ]; then
echo "Build Spinal H7 succeeded on attempt #$i."
exit 0
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
run: |
rm -rf ~/STM32CubeIDE/workspace_1.8.0/.metadata
- name: Build Spinal F7 as STM32CubeIDE project # Build Spinal F7 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/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
for i in {1..5}; do
echo "=== Attempt #$i for F7 Build ==="
/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
else
echo "Build Spinal F7 failed on attempt #$i."
fi
done
echo "All 5 attempts for Spinal F7 have failed."
exit 1
- name: Upload H7 artifacts # Upload required H7 files for flash.
uses: actions/upload-artifact@v4
Expand All @@ -69,4 +97,4 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: SpinalF7.artifacts
path: aerial_robot_nerve/spinal/mcu_project/boards/stm32F7/STM32CubeIDE/Debug/spinal.*
path: aerial_robot_nerve/spinal/mcu_project/boards/stm32F7/STM32CubeIDE/Debug/spinal.*

0 comments on commit 38f67db

Please sign in to comment.