Skip to content

Commit 36c1b93

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

File tree

1 file changed

+25
-3
lines changed

1 file changed

+25
-3
lines changed

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

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,33 @@ jobs:
132132
# Halt the execution if any of the build_file invocations fail
133133
echo "::group::Build Output"
134134
echo "Starting builds for all projects..."
135-
parallel --keep-order --halt-on-error 2 build_file ::: "${apps_to_build[@]}"
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
139+
140+
# Check for any failed builds by examining the log files
141+
echo "Checking for build failures..."
142+
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"
150+
echo "--- End of error output ---"
151+
fi
152+
done
136153
echo "::endgroup::"
137154
138-
# Check the exit status of parallel
139-
parallel_exit=$?
155+
# Check if any builds failed
156+
if [ ${#failed_builds[@]} -gt 0 ]; then
157+
echo "::error::The following builds failed: ${failed_builds[*]}"
158+
parallel_exit=1
159+
else
160+
parallel_exit=0
161+
fi
140162
# If parallel failed, make sure the workflow fails too
141163
if [ $parallel_exit -ne 0 ]; then
142164
echo "::error::One or more builds failed. See build output above for details."

0 commit comments

Comments
 (0)