Expand clang-tidy CI target to all static-checks (#2625)

Relocate cppcheck and Shellcheck into a single CI target instead of
running them as part of all distributions.  While this modestly
reduces run-time by about 20 seconds, more importantly it avoids
workarounds for older checker versions and simplifies the code.
This commit is contained in:
Andrew Gaul
2025-01-03 15:04:58 +09:00
committed by GitHub
parent cd41bddd1e
commit 3df1195ae5
2 changed files with 16 additions and 82 deletions

View File

@ -98,19 +98,6 @@ jobs:
/bin/sh -c "./configure ${CONFIGURE_OPTIONS}"
make --jobs=$(nproc)
- name: Cppcheck
run: |
# specify the version range to run cppcheck (cppcheck version number is x.y or x.y.z)
if cppcheck --version | sed -e 's/\./ /g' | awk '{if (($2 * 1000 + $3) <= 2004) { exit(1) } }'; then
make cppcheck
fi
- name: Shellcheck
run: |
if shellcheck --version | awk -F '[ .]' '/version:/ && ($2 * 1000 + $3 <= 7) { exit(1) }'; then
make shellcheck
fi
- name: Test suite
run: |
make check -C src
@ -276,7 +263,7 @@ jobs:
run: |
/bin/sh -c "ALL_TESTS=1 ASAN_OPTIONS=${ASAN_OPTIONS} TSAN_OPTIONS=${TSAN_OPTIONS} VALGRIND=${VALGRIND} RETRIES=${RETRIES} make check -C test || (test/filter-suite-log.sh test/test-suite.log; exit 1)"
clang-tidy:
static-checks:
runs-on: ubuntu-latest
container:
image: fedora:41
@ -299,6 +286,13 @@ jobs:
run: |
make clang-tidy
- name: Cppcheck
run: |
make cppcheck
- name: Shellcheck
run: |
make shellcheck
#
# Local variables: