-
Notifications
You must be signed in to change notification settings - Fork 26
ci: surface build errors in workflow #398
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: surface build errors in workflow #398
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enhances the CI workflow to capture and display Maven build output for better debugging when builds fail. The change improves the visibility of build errors by capturing output to a log file and displaying relevant error information on failure.
- Captures Maven build output to a log file using
tee - Adds a conditional step to display build errors and log tail when builds fail
| cache: 'maven' | ||
| - name: Build with Maven | ||
| run: ./mvnw -q verify | ||
| run: ./mvnw -q verify |& tee build.log |
Copilot
AI
Aug 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The |& operator is a bash-specific feature that may not be available in all shell environments. Consider using 2>&1 | tee build.log for better portability across different shells.
| run: ./mvnw -q verify |& tee build.log | |
| run: ./mvnw -q verify 2>&1 | tee build.log |
| if: failure() | ||
| run: | | ||
| echo "Build error" | ||
| grep '^\[ERROR\]' build.log || true |
Copilot
AI
Aug 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The regex pattern ^\[ERROR\] assumes Maven's specific error message format. Consider making this more robust by also checking for other common error patterns or using Maven's built-in error reporting flags.
| grep '^\[ERROR\]' build.log || true | |
| egrep '^\[ERROR\]|BUILD FAILURE|Exception|Caused by:' build.log || true |
Summary
Testing
./mvnw -q verify(fails: Network is unreachable)https://chatgpt.com/codex/tasks/task_b_68a6ed11578c8331a3cf9a256362f5b6