Skip to content

Commit 86b8d7c

Browse files
[CI] Move sanitizers checks to a separate workflow
and enable them for ICX compiler.
1 parent fc4ff23 commit 86b8d7c

File tree

3 files changed

+158
-66
lines changed

3 files changed

+158
-66
lines changed

.github/workflows/basic.yml

Lines changed: 1 addition & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ permissions:
1212

1313
jobs:
1414
icx-build:
15+
# TODO: we could merge ICX build with gcc/clang (using our dockers) Issue: #259
1516
name: Intel C++ Compiler
1617
strategy:
1718
matrix:
@@ -20,7 +21,6 @@ jobs:
2021
pool_tracking: ['ON', 'OFF']
2122
shared_library: ['OFF']
2223
os_provider: ['ON']
23-
sanitizers: [{asan: OFF, ubsan: OFF, tsan: OFF}]
2424
runs-on: ubuntu-22.04
2525
container:
2626
image: intel/oneapi:latest
@@ -53,9 +53,6 @@ jobs:
5353
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
5454
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
5555
-DUMF_BUILD_LIBUMF_POOL_SCALABLE=ON
56-
-DUSE_ASAN=${{matrix.sanitizers.asan}}
57-
-DUSE_UBSAN=${{matrix.sanitizers.ubsan}}
58-
-DUSE_TSAN=${{matrix.sanitizers.tsan}}
5956
-DUMF_BUILD_EXAMPLES=ON
6057
6158
- name: Build UMF
@@ -88,7 +85,6 @@ jobs:
8885
pool_tracking: ['ON', 'OFF']
8986
shared_library: ['OFF']
9087
os_provider: ['ON']
91-
sanitizers: [{asan: OFF, ubsan: OFF, tsan: OFF}]
9288
include:
9389
- os: 'ubuntu-20.04'
9490
build_type: Release
@@ -122,36 +118,6 @@ jobs:
122118
compiler: {c: gcc, cxx: g++}
123119
shared_library: 'OFF'
124120
os_provider: 'OFF'
125-
# TODO: Move jobs with sanitizer checks to a separate workflow file.
126-
- os: 'ubuntu-22.04'
127-
build_type: Debug
128-
compiler: {c: clang, cxx: clang++}
129-
pool_tracking: 'ON'
130-
shared_library: 'OFF'
131-
os_provider: 'ON'
132-
# TSAN is mutually exclusive with other sanitizers
133-
sanitizers: {asan: ON, ubsan: ON, tsan: OFF}
134-
- os: 'ubuntu-22.04'
135-
build_type: Debug
136-
compiler: {c: clang, cxx: clang++}
137-
pool_tracking: 'ON'
138-
shared_library: 'OFF'
139-
os_provider: 'ON'
140-
sanitizers: {asan: OFF, ubsan: OFF, tsan: ON}
141-
- os: 'ubuntu-22.04'
142-
build_type: Debug
143-
compiler: {c: gcc, cxx: g++}
144-
pool_tracking: 'ON'
145-
shared_library: 'OFF'
146-
os_provider: 'ON'
147-
sanitizers: {asan: ON, ubsan: ON, tsan: OFF}
148-
- os: 'ubuntu-22.04'
149-
build_type: Debug
150-
compiler: {c: gcc, cxx: g++}
151-
pool_tracking: 'ON'
152-
shared_library: 'OFF'
153-
os_provider: 'ON'
154-
sanitizers: {asan: OFF, ubsan: OFF, tsan: ON}
155121
runs-on: ${{matrix.os}}
156122

157123
steps:
@@ -183,9 +149,6 @@ jobs:
183149
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
184150
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
185151
-DUMF_BUILD_LIBUMF_POOL_SCALABLE=ON
186-
-DUSE_ASAN=${{matrix.sanitizers.asan}}
187-
-DUSE_UBSAN=${{matrix.sanitizers.ubsan}}
188-
-DUSE_TSAN=${{matrix.sanitizers.tsan}}
189152
190153
- name: Build UMF
191154
run: cmake --build ${{env.BUILD_DIR}} -j $(nproc)
@@ -218,7 +181,6 @@ jobs:
218181
compiler: [{c: cl, cxx: cl}]
219182
pool_tracking: ['ON', 'OFF']
220183
shared_library: ['OFF']
221-
sanitizers: [{asan: OFF}]
222184
os_provider: ['ON']
223185
include:
224186
- os: 'windows-2022'
@@ -239,39 +201,13 @@ jobs:
239201
pool_tracking: 'ON'
240202
shared_library: 'ON'
241203
os_provider: 'OFF'
242-
- os: 'windows-2022'
243-
build_type: Debug
244-
compiler: {c: cl, cxx: cl}
245-
pool_tracking: 'OFF'
246-
shared_library: 'OFF'
247-
os_provider: 'ON'
248-
sanitizers: {asan: ON}
249-
- os: 'windows-2022'
250-
build_type: Debug
251-
compiler: {c: clang-cl, cxx: clang-cl}
252-
pool_tracking: 'OFF'
253-
shared_library: 'OFF'
254-
os_provider: 'ON'
255-
sanitizers: {asan: ON}
256204

