aboutsummaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorJohn Levon <john.levon@nutanix.com>2022-05-12 16:53:05 +0100
committerGitHub <noreply@github.com>2022-05-12 16:53:05 +0100
commitffdd1d68d9a8975f20d73637e4ff39bb64d00efb (patch)
treedea91978d255e8f640fb94a980fa69701c0cdfc2 /.github
parent294aa666fe09a8b6ca133201c7593c54d3cab6e8 (diff)
downloadlibvfio-user-ffdd1d68d9a8975f20d73637e4ff39bb64d00efb.zip
libvfio-user-ffdd1d68d9a8975f20d73637e4ff39bb64d00efb.tar.gz
libvfio-user-ffdd1d68d9a8975f20d73637e4ff39bb64d00efb.tar.bz2
run scan-build in CI (#680)
Yet another static analyzer pass, this one is used by SPDK, and as it did detect some minor issues, it's worth running. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
Diffstat (limited to '.github')
-rwxr-xr-x.github/workflows/pull_request.sh18
-rw-r--r--.github/workflows/pull_request.yml19
2 files changed, 23 insertions, 14 deletions
diff --git a/.github/workflows/pull_request.sh b/.github/workflows/pull_request.sh
index 20b8ace..b972bda 100755
--- a/.github/workflows/pull_request.sh
+++ b/.github/workflows/pull_request.sh
@@ -1,5 +1,7 @@
#!/bin/sh
+# NB: we can't use "meson compile -v", as centos 7 doesn't support that option.
+
set -e
set -v
@@ -8,23 +10,29 @@ test -z "$BUILD" && BUILD=build
rm -rf $BUILD
# ASAN build with clang
-CC=clang meson $BUILD/asan -Db_sanitize=address -Db_lundef=false
+CC=clang meson setup $BUILD/asan -Db_sanitize=address -Db_lundef=false
ninja -C $BUILD/asan -v
meson test -C $BUILD/asan --suite style --print-errorlogs
meson test -C $BUILD/asan --no-suite style --print-errorlogs
+# analyzer build
+meson setup $BUILD/scan-build -Dtran-pipe=true
+# no "meson scan-build" for some reason
+ninja -C $BUILD/scan-build -v scan-build -v
+meson test -C $BUILD/scan-build --no-suite style --print-errorlogs
+
# debug build with clang
-CC=clang meson build/clang-debug -Dtran-pipe=true
+CC=clang meson setup build/clang-debug -Dtran-pipe=true
ninja -C $BUILD/clang-debug -v
meson test -C $BUILD/clang-debug --no-suite style --print-errorlogs
# release build with clang
-CC=clang meson build/clang-release -Dtran-pipe=true -Dbuildtype=release
+CC=clang meson setup build/clang-release -Dtran-pipe=true -Dbuildtype=release
ninja -C $BUILD/clang-release -v
meson test -C $BUILD/clang-release --no-suite style --print-errorlogs
# debug build with gcc
-CC=gcc meson build/gcc-debug -Dtran-pipe=true
+CC=gcc meson setup build/gcc-debug -Dtran-pipe=true
ninja -C $BUILD/gcc-debug -v
meson test -C $BUILD/gcc-debug --no-suite style --print-errorlogs
@@ -34,6 +42,6 @@ meson test -C $BUILD/gcc-debug --suite pyunit --setup pyvalgrind --print-errorlo
DESTDIR=tmp.install meson install -C $BUILD/gcc-debug
# release build with gcc
-CC=gcc meson build/gcc-release -Dtran-pipe=true -Dbuildtype=release
+CC=gcc meson setup build/gcc-release -Dtran-pipe=true -Dbuildtype=release
ninja -C $BUILD/gcc-release -v
meson test -C $BUILD/gcc-release --no-suite style --print-errorlogs
diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml
index e905dd5..2b3b910 100644
--- a/.github/workflows/pull_request.yml
+++ b/.github/workflows/pull_request.yml
@@ -9,9 +9,9 @@ jobs:
- name: pre-push
run: |
sudo apt-get update
- sudo apt-get -y install libjson-c-dev libcmocka-dev clang valgrind \
- python3-pytest debianutils flake8 meson \
- ninja-build
+ sudo apt-get -y install libjson-c-dev libcmocka-dev clang \
+ clang-tools valgrind python3-pytest debianutils flake8 meson \
+ ninja-build
./.github/workflows/pull_request.sh
ubuntu-22:
timeout-minutes: 10
@@ -21,9 +21,9 @@ jobs:
- name: pre-push
run: |
sudo apt-get update
- sudo apt-get -y install libjson-c-dev libcmocka-dev clang valgrind \
- python3-pytest debianutils flake8 meson \
- ninja-build
+ sudo apt-get -y install libjson-c-dev libcmocka-dev clang \
+ clang-tools valgrind python3-pytest debianutils flake8 meson \
+ ninja-build
./.github/workflows/pull_request.sh
centos-7:
timeout-minutes: 10
@@ -35,7 +35,7 @@ jobs:
run: |
# NB: no working flake8
yum -y install make gcc-4.8.5 epel-release pciutils
- yum -y install clang json-c-devel libcmocka-devel \
+ yum -y install clang clang-analyzer json-c-devel libcmocka-devel \
valgrind python36-pytest which ninja-build meson
./.github/workflows/pull_request.sh
fedora-35:
@@ -47,6 +47,7 @@ jobs:
- name: pre-push
run: |
dnf -y install --releasever=35 \
- gcc make clang json-c-devel libcmocka-devel pciutils diffutils \
- valgrind python3-pytest python3-flake8 which meson ninja-build
+ gcc make clang clang-analyzer json-c-devel libcmocka-devel pciutils \
+ diffutils valgrind python3-pytest python3-flake8 which \
+ meson ninja-build
./.github/workflows/pull_request.sh