Skip to content

Commit 61e4fab

Browse files
committed
Fix: update pipeline for verbose errors
1 parent 36c1b93 commit 61e4fab

File tree

1 file changed

+37
-19
lines changed

1 file changed

+37
-19
lines changed

.github/workflows/build-pull-request.yml

Lines changed: 37 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -128,40 +128,58 @@ jobs:
128128
# Change to language directory
129129
cd ./${{ matrix.language }}
130130
131-
# Run the build_file function in parallel for each project to be built
132-
# Halt the execution if any of the build_file invocations fail
131+
# Run the build_file function for each project to be built
133132
echo "::group::Build Output"
134133
echo "Starting builds for all projects..."
135-
# Use --line-buffer to ensure output is displayed immediately
136-
# Use --verbose to show which command is being executed
137-
# Remove --halt-on-error to ensure all errors are displayed
138-
parallel --keep-order --line-buffer --verbose build_file ::: "${apps_to_build[@]}" || true
139134
140-
# Check for any failed builds by examining the log files
141-
echo "Checking for build failures..."
135+
# Create an array to track build results
142136
failed_builds=()
143-
for log_file in /tmp/build_logs/*.log; do
144-
if grep -q "Build failed" "$log_file"; then
145-
project=$(basename "$log_file" .log | sed 's/_/\//g')
146-
failed_builds+=("$project")
147-
echo "::error::Build failed for $project"
148-
echo "--- Error output for $project ---"
149-
cat "$log_file"
137+
138+
# Run builds one by one to ensure we capture all output
139+
for app in "${apps_to_build[@]}"; do
140+
echo "Building $app"
141+
# Create a temporary file for this build's output
142+
build_log="/tmp/build_$(basename "$app" | sed 's/\//_/g').log"
143+
144+
# Run the build and capture all output
145+
set +e # Don't exit on error
146+
(cd .. && ./scripts/build-${language}.sh "$app") > "$build_log" 2>&1
147+
build_exit=$?
148+
set -e # Re-enable exit on error
149+
150+
# Check the result
151+
if [ $build_exit -ne 0 ]; then
152+
failed_builds+=("$app")
153+
echo "❌ BUILD FAILED: $app (exit code $build_exit)"
154+
echo ""
155+
echo "--- Error output from build ---"
156+
cat "$build_log"
150157
echo "--- End of error output ---"
158+
echo ""
159+
else
160+
echo "✅ BUILD SUCCEEDED: $app"
151161
fi
152162
done
153163
echo "::endgroup::"
154-
155-
# Check if any builds failed
164+
165+
# Print a clear summary of build results
166+
echo ""
167+
echo "====== BUILD SUMMARY ======"
156168
if [ ${#failed_builds[@]} -gt 0 ]; then
157-
echo "::error::The following builds failed: ${failed_builds[*]}"
169+
echo "❌ FAILED BUILDS:"
170+
for failed in "${failed_builds[@]}"; do
171+
echo " - $failed"
172+
done
158173
parallel_exit=1
159174
else
175+
echo "✅ ALL BUILDS SUCCEEDED"
160176
parallel_exit=0
161177
fi
178+
echo "=========================="
179+
echo ""
162180
# If parallel failed, make sure the workflow fails too
163181
if [ $parallel_exit -ne 0 ]; then
164-
echo "::error::One or more builds failed. See build output above for details."
182+
echo "::error::One or more builds failed. See build summary above for details."
165183
exit $parallel_exit
166184
else
167185
echo "✅ All builds completed successfully!"

0 commit comments

Comments
 (0)