Skip to content

Commit 6c7dac4

Browse files
committed
CI: move ASAN job to MacOS, drop UBSAN
1 parent cc5851e commit 6c7dac4

2 files changed

Lines changed: 79 additions & 59 deletions

File tree

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Test with compiler sanitizers (Linux)
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
- maintenance/**
11+
12+
defaults:
13+
run:
14+
shell: bash
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+
# prefer newer versions of sanitizers than what Apple ships
24+
env:
25+
CC: /opt/homebrew/llvm/bin/clang-19
26+
CXX: /opt/homebrew/opt/llvm/bin/clang++-19
27+
LDFLAGS: -L/opt/homebrew/opt/llvm/lib
28+
CPPFLAGS: -I/opt/homebrew/opt/llvm/include
29+
30+
31+
jobs:
32+
clang_ASAN:
33+
# To enable this workflow on a fork, comment out:
34+
# if: github.repository == 'numpy/numpy'
35+
runs-on: macos-latest
36+
steps:
37+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
38+
with:
39+
submodules: recursive
40+
fetch-tags: true
41+
persist-credentials: false
42+
- name: Set up pyenv
43+
run: |
44+
git clone https://github.com/pyenv/pyenv.git "$HOME/.pyenv"
45+
# main as of Feb 3 2025
46+
pushd "$HOME/.pyenv"
47+
git checkout 823dd3cef9d53621a5bdbf68f83713e1b15bfc80
48+
popd
49+
PYENV_ROOT="$HOME/.pyenv"
50+
PYENV_BIN="$PYENV_ROOT/bin"
51+
echo "$PYENV_BIN" >> $GITHUB_PATH
52+
echo "PYENV_ROOT=$PYENV_ROOT" >> $GITHUB_ENV
53+
- name: Check pyenv is working
54+
run:
55+
pyenv --version
56+
- name: Build Python with address sanitizer support and install dependencies
57+
run: |
58+
brew update
59+
brew install llvm@19
60+
CONFIGURE_OPTS="--with-address-sanitizer" pyenv install 3.13-dev
61+
pyenv global 3.13-dev
62+
pip install -r requirements/build_requirements.txt
63+
pip install -r requirements/ci_requirements.txt
64+
pip install -r requirements/test_requirements.txt
65+
- name: Build
66+
shell: 'script -q -e -c "bash --noprofile --norc -eo pipefail {0}"'
67+
env:
68+
TERM: xterm-256color
69+
PKG_CONFIG_PATH: ${{ github.workspace }}/.openblas
70+
run:
71+
spin build --with-scipy-openblas=32 -- -Db_sanitize=address
72+
- name: Test
73+
shell: 'script -q -e -c "bash --noprofile --norc -eo pipefail {0}"'
74+
env:
75+
TERM: xterm-256color
76+
run: |
77+
ASAN_OPTIONS=detect_leaks=0:symbolize=1:strict_init_order=true:allocator_may_return_null=1:halt_on_error=1 \
78+
# pass -s to see ASAN errors and warnings, otherwise pytest captures them
79+
python -m spin test -- -v -s --timeout=600 --durations=10

.github/workflows/linux_compiler_sanitizers.yml

Lines changed: 0 additions & 59 deletions
This file was deleted.

0 commit comments

Comments
 (0)