Skip to content

Commit 83d2755

Browse files
author
Michael Kaiser
committed
Improve build output visibility in GitHub Actions workflow
1 parent d1da5cb commit 83d2755

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

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

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -63,19 +63,19 @@ jobs:
6363
echo "Build Path $file"
6464
6565
# Run the build script for the current language, passing the project directory and extra path
66-
echo "::group::$file"
67-
if ../scripts/build-${language}.sh "$file" > "$log_file" 2>&1; then
68-
echo "::endgroup::"
69-
return 0
66+
echo "::group::Building $file"
67+
# Run the build command and capture output to both the log file and stdout
68+
../scripts/build-${language}.sh "$file" 2>&1 | tee "$log_file"
69+
local exit_code=${PIPESTATUS[0]}
70+
71+
if [ $exit_code -eq 0 ]; then
72+
echo "✅ Build succeeded for $file"
7073
else
71-
local exit_code=$?
72-
echo "::endgroup::"
73-
echo "::group::Error details for $file"
74-
cat "$log_file"
75-
echo "::endgroup::"
74+
echo "❌ Build failed for $file with exit code $exit_code"
7675
echo "::error::Build failed for $file with exit code $exit_code"
77-
return $exit_code
7876
fi
77+
echo "::endgroup::"
78+
return $exit_code
7979
}
8080
8181
# Export the build_file function for use in parallel
@@ -122,7 +122,10 @@ jobs:
122122
123123
# Run the build_file function in parallel for each project to be built
124124
# Halt the execution if any of the build_file invocations fail
125+
echo "::group::Build Output"
126+
echo "Starting builds for all projects..."
125127
parallel --keep-order --halt-on-error 2 build_file ::: "${apps_to_build[@]}"
128+
echo "::endgroup::"
126129
127130
# Check the exit status of parallel
128131
parallel_exit=$?
@@ -144,6 +147,8 @@ jobs:
144147
145148
# If parallel failed, make sure the workflow fails too
146149
if [ $parallel_exit -ne 0 ]; then
147-
echo "::error::One or more builds failed. See error details above."
150+
echo "::error::One or more builds failed. See build output above for details."
148151
exit $parallel_exit
152+
else
153+
echo "✅ All builds completed successfully!"
149154
fi

0 commit comments

Comments
 (0)