From c5b442210cfe260b5ada69064e70a91a61a16087 Mon Sep 17 00:00:00 2001 From: Don Cross Date: Sat, 6 Jul 2024 12:51:24 -0400 Subject: [PATCH] GitHub Actions: another attempt to resolve test failures on macos-latest. --- .github/workflows/astronomy-engine-tests.yml | 2 +- generate/commit_hook | 2 +- generate/run | 6 +++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/astronomy-engine-tests.yml b/.github/workflows/astronomy-engine-tests.yml index 953d5763..b9226f43 100644 --- a/.github/workflows/astronomy-engine-tests.yml +++ b/.github/workflows/astronomy-engine-tests.yml @@ -40,7 +40,7 @@ jobs: - name: Test Astronomy Engine Unix if: startsWith(matrix.os, 'windows') == false - run: generate/commit_hook + run: generate/commit_hook ${{runner.os}} - name: Test Astronomy Engine Windows if: startsWith(matrix.os, 'windows') diff --git a/generate/commit_hook b/generate/commit_hook index 9361a299..5ec17549 100755 --- a/generate/commit_hook +++ b/generate/commit_hook @@ -1,7 +1,7 @@ #/bin/bash [[ -d generate ]] && cd generate rm -f output/vsop*.txt output/*.eph output/jupiter_moons.txt -./run || exit $? +OS_NAME=$1 ./run || exit $? ./verify_clean || exit $? echo "commit_hook: SUCCESS" exit 0 diff --git a/generate/run b/generate/run index d96f9456..bb0d8d8d 100755 --- a/generate/run +++ b/generate/run @@ -82,7 +82,11 @@ cd generate || Fail "Cannot change back to generate directory." echo "" echo "Building C source code for 'generate' program." -cppcheck -I . -I novas -I vsop -I top2013 --error-exitcode=9 --enable=all --check-level=exhaustive --suppress=variableScope --suppress=unusedStructMember --suppress=missingIncludeSystem --suppress=unusedFunction generate.c earth.c astro_vector.c chebyshev.c codegen.c ephfile.c vsop/vsop.c top2013/top2013.c || exit 1 +CPPCHECK_OPTIONS=-I . -I novas -I vsop -I top2013 --error-exitcode=9 --enable=all --suppress=variableScope --suppress=unusedStructMember --suppress=missingIncludeSystem --suppress=unusedFunction +if [[ "${OS_NAME}" == "macos-latest" ]]; then + CPPCHECK_OPTIONS += --check-level=exhaustive +fi +cppcheck ${CPPCHECK_OPTIONS} generate.c earth.c astro_vector.c chebyshev.c codegen.c ephfile.c vsop/vsop.c top2013/top2013.c || exit 1 ./build || Fail "Could not build 'generate' program from source." mkdir -pv output temp apsides || Fail "Error creating directories."