mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2026-06-15 08:17:05 +00:00
- libzmq is not tsan-instrumented, so tsan cannot see the happens-before its queues establish between user threads and libzmq I/O threads, producing false-positive data races on message buffers - add test/thread_sanitizer_suppressions.txt and point TSAN_OPTIONS at it via the sanitizers job env so it reaches the tests and their device subprocesses - suppress: accesses made directly from libzmq, the zero-copy message deleters libzmq runs from msg_t::close, shmem receive-side metadata reads, and std::regex/locale lazy-init races in libstdc++
176 lines
4.9 KiB
YAML
176 lines
4.9 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [master, dev]
|
|
pull_request:
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build:
|
|
if: github.repository == 'FairRootGroup/FairMQ'
|
|
name: ${{ matrix.env }}-gcc-${{ matrix.gcc }}
|
|
runs-on: ubuntu-24.04
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
gcc: ['12', '13', '14', '15']
|
|
env: ['latest']
|
|
include:
|
|
- gcc: '15'
|
|
env: 'boost187'
|
|
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
submodules: true
|
|
fetch-tags: true
|
|
fetch-depth: 0
|
|
|
|
- name: Setup spack environment
|
|
uses: ./.github/actions/setup-deps
|
|
with:
|
|
gcc: ${{ matrix.gcc }}
|
|
env: ${{ matrix.env }}
|
|
|
|
- name: ccache
|
|
uses: hendrikmuhs/ccache-action@v1
|
|
with:
|
|
key: ${{ github.job }}-${{ matrix.env }}-gcc${{ matrix.gcc }}
|
|
max-size: 500M
|
|
|
|
- name: Configure and Build
|
|
uses: threeal/cmake-action@v2
|
|
with:
|
|
generator: Ninja
|
|
options: |
|
|
CMAKE_BUILD_TYPE=RelWithDebInfo
|
|
CMAKE_INSTALL_PREFIX=${{ github.workspace }}/install
|
|
BUILD_TESTING=ON
|
|
CMAKE_C_COMPILER_LAUNCHER=ccache
|
|
CMAKE_CXX_COMPILER_LAUNCHER=ccache
|
|
|
|
- name: Test
|
|
run: |
|
|
# Region/segment tests mlock() shared memory; raise the locked-memory
|
|
# limit so it does not hit RLIMIT_MEMLOCK on the runner.
|
|
sudo prlimit --pid $$ --memlock=unlimited:unlimited
|
|
ulimit -l
|
|
ctest --test-dir build --output-on-failure --no-tests=error
|
|
|
|
- name: Install
|
|
run: cmake --install build
|
|
|
|
sanitizers:
|
|
if: github.repository == 'FairRootGroup/FairMQ'
|
|
name: ${{ matrix.sanitizer.name }}
|
|
runs-on: ubuntu-24.04
|
|
env:
|
|
TSAN_OPTIONS: suppressions=${{ github.workspace }}/test/thread_sanitizer_suppressions.txt
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
sanitizer:
|
|
- name: asan+lsan+ubsan
|
|
options: |
|
|
ENABLE_SANITIZER_ADDRESS=ON
|
|
ENABLE_SANITIZER_LEAK=ON
|
|
ENABLE_SANITIZER_UNDEFINED_BEHAVIOUR=ON
|
|
cxx-flags: -O1 -fno-omit-frame-pointer
|
|
- name: tsan
|
|
options: ENABLE_SANITIZER_THREAD=ON
|
|
cxx-compiler: clang++
|
|
cxx-flags: -fuse-ld=lld
|
|
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
submodules: true
|
|
fetch-tags: true
|
|
fetch-depth: 0
|
|
|
|
- name: Setup spack environment
|
|
uses: ./.github/actions/setup-deps
|
|
with:
|
|
gcc: '14'
|
|
|
|
- name: ccache
|
|
uses: hendrikmuhs/ccache-action@v1
|
|
with:
|
|
key: ${{ github.job }}-${{ matrix.sanitizer.name }}
|
|
max-size: 500M
|
|
|
|
- name: Install lld
|
|
if: matrix.sanitizer.name == 'tsan'
|
|
run: sudo apt-get update && sudo apt-get install -y lld
|
|
|
|
- name: Configure and Build
|
|
uses: threeal/cmake-action@v2
|
|
with:
|
|
generator: Ninja
|
|
cxx-compiler: ${{ matrix.sanitizer.cxx-compiler }}
|
|
cxx-flags: ${{ matrix.sanitizer.cxx-flags }}
|
|
options: |
|
|
CMAKE_BUILD_TYPE=Debug
|
|
BUILD_TESTING=ON
|
|
CMAKE_C_COMPILER_LAUNCHER=ccache
|
|
CMAKE_CXX_COMPILER_LAUNCHER=ccache
|
|
${{ matrix.sanitizer.options }}
|
|
|
|
- name: Test
|
|
run: |
|
|
# Region/segment tests mlock() shared memory; raise the locked-memory
|
|
# limit so it does not hit RLIMIT_MEMLOCK on the runner.
|
|
sudo prlimit --pid $$ --memlock=unlimited:unlimited
|
|
ulimit -l
|
|
ctest --test-dir build --output-on-failure --no-tests=error
|
|
|
|
static-analysis:
|
|
if: github.repository == 'FairRootGroup/FairMQ'
|
|
name: static-analysis
|
|
runs-on: ubuntu-24.04
|
|
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
submodules: true
|
|
fetch-tags: true
|
|
fetch-depth: 0
|
|
|
|
- name: Setup spack environment
|
|
uses: ./.github/actions/setup-deps
|
|
with:
|
|
gcc: '14'
|
|
|
|
- name: ccache
|
|
uses: hendrikmuhs/ccache-action@v1
|
|
with:
|
|
key: ${{ github.job }}
|
|
max-size: 500M
|
|
|
|
- name: Configure
|
|
run: |
|
|
cmake -S . -B build -G Ninja \
|
|
-DCMAKE_BUILD_TYPE=Debug \
|
|
-DBUILD_TESTING=ON \
|
|
-DRUN_STATIC_ANALYSIS=ON \
|
|
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
|
|
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
|
|
|
|
- name: Build
|
|
run: |
|
|
set -o pipefail
|
|
cmake --build build 2>&1 | tee build.log
|
|
|
|
- name: Check for warnings
|
|
run: |
|
|
test -f build.log || { echo "::error::build.log was not produced"; exit 1; }
|
|
if grep -q "warning:" build.log; then
|
|
echo "::error::Static analysis found warnings"
|
|
grep "warning:" build.log
|
|
exit 1
|
|
fi
|