Skip to content

Commit 8045861

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

File tree

3 files changed

+58
-24
lines changed

3 files changed

+58
-24
lines changed

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

Lines changed: 50 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -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!"

typescript/ec2-instance/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@
2424
"constructs": "^10.0.0",
2525
"dotenv": "^16.3.1"
2626
},
27-
"license": "MIT-0"
27+
"license": "MIT"
2828
}

typescript/ec2-instance/tsconfig.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
"strictNullChecks": true,
1212
"noImplicitThis": true,
1313
"alwaysStrict": true,
14-
"noUnusedLocals": true,
15-
"noUnusedParameters": true,
14+
"noUnusedLocals": false,
15+
"noUnusedParameters": false,
1616
"noImplicitReturns": true,
1717
"noFallthroughCasesInSwitch": true,
1818
"inlineSourceMap": true,
@@ -23,7 +23,11 @@
2323
"./node_modules/@types"
2424
],
2525
"outDir": "lib",
26-
"rootDir": "../.."
26+
"rootDir": "../..",
27+
"baseUrl": ".",
28+
"paths": {
29+
"../../test-utils/*": ["../../test-utils/*"]
30+
}
2731
},
2832
"exclude": [
2933
"node_modules",

0 commit comments

Comments
 (0)