8000 Merge pull request #24208 from ngoldbaum/add-asan-ci · numpy/numpy@d9d1789 · GitHub
[go: up one dir, main page]

Skip to content

Commit d9d1789

Browse files
authored
Merge pull request #24208 from ngoldbaum/add-asan-ci
CI: Add a sanitizer CI job
2 parents 3d8cfd6 + 6395203 commit d9d1789

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Test with compiler sanitizers (Linux)
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
- maintenance/**
8+
9+
defaults:
10+
run:
11+
shell: bash
12+
13+
env:
14+
PYTHON_VERSION: 3.11
15+
16+
concurrency:
17+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
18+
cancel-in-progress: true
19+
20+
permissions:
21+
contents: read # to fetch code (actions/checkout)
22+
23+
jobs:
24+
gcc_sanitizers:
25+
if: "github.repository == 'numpy/numpy'"
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
29+
with:
30+
submodules: recursive
31+
fetch-depth: 0
32+
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
33+
with:
34+
python-version: ${{ env.PYTHON_VERSION }}
35+
- name: Install dependencies
36+
run: |
37+
pip install -r build_requirements.txt
38+
sudo apt-get install -y libopenblas-serial-dev
39+
- name: Build
40+
shell: 'script -q -e -c "bash --noprofile --norc -eo pipefail {0}"'
41+
env:
42+
TERM: xterm-256color
43+
run:
44+
spin build -- --werror -Db_sanitize=address,undefined
45+
- name: Test
46+
shell: 'script -q -e -c "bash --noprofile --norc -eo pipefail {0}"'
47+
env:
48+
TERM: xterm-256color
49+
run: |
50+
pip install pytest pytest-xdist hypothesis typing_extensions
51+
ASAN_OPTIONS=detect_leaks=0:symbolize=1:strict_init_order=true:allocator_may_return_null=1:halt_on_error=1 \
52+
LD_PRELOAD=$(gcc --print-file-name=libasan.so) \
53+
python -m spin test -- -v -s
54+
55+

0 commit comments

Comments
 (0)
0