Skip to content

Commit 4a93eeb

Browse files
authored
Merge pull request #1322 from ldorau/CI_add_nightly_CI_job_with_looped_sanitizers
CI: add nightly CI job with looped sanitizers
2 parents 8cd1941 + db5bf43 commit 4a93eeb

File tree

1 file changed

+80
-0
lines changed

1 file changed

+80
-0
lines changed
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Check code with looped compilers' sanitizers
2+
# This build lasts 6 hours.
3+
name: Sanitizers - Looped
4+
5+
# This job is run every Saturday at 01:00 UTC or on demand.
6+
on:
7+
workflow_dispatch:
8+
schedule:
9+
- cron: '0 1 * * 6' # every Saturday at 01:00 UTC
10+
11+
env:
12+
BUILD_DIR : "${{github.workspace}}/build"
13+
INSTL_DIR : "${{github.workspace}}/install-dir"
14+
15+
permissions:
16+
contents: read
17+
18+
jobs:
19+
ubuntu-build:
20+
name: Ubuntu
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
compiler: [{c: gcc, cxx: g++}, {c: clang, cxx: clang++}, {c: icx, cxx: icpx}]
25+
# TSAN is mutually exclusive with other sanitizers
26+
sanitizers: [{asan: ON, ubsan: ON, tsan: OFF}, {asan: OFF, ubsan: OFF, tsan: ON}]
27+
runs-on: ubuntu-22.04
28+
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
32+
with:
33+
fetch-depth: 0
34+
35+
- name: Install apt packages
36+
run: |
37+
sudo apt-get update
38+
sudo apt-get install -y clang cmake libhwloc-dev libnuma-dev libtbb-dev
39+
40+
- name: Install oneAPI basekit
41+
if: matrix.compiler.cxx == 'icpx'
42+
run: |
43+
sudo apt-get install -y gpg-agent wget
44+
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
45+
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
46+
sudo apt-get update
47+
sudo apt-get install -y intel-oneapi-ippcp-devel intel-oneapi-ipp-devel intel-oneapi-common-oneapi-vars intel-oneapi-compiler-dpcpp-cpp
48+
49+
- name: Configure build
50+
run: >
51+
${{ matrix.compiler.cxx == 'icpx' && '. /opt/intel/oneapi/setvars.sh &&' || ''}}
52+
cmake
53+
-B ${{env.BUILD_DIR}}
54+
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}"
55+
-DCMAKE_BUILD_TYPE=Debug
56+
-DUMF_BUILD_SHARED_LIBRARY=OFF
57+
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
58+
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
59+
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=ON
60+
-DUMF_BUILD_CUDA_PROVIDER=ON
61+
-DUMF_FORMAT_CODE_STYLE=OFF
62+
-DUMF_DEVELOPER_MODE=ON
63+
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
64+
-DUMF_USE_ASAN=${{matrix.sanitizers.asan}}
65+
-DUMF_USE_UBSAN=${{matrix.sanitizers.ubsan}}
66+
-DUMF_USE_TSAN=${{matrix.sanitizers.tsan}}
67+
-DUMF_BUILD_EXAMPLES=ON
68+
-DUMF_TESTS_FAIL_ON_SKIP=ON
69+
70+
- name: Build UMF
71+
run: |
72+
${{ matrix.compiler.cxx == 'icpx' && '. /opt/intel/oneapi/setvars.sh' || true }}
73+
cmake --build ${{env.BUILD_DIR}} -j $(nproc)
74+
75+
- name: Run tests
76+
working-directory: ${{env.BUILD_DIR}}
77+
env:
78+
ASAN_OPTIONS: allocator_may_return_null=1
79+
TSAN_OPTIONS: allocator_may_return_null=1
80+
run: while ctest --output-on-failure; do date; done && exit 1

0 commit comments

Comments
 (0)