6969 python -m pip install --upgrade pip
7070 pip install meson ninja meson-python
7171
72- - name : Install package in development mode
73- run : pip install -e ".[dev]"
72+ - name : Install package in development mode (strict warnings)
73+ run : pip install -e ".[dev]" --config-settings=setup-args="-Dstrict=true"
7474
7575 - name : Run tests with coverage
7676 run : |
@@ -118,14 +118,51 @@ jobs:
118118 python -m pip install --upgrade pip
119119 pip install meson ninja meson-python
120120
121- - name : Install package in development mode
122- run : pip install -e ".[dev]"
121+ - name : Install package in development mode (strict warnings)
122+ run : pip install -e ".[dev]" --config-settings=setup-args="-Dstrict=true"
123123
124124 - name : Run tests
125125 run : |
126126 python -X faulthandler -m pytest tests/test_profiler.py -v --tb=short
127127 timeout-minutes : 5
128128
129+ # =============================================================================
130+ # Memory safety testing with sanitizers (Linux only)
131+ # =============================================================================
132+ sanitizers :
133+ runs-on : ubuntu-latest
134+ steps :
135+ - uses : actions/checkout@v4
136+
137+ - name : Set up Python 3.12
138+ uses : actions/setup-python@v5
139+ with :
140+ python-version : " 3.12"
141+
142+ - name : Install system dependencies
143+ run : |
144+ sudo apt-get update
145+ sudo apt-get install -y libasan8 libubsan1
146+
147+ - name : Install build tools
148+ run : |
149+ python -m pip install --upgrade pip
150+ pip install meson ninja meson-python pytest pytest-timeout
151+
152+ - name : Build with ASAN+UBSAN and strict warnings
153+ run : |
154+ meson setup builddir --buildtype=debug -Dsanitize=address,undefined -Dstrict=true
155+ meson compile -C builddir
156+
157+ - name : Run tests with sanitizers
158+ env :
159+ PYTHONPATH : ${{ github.workspace }}/builddir/src/spprof:${{ github.workspace }}/src
160+ ASAN_OPTIONS : detect_leaks=1:abort_on_error=1:symbolize=1:halt_on_error=1
161+ UBSAN_OPTIONS : print_stacktrace=1:halt_on_error=1
162+ run : |
163+ python -m pytest tests/ -v --tb=short -x
164+ timeout-minutes : 10
165+
129166 # =============================================================================
130167 # Benchmarks
131168 # =============================================================================
@@ -144,8 +181,8 @@ jobs:
144181 python -m pip install --upgrade pip
145182 pip install meson ninja meson-python
146183
147- - name : Install package in development mode
148- run : pip install -e ".[dev]"
184+ - name : Install package in development mode (strict warnings)
185+ run : pip install -e ".[dev]" --config-settings=setup-args="-Dstrict=true"
149186
150187 - name : Run benchmarks
151188 run : |
0 commit comments