@@ -128,40 +128,70 @@ 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+ # Track failed builds
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"
150- echo "--- End of error output ---"
137+
138+ # Process each project one by one with clear grouping
139+ for app in "${apps_to_build[@]}"; do
140+ echo "::group::Building $app"
141+
142+ # Run the build directly
143+ set +e # Don't exit on error
144+ ../scripts/build-${language}.sh "$app"
145+ build_exit=$?
146+ set -e # Re-enable exit on error
147+
148+ if [ $build_exit -ne 0 ]; then
149+ echo "❌ BUILD FAILED: $app (exit code $build_exit)"
150+ failed_builds+=("$app")
151+ else
152+ echo "✅ BUILD SUCCEEDED: $app"
151153 fi
154+ echo "::endgroup::"
152155 done
153156 echo "::endgroup::"
154-
155- # Check if any builds failed
157+ # Print summary outside of any group
158+ echo ""
159+ echo "====== BUILD SUMMARY ======"
160+ if [ ${#failed_builds[@]} -gt 0 ]; then
161+ echo "❌ FAILED BUILDS:"
162+ for failed in "${failed_builds[@]}"; do
163+ echo " - $failed"
164+ done
165+ parallel_exit=1
166+ else
167+ echo "✅ ALL BUILDS SUCCEEDED"
168+ parallel_exit=0
169+ fi
170+ echo "=========================="
171+ echo ""
172+ echo "✅ BUILD SUCCEEDED: $app"
173+ fi
174+ done
175+ echo "::endgroup::"
176+
177+ # Print a clear summary of build results
178+ echo ""
179+ echo "====== BUILD SUMMARY ======"
156180 if [ ${#failed_builds[@]} -gt 0 ]; then
157- echo "::error::The following builds failed: ${failed_builds[*]}"
181+ echo "❌ FAILED BUILDS:"
182+ for failed in "${failed_builds[@]}"; do
183+ echo " - $failed"
184+ done
158185 parallel_exit=1
159186 else
187+ echo "✅ ALL BUILDS SUCCEEDED"
160188 parallel_exit=0
161189 fi
190+ echo "=========================="
191+ echo ""
162192 # If parallel failed, make sure the workflow fails too
163193 if [ $parallel_exit -ne 0 ]; then
164- echo "::error::One or more builds failed. See build output above for details."
194+ echo "::error::One or more builds failed. See build summary above for details."
165195 exit $parallel_exit
166196 else
167197 echo "✅ All builds completed successfully!"
0 commit comments