-
Notifications
You must be signed in to change notification settings - Fork 1k
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
gha: Print all *.log files, in a separate action #1655
gha: Print all *.log files, in a separate action #1655
Conversation
ecc34c7
to
8960c5e
Compare
Ready for review (if CI passes :)). If you prefer, I could split the changes into separate commits, but I don't think it's worth the hassle. It's not entirely clear how to separate these changes, and doing so would increase the sum of the diff because later commits will need to touch lines moved in earlier commits. |
@hebasto Can you take a look at this? |
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.
Concept ACK.
shopt -s nullglob | ||
for file in *.log; do | ||
cat_file "$file" | ||
done |
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 make.log
file is now printed along with other logs.
Does it make sense to separate logs by groups:
config.log
andmake.log
- tests and benchmarks
- examples
?
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.
I agree that this would produce better output, but I also think that *.log
is good enough and much easier to maintain.
run: | | ||
group() { |
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 first line of the run
command is printed as a group header in the Web interface. It could be a meaningful comment, for example: # Print the log files produced by ci/ci.sh
.
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.
Yeah, it's annoying that it's not possible to get rid of this line, but making it contain a comment is a great idea. Fixed.
Before this commit, we didn't print *_example.log files and test_suite.log. Printing is now handled in a separate action, which avoids code duplication and makes the ci.yml file more readable. This changes the folding/grouping of the log output in the GitHub Actions CI, but I think the new variant is as good as the old one. Furthermore, the condition for printing the logs is changed from "always()" to "!cancelled()". This ensures that logs will still be printed if previous steps such as the CI script failed, but that they won't be printed if the entire run is cancelled (e.g., by clicking a button in the UI or through a force-push to the PR). This is in line with a recommendation in the GHA docs: https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/evaluate-expressions-in-workflows-and-actions#always
8960c5e
to
59860bc
Compare
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.
ACK 59860bc.
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.
ACK 59860bc
Before this commit, we didn't print *_example.log files and
test_suite.log.
Printing is now handled in a separate action, which avoids code
duplication and makes the ci.yml file more readable. This changes the
folding/grouping of the log output in the GitHub Actions CI, but I
think the new variant is as good as the old one.
Furthermore, the condition for printing the logs is changed from
"always()" to "!cancelled()". This ensures that logs will still be
printed if previous steps such as the CI script failed, but that they
won't be printed if the entire run is cancelled (e.g., by clicking a
button in the UI or through a force-push to the PR). This is in line
with a recommendation in the GHA docs:
https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/evaluate-expressions-in-workflows-and-actions#always