Sanitizers - Looped #4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Check code with looped compilers' sanitizers | |
# This build lasts 6 hours. | |
name: Sanitizers - Looped | |
# This job is run every Saturday at 01:00 UTC or on demand. | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 1 * * 6' # every Saturday at 01:00 UTC | |
env: | |
BUILD_DIR : "${{github.workspace}}/build" | |
INSTL_DIR : "${{github.workspace}}/install-dir" | |
permissions: | |
contents: read | |
jobs: | |
ubuntu-build: | |
name: Ubuntu | |
strategy: | |
fail-fast: false | |
matrix: | |
compiler: [{c: gcc, cxx: g++}, {c: clang, cxx: clang++}, {c: icx, cxx: icpx}] | |
# TSAN is mutually exclusive with other sanitizers | |
sanitizers: [{asan: ON, ubsan: ON, tsan: OFF}, {asan: OFF, ubsan: OFF, tsan: ON}] | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
fetch-depth: 0 | |
- name: Install apt packages | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y clang cmake libhwloc-dev libnuma-dev libtbb-dev | |
- name: Install oneAPI basekit | |
if: matrix.compiler.cxx == 'icpx' | |
run: | | |
sudo apt-get install -y gpg-agent wget | |
wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null | |
echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list | |
sudo apt-get update | |
sudo apt-get install -y intel-oneapi-ippcp-devel intel-oneapi-ipp-devel intel-oneapi-common-oneapi-vars intel-oneapi-compiler-dpcpp-cpp | |
- name: Configure build | |
run: > | |
${{ matrix.compiler.cxx == 'icpx' && '. /opt/intel/oneapi/setvars.sh &&' || ''}} | |
cmake | |
-B ${{env.BUILD_DIR}} | |
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}" | |
-DCMAKE_BUILD_TYPE=Debug | |
-DUMF_BUILD_SHARED_LIBRARY=OFF | |
-DCMAKE_C_COMPILER=${{matrix.compiler.c}} | |
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}} | |
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=ON | |
-DUMF_BUILD_CUDA_PROVIDER=ON | |
-DUMF_FORMAT_CODE_STYLE=OFF | |
-DUMF_DEVELOPER_MODE=ON | |
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON | |
-DUMF_USE_ASAN=${{matrix.sanitizers.asan}} | |
-DUMF_USE_UBSAN=${{matrix.sanitizers.ubsan}} | |
-DUMF_USE_TSAN=${{matrix.sanitizers.tsan}} | |
-DUMF_BUILD_EXAMPLES=ON | |
-DUMF_TESTS_FAIL_ON_SKIP=ON | |
- name: Build UMF | |
run: | | |
${{ matrix.compiler.cxx == 'icpx' && '. /opt/intel/oneapi/setvars.sh' || true }} | |
cmake --build ${{env.BUILD_DIR}} -j $(nproc) | |
- name: Run tests | |
working-directory: ${{env.BUILD_DIR}} | |
env: | |
ASAN_OPTIONS: allocator_may_return_null=1 | |
TSAN_OPTIONS: allocator_may_return_null=1 | |
run: while ctest --output-on-failure; do date; done && exit 1 |