From 87bff82581d4147ce8053bce19124a841a7642a5 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Tue, 17 Dec 2024 15:58:21 -0500 Subject: [PATCH] Output error messages to the github summary file This will show these messages in the Github Actions summary page to make them more visible. --- .github/workflows/make.yml | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/.github/workflows/make.yml b/.github/workflows/make.yml index 82b48ed..bcb7487 100644 --- a/.github/workflows/make.yml +++ b/.github/workflows/make.yml @@ -16,23 +16,32 @@ jobs: run: | clang-format -i */*.[ch] if git diff | grep ""; then - echo - echo "*** Formatting errors detected by clang-format." - echo "*** Please apply the above diff or run:" - echo " clang-format -i */*.[ch]" - echo + (echo "Formatting errors detected by clang-format."; + echo "Please run `make format`."; + echo) >> $GITHUB_STEP_SUMMARY false fi - name: Check C89 compliance env: CFLAGS: "-O0 -Werror -std=c89 -pedantic -Isrc" run: | - gcc $CFLAGS -c */*.c + if ! gcc $CFLAGS -c */*.c; then + (echo "Code should be ANSI C. Make sure you are not using features"; + echo "from later standards, including C++-style // comments."; + echo) >> $GITHUB_STEP_SUMMARY + false + fi - name: Check value types can be redefined env: CFLAGS: "-O0 -Werror -DTEST_ALTERNATE_VALUE_TYPES" run: | - gcc $CFLAGS -c src/*.c + if ! gcc $CFLAGS -c src/*.c + (echo "Key/value types cannot be redefined to something other than a" + echo "void pointer. Compile with -DTEST_ALTERNATE_VALUE_TYPES to see" + echo "the compile error." + echo) >> $GITHUB_STEP_SUMMARY + false + fi build_and_coverage: runs-on: ubuntu-latest