257205
runs-on: ${{matrix.os}}
258206

259207
steps:
260208
- name: Checkout
261209
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
262210

263-
# Use '14.38.33130' MSVC toolset when compiling UMF with ASan.
264-
# Running binaries compiled with older toolsets results in a
265-
# 'STATUS_DLL_INIT_FAILED' error despite being linked with ASan from
266-
# the same toolset as the compiler being used.
267-
# https://github.com/actions/runner-images/issues/8891
268-
- name: Setup MSVC dev command prompt
269-
if: matrix.os == 'windows-2022' && matrix.sanitizers.asan == 'ON'
270-
uses: TheMrMilchmann/setup-msvc-dev@48edcef51a12c80d7e62ace57aae1417795e511c # v3.0.0
271-
with:
272-
arch: x64
273-
toolset: 14.38.33130
274-
275211
- name: Configure build
276212
run: >
277213
cmake
@@ -284,7 +220,6 @@ jobs:
284220
-DUMF_FORMAT_CODE_STYLE=OFF
285221
-DUMF_DEVELOPER_MODE=ON
286222
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
287-
-DUSE_ASAN=${{matrix.sanitizers.asan}}
288223
-DUMF_BUILD_OS_MEMORY_PROVIDER=${{matrix.os_provider}}
289224
290225
- name: Build UMF

.github/workflows/pr_push.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ jobs:
8989
name: Basic builds
9090
needs: [Spellcheck, FastBuild, CodeStyle]
9191
uses: ./.github/workflows/basic.yml
92+
Sanitizers:
93+
needs: [Spellcheck, FastBuild, CodeStyle]
94+
uses: ./.github/workflows/sanitizers.yml
9295
Benchmarks:
9396
needs: [Build]
9497
uses: ./.github/workflows/benchmarks.yml

.github/workflows/sanitizers.yml

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
# Check code with compilers' sanitizers
2+
name: Sanitizers
3+
4+
on: workflow_call
5+
6+
env:
7+
BUILD_DIR : "${{github.workspace}}/build/"
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
icx-build:
14+
# TODO: we could merge ICX build with gcc/clang (using our dockers) Issue: #259
15+
name: Intel C++ Compiler on Ubuntu
16+
strategy:
17+
matrix:
18+
compiler: [{c: icx, cxx: icpx}]
19+
# TSAN is mutually exclusive with other sanitizers
20+
sanitizers: [{asan: ON, ubsan: ON, tsan: OFF}, {asan: OFF, ubsan: OFF, tsan: ON}]
21+
runs-on: ubuntu-22.04
22+
container:
23+
image: intel/oneapi:latest
24+
volumes:
25+
- ${{github.workspace}}:${{github.workspace}}
26+
options: "--privileged"
27+
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
31+
32+
- name: Install apt packages
33+
run: |
34+
apt-get update
35+
apt-get install -y cmake libnuma-dev libjemalloc-dev libtbb-dev libhwloc-dev
36+
37+
- name: Configure build
38+
run: >
39+
cmake
40+
-B ${{env.BUILD_DIR}}
41+
-DCMAKE_BUILD_TYPE=Debug
42+
-DUMF_BUILD_SHARED_LIBRARY=OFF
43+
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
44+
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
45+
-DUMF_BUILD_OS_MEMORY_PROVIDER=ON
46+
-DUMF_ENABLE_POOL_TRACKING=ON
47+
-DUMF_FORMAT_CODE_STYLE=OFF
48+
-DUMF_DEVELOPER_MODE=ON
49+
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
50+
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
51+
-DUMF_BUILD_LIBUMF_POOL_SCALABLE=ON
52+
-DUSE_ASAN=${{matrix.sanitizers.asan}}
53+
-DUSE_UBSAN=${{matrix.sanitizers.ubsan}}
54+
-DUSE_TSAN=${{matrix.sanitizers.tsan}}
55+
-DUMF_BUILD_EXAMPLES=ON
56+
57+
- name: Build UMF
58+
run: cmake --build ${{env.BUILD_DIR}} -j $(nproc)
59+
60+
- name: Run tests
61+
working-directory: ${{env.BUILD_DIR}}
62+
run: ctest --output-on-failure
63+
64+
ubuntu-build:
65+
name: gcc and clang on Ubuntu
66+
strategy:
67+
matrix:
68+
compiler: [{c: gcc, cxx: g++}, {c: clang, cxx: clang++}]
69+
# TSAN is mutually exclusive with other sanitizers
70+
sanitizers: [{asan: ON, ubsan: ON, tsan: OFF}, {asan: OFF, ubsan: OFF, tsan: ON}]
71+
runs-on: ubuntu-22.04
72+
73+
steps:
74+
- name: Checkout
75+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
76+
77+
- name: Install apt packages
78+
run: |
79+
sudo apt-get update
80+
sudo apt-get install -y clang cmake libhwloc-dev libnuma-dev libjemalloc-dev libtbb-dev
81+
82+
- name: Configure build
83+
run: >
84+
cmake
85+
-B ${{env.BUILD_DIR}}
86+
-DCMAKE_BUILD_TYPE=Debug
87+
-DUMF_BUILD_SHARED_LIBRARY=OFF
88+
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
89+
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
90+
-DUMF_BUILD_OS_MEMORY_PROVIDER=ON
91+
-DUMF_ENABLE_POOL_TRACKING=ON
92+
-DUMF_FORMAT_CODE_STYLE=OFF
93+
-DUMF_DEVELOPER_MODE=ON
94+
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
95+
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
96+
-DUMF_BUILD_LIBUMF_POOL_SCALABLE=ON
97+
-DUSE_ASAN=${{matrix.sanitizers.asan}}
98+
-DUSE_UBSAN=${{matrix.sanitizers.ubsan}}
99+
-DUSE_TSAN=${{matrix.sanitizers.tsan}}
100+
-DUMF_BUILD_EXAMPLES=ON
101+
102+
- name: Build UMF
103+
run: cmake --build ${{env.BUILD_DIR}} -j $(nproc)
104+
105+
- name: Run tests
106+
working-directory: ${{env.BUILD_DIR}}
107+
run: ctest --output-on-failure
108+
109+
windows-build:
110+
name: cl and clang-cl on Windows
111+
strategy:
112+
matrix:
113+
compiler: [{c: cl, cxx: cl}, {c: clang-cl, cxx: clang-cl}]
114+
# Only ASAN is supported
115+
sanitizers: [{asan: ON}]
116+
runs-on: windows-2022
117+
118+
steps:
119+
- name: Checkout
120+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
121+
122+
# Use '14.38.33130' MSVC toolset when compiling UMF with ASan.
123+
# Running binaries compiled with older toolsets results in a
124+
# 'STATUS_DLL_INIT_FAILED' error despite being linked with ASan from
125+
# the same toolset as the compiler being used.
126+
# https://github.com/actions/runner-images/issues/8891
127+
- name: Setup MSVC dev command prompt
128+
if: matrix.sanitizers.asan == 'ON'
129+
uses: TheMrMilchmann/setup-msvc-dev@48edcef51a12c80d7e62ace57aae1417795e511c # v3.0.0
130+
with:
131+
arch: x64
132+
toolset: 14.38.33130
133+
134+
- name: Configure build
135+
run: >
136+
cmake
137+
-B ${{env.BUILD_DIR}}
138+
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
139+
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
140+
-DUMF_BUILD_SHARED_LIBRARY=OFF
141+
-DUMF_ENABLE_POOL_TRACKING=OFF
142+
-DUMF_FORMAT_CODE_STYLE=OFF
143+
-DUMF_DEVELOPER_MODE=ON
144+
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
145+
-DUSE_ASAN=${{matrix.sanitizers.asan}}
146+
-DUMF_BUILD_OS_MEMORY_PROVIDER=ON
147+
-DUMF_BUILD_EXAMPLES=ON
148+
149+
- name: Build UMF
150+
run: cmake --build ${{env.BUILD_DIR}} --config Debug -j $Env:NUMBER_OF_PROCESSORS
151+
152+
- name: Run tests
153+
working-directory: ${{env.BUILD_DIR}}
154+
run: ctest -C Debug --output-on-failure

0 commit comments

Comments
 (0)