diff mbox series

[ovs-dev,1/2] ci: Combine the ubsan and asan sanitizer runs.

Message ID 170324349398.1849544.4081330990925589901.stgit@ebuild
State Rejected
Headers show
Series [ovs-dev,1/2] ci: Combine the ubsan and asan sanitizer runs. | expand

Commit Message

Eelco Chaudron Dec. 22, 2023, 11:11 a.m. UTC
This patch combines the existing ubsan and asan GitHub actions
tests into one.

Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
---
 .ci/linux-build.sh                   |    4 ++--
 .github/workflows/build-and-test.yml |    8 ++------
 2 files changed, 4 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh
index 90581c10b..c780dac01 100755
--- a/.ci/linux-build.sh
+++ b/.ci/linux-build.sh
@@ -102,14 +102,14 @@  else
     CFLAGS_FOR_OVS="${CFLAGS_FOR_OVS} ${SPARSE_FLAGS}"
 fi
 
-if [ "$ASAN" ]; then
+if [[ $SANITIZERS == *asan* ]]; then
     # This will override default option configured in tests/atlocal.in.
     export ASAN_OPTIONS='detect_leaks=1'
     CFLAGS_ASAN="-fno-omit-frame-pointer -fno-common -fsanitize=address"
     CFLAGS_FOR_OVS="${CFLAGS_FOR_OVS} ${CFLAGS_ASAN}"
 fi
 
-if [ "$UBSAN" ]; then
+if [[ $SANITIZERS == *ubsan* ]]; then
     # Use the default options configured in tests/atlocal.in, in UBSAN_OPTIONS.
     CFLAGS_UBSAN="-fno-omit-frame-pointer -fno-common -fsanitize=undefined"
     CFLAGS_FOR_OVS="${CFLAGS_FOR_OVS} ${CFLAGS_UBSAN}"
diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml
index 710757693..b901e6d57 100644
--- a/.github/workflows/build-and-test.yml
+++ b/.github/workflows/build-and-test.yml
@@ -78,14 +78,13 @@  jobs:
         automake libtool gcc bc libjemalloc2 libjemalloc-dev libssl-dev \
         llvm-dev libnuma-dev libpcap-dev selinux-policy-dev libbpf-dev \
         lftp libreswan
-      ASAN:        ${{ matrix.asan }}
-      UBSAN:       ${{ matrix.ubsan }}
       CC:          ${{ matrix.compiler }}
       DPDK:        ${{ matrix.dpdk }}
       DPDK_SHARED: ${{ matrix.dpdk_shared }}
       LIBS:        ${{ matrix.libs }}
       M32:         ${{ matrix.m32 }}
       OPTS:        ${{ matrix.opts }}
+      SANITIZERS:  ${{ matrix.sanitizers }}
       STD:         ${{ matrix.std }}
       TESTSUITE:   ${{ matrix.testsuite }}
       TEST_RANGE:  ${{ matrix.test_range }}
@@ -111,11 +110,8 @@  jobs:
           - compiler:     gcc
             testsuite:    test
           - compiler:     clang
+            sanitizers:   asan ubsan
             testsuite:    test
-            asan:         asan
-          - compiler:     clang
-            testsuite:    test
-            ubsan:        ubsan
 
           - compiler:     gcc
             testsuite:    test