Repository navigation
Report build warnings as annotations in the Xcode 27 job - #272
Merged
Merged
Conversation
Tee the build log and add a "Find warnings" step that turns each compiler warning or error into a GitHub annotation, and lists them all in the job summary, since GitHub shows at most 10 annotations per step. Warnings inside a macro expansion such as #expect are reported against the expansion, so they are placed at the "expanded code originates here" note's location instead. NO_COLOR=1 stops swift build writing colour and hyperlink escapes into the piped log.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #272 +/- ##
==========================================
- Coverage 93.88% 93.75% -0.13%
==========================================
Files 73 73
Lines 4022 4022
==========================================
- Hits 3776 3771 -5
- Misses 246 251 +5 ☔ View full report in Codecov by Harness. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Xcode 27 job now reports compiler warnings and errors as GitHub annotations, on the run and on the PR diff.
swift buildthroughtee build.log, withset -o pipefailso a failed build still fails the step.NO_COLOR=1stopsswift buildwriting colour and hyperlink escapes into the piped output..github/actions/annotate-warnings, a short awk script that turns eachpath:line:col: warning:orerror:into::warning file=…,line=…. It runs even when the build fails (!cancelled()).#expectare reported againstmacro expansion #expect:1:22, which GitHub can't place. The script takes the location from the following "expanded code originates here" note instead, so they land on the test line. xcbeautify's GitHub renderer reports them asfile=macro expansion #expect,line=1.This PR leaves the four
trywarnings inWSHandlerTestsandAsyncStream+WSFrameTestsin place so its run shows the annotations. They're fixed in a follow-up PR.Testing
Locally against
NO_COLOR=1build logs:main: 4 macro warnings, each on its test file and line.::errorannotation, and the pipeline exits 1.🤖 Generated with Claude Code