Skip to content

Commit ebd504d

Browse files
authored
Add retries for rpi build (#1238)
* Add retries for build * Checking CMake output * Remove j * Fix the quotes
1 parent 04945d2 commit ebd504d

File tree

1 file changed

+37
-1
lines changed

1 file changed

+37
-1
lines changed

.github/workflows/raspberry-pi.yaml

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,43 @@ jobs:
6969
cd build
7070
7171
cmake .. -DBUILD_GSTREAMER_PLUGIN=ON -DBUILD_DEPENDENCIES=OFF -DALIGNED_MEMORY_MODEL=ON
72-
make
72+
if [ $? -ne 0 ]; then
73+
echo "CMake configuration failed!"
74+
exit 1
75+
fi
76+
77+
echo "Listing contents of build directory:"
78+
ls -l
79+
80+
# Running -make- under QEMU inside GitHub Actions has shown instability,
81+
# with random segmentation faults occurring sporadically. This could be
82+
# due to QEMU-s emulation overhead, memory constraints, or transient
83+
# issues in the GitHub-hosted environment. To mitigate these failures,
84+
# we retry the build up to 5 times before considering it a hard failure.
85+
86+
max_retries=5
87+
attempt=0
88+
while [ $attempt -lt $max_retries ]; do
89+
attempt=$((attempt + 1))
90+
echo "Attempt $attempt of $max_retries..."
91+
92+
set +e # Temporarily disable exit on error
93+
make -j
94+
exit_code=$?
95+
set -e # Re-enable exit on error
96+
97+
if [ $exit_code -eq 0 ]; then
98+
break
99+
fi
100+
101+
echo "Build failed with exit code $exit_code - retrying..."
102+
sleep 5
103+
done
104+
105+
if [ $exit_code -ne 0 ]; then
106+
echo "Build failed after $max_retries attempts."
107+
exit 1
108+
fi
73109
74110
export GST_PLUGIN_PATH=$(pwd)
75111

0 commit comments

Comments
 (0)