Skip to content

Commit 0fead4f

Browse files
committed
Minimized resources for static-check (package dependencies) and added cppcheck version printout
Added notes about how --config-cache (-C) helps make libntech configuration faster by re-using core's results. Ticket: none Changelog: none
1 parent f081c22 commit 0fead4f

File tree

2 files changed

+20
-10
lines changed

2 files changed

+20
-10
lines changed

.github/workflows/job-static-check.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,7 @@ jobs:
3838
- name: Prepare Environment
3939
run: |
4040
sudo apt-get update && \
41-
sudo apt-get install -y dpkg-dev debhelper g++ libncurses6 pkg-config \
42-
build-essential libpam0g-dev fakeroot gcc make autoconf buildah \
43-
liblmdb-dev libacl1-dev libcurl4-openssl-dev libyaml-dev libxml2-dev \
44-
libssl-dev libpcre2-dev librsync-dev
45-
46-
- name: Run Autogen
47-
run: NO_CONFIGURE=1 PROJECT=community ./buildscripts/build-scripts/autogen
41+
sudo apt-get install -y buildah
4842
4943
- name: Run The Test
5044
working-directory: ./core

tests/static-check/run_checks.sh

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,34 @@ set -x
55
n_procs="$(getconf _NPROCESSORS_ONLN)"
66

77
function check_with_gcc() {
8+
# previous runs may have cached configuration based on a different CC
89
rm -f config.cache
910
make clean
10-
./configure -C --enable-debug CC=gcc
11+
# here --config-cache enables lots of checks in subdir libntech to re-use checks made in core
12+
./configure --config-cache --enable-debug CC=gcc
1113
local gcc_exceptions="-Wno-sign-compare -Wno-enum-int-mismatch"
1214
make -j -l${n_procs} --keep-going CFLAGS="-Werror -Wall -Wextra $gcc_exceptions"
1315
}
1416

1517
function check_with_clang() {
18+
# previous runs may have cached configuration based on a different CC
1619
rm -f config.cache
1720
make clean
18-
./configure -C --enable-debug CC=clang
21+
# here --config-cache enables lots of checks in subdir libntech to re-use checks made in core
22+
./configure --config-cache --enable-debug CC=clang
1923
make -j -l${n_procs} --keep-going CFLAGS="-Werror -Wall -Wextra -Wno-sign-compare"
2024
}
2125

2226
function check_with_cppcheck() {
27+
# previous runs may have cached configuration based on a different CC
2328
rm -f config.cache
2429
make clean
30+
# here --config-cache enables lots of checks in subdir libntech to re-use checks made in core
31+
./configure --config-cache --enable-debug
2532
make -C libpromises/ bootstrap.inc # needed by libpromises/bootstrap.c
26-
./configure -C --enable-debug
33+
34+
# print out cppcheck version for comparisons over time in case of regressions due to newer versions
35+
cppcheck --version
2736

2837
# cppcheck options:
2938
# -I -- include paths
@@ -43,6 +52,13 @@ cd "$(dirname $0)"/../../
4352

4453
failure=0
4554
failures=""
55+
56+
# in jenkins the workdir is already autogen'd
57+
# in github it is not, so do that work here
58+
if [ ! -f configure ]; then
59+
./autogen.sh --enable-debug
60+
fi
61+
4662
check_with_gcc || { failures="${failures}FAIL: GCC check failed\n"; failure=1; }
4763
check_with_clang || { failures="${failures}FAIL: Clang check failed\n"; failure=1; }
4864
check_with_cppcheck || { failures="${failures}FAIL: cppcheck failed\n"; failure=1; }

0 commit comments

Comments
 (0)