@@ -129,39 +129,54 @@ jobs:
129129 cd ./${{ matrix.language }}
130130
131131 # 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
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..."
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"
135+ # Create an array to track build results
136+ declare -A build_results
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+ build_file "$app" > /tmp/build_output.log 2>&1
142+ build_exit=$?
143+
144+ # Store the result
145+ if [ $build_exit -ne 0 ]; then
146+ build_results["$app"]=$build_exit
147+ echo "❌ BUILD FAILED: $app (exit code $build_exit)"
148+ echo "--- Error output from build ---"
149+ cat /tmp/build_output.log
150150 echo "--- End of error output ---"
151+ else
152+ echo "✅ BUILD SUCCEEDED: $app"
151153 fi
152154 done
153155 echo "::endgroup::"
154-
155- # Check if any builds failed
156+
157+ # Check if any builds failed and provide a clear summary
158+ failed_builds=()
159+ for app in "${!build_results[@]}"; do
160+ failed_builds+=("$app")
161+ done
162+
163+ echo ""
164+ echo "====== BUILD SUMMARY ======"
156165 if [ ${#failed_builds[@]} -gt 0 ]; then
157- echo "::error::The following builds failed: ${failed_builds[*]}"
166+ echo "❌ FAILED BUILDS:"
167+ for failed in "${failed_builds[@]}"; do
168+ echo " - $failed (exit code: ${build_results[$failed]})"
169+ fi
158170 parallel_exit=1
159171 else
172+ echo "✅ ALL BUILDS SUCCEEDED"
160173 parallel_exit=0
161174 fi
175+ echo "=========================="
176+ echo ""
162177 # If parallel failed, make sure the workflow fails too
163178 if [ $parallel_exit -ne 0 ]; then
164- echo "::error::One or more builds failed. See build output above for details."
179+ echo "::error::One or more builds failed. See build summary above for details."
165180 exit $parallel_exit
166181 else
167182 echo "✅ All builds completed successfully!"
0 commit comments