Skip to content

Commit 7ce13dc

Browse files
committed
Output error messages to the github summary file
This will show these messages in the Github Actions summary page to make them more visible.
1 parent 57a7f68 commit 7ce13dc

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

.github/workflows/make.yml

+17-7
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,33 @@ jobs:
1616
run: |
1717
clang-format -i */*.[ch]
1818
if git diff | grep ""; then
19-
echo
20-
echo "*** Formatting errors detected by clang-format."
21-
echo "*** Please apply the above diff or run:"
22-
echo " clang-format -i */*.[ch]"
23-
echo
19+
(echo "Formatting errors detected by clang-format." \
20+
"Please run \`make format\`.";
21+
echo) >> $GITHUB_STEP_SUMMARY
2422
false
2523
fi
2624
- name: Check C89 compliance
2725
env:
2826
CFLAGS: "-O0 -Werror -std=c89 -pedantic -Isrc"
2927
run: |
30-
gcc $CFLAGS -c */*.c
28+
if ! gcc $CFLAGS -c */*.c; then
29+
(echo "Code does not conform to ANSI C. Make sure not to use" \
30+
"features from later standards, including C++-style " \
31+
"// comments.";
32+
echo) >> $GITHUB_STEP_SUMMARY
33+
false
34+
fi
3135
- name: Check value types can be redefined
3236
env:
3337
CFLAGS: "-O0 -Werror -DTEST_ALTERNATE_VALUE_TYPES"
3438
run: |
35-
gcc $CFLAGS -c src/*.c
39+
if ! gcc $CFLAGS -c src/*.c; then
40+
(echo "Compile failed when key/value types were redefined to" \
41+
"something different from a void pointer. Compile with" \
42+
"-DTEST_ALTERNATE_VALUE_TYPES to see the error.";
43+
echo) >> $GITHUB_STEP_SUMMARY
44+
false
45+
fi
3646
3747
build_and_coverage:
3848
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)