Skip to content

Commit cadcafc

Browse files
dschogitster
authored andcommitted
ci(github): also mark up compile errors
When GCC produces those helpful errors, we will want to present them in the GitHub workflow runs in the most helpful manner. To that end, we want to use workflow commands to render errors and warnings: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions In the previous commit, we ensured that grouping is used for the build in all jobs, and this allows us to piggy-back onto the `group` function to transmogrify the output. Note: If `set -o pipefail` was available, we could do this in a little more elegant way. But since some of the steps are run using `dash`, we have to do a little `{ ...; echo $? >exit.status; } | ...` dance. Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent df5fed9 commit cadcafc

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

ci/lib.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,14 @@ else
2929
set +x
3030
begin_group "$1"
3131
shift
32-
"$@"
33-
res=$?
32+
# work around `dash` not supporting `set -o pipefail`
33+
(
34+
"$@" 2>&1
35+
echo $? >exit.status
36+
) |
37+
sed 's/^\(\([^ ]*\):\([0-9]*\):\([0-9]*:\) \)\(error\|warning\): /::\5 file=\2,line=\3::\1/'
38+
res=$(cat exit.status)
39+
rm exit.status
3440
end_group
3541
return $res
3642
}

0 commit comments

Comments
 (0)