From 54ca474dba5c58fd21db91865bceb7e1e298e8a5 Mon Sep 17 00:00:00 2001 From: Tyler Veness Date: Sun, 19 Sep 2021 20:03:40 -0700 Subject: [PATCH] [ci] Enable asan and tsan in CI for tests that pass (#3591) ctest's -E flag skips tests that match a regular expression. --- .github/workflows/cmake.yml | 4 ++-- .github/workflows/sanitizers.yml | 22 ++++++++++++++-------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index b64bc9d535..4d36c91a8d 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -36,10 +36,10 @@ jobs: run: mkdir build && cd build && cmake ${{ matrix.flags }} .. - name: build working-directory: build - run: make -j3 + run: cmake --build . -j$(nproc) - name: test working-directory: build - run: make test + run: ctest --output-on-failure build-vcpkg: name: "Build - Windows" diff --git a/.github/workflows/sanitizers.yml b/.github/workflows/sanitizers.yml index 3655f75255..8c0e516c3f 100644 --- a/.github/workflows/sanitizers.yml +++ b/.github/workflows/sanitizers.yml @@ -8,12 +8,18 @@ jobs: fail-fast: false matrix: include: - #- name: asan - # flags: "-DCMAKE_BUILD_TYPE=Asan" - #- name: tsan - # flags: "-DCMAKE_BUILD_TYPE=Tsan" + - name: asan + cmake-flags: "-DCMAKE_BUILD_TYPE=Asan" + ctest-env: "" + ctest-flags: "-E 'wpiutil|ntcore|wpilibc'" + - name: tsan + cmake-flags: "-DCMAKE_BUILD_TYPE=Tsan" + ctest-env: "TSAN_OPTIONS=second_deadlock_stack=1" + ctest-flags: "-E 'ntcore|cscore|cameraserver|wpilibc|wpilibNewCommands'" - name: ubsan - flags: "-DCMAKE_BUILD_TYPE=Ubsan" + cmake-flags: "-DCMAKE_BUILD_TYPE=Ubsan" + ctest-env: "" + ctest-flags: "" name: "${{ matrix.name }}" runs-on: ubuntu-latest container: wpilib/roborio-cross-ubuntu:2022-20.04 @@ -34,10 +40,10 @@ jobs: - name: Install jinja run: python -m pip install jinja2 - name: configure - run: mkdir build && cd build && cmake ${{ matrix.flags }} .. + run: mkdir build && cd build && cmake ${{ matrix.cmake-flags }} .. - name: build working-directory: build - run: make -j3 + run: cmake --build . -j$(nproc) - name: test working-directory: build - run: ctest --output-on-failure + run: ${{ matrix.ctest-env }} ctest --output-on-failure ${{ matrix.ctest-flags }}