Skip to content

Run TSAN in CI (#144) #2

Run TSAN in CI (#144)

Run TSAN in CI (#144) #2

Workflow file for this run

name: Sanitizers
on:
push:
branches: [main]
paths-ignore:
- "*.md"
pull_request:
branches: ["*"]
paths-ignore:
- "*.md"
workflow_dispatch: # allows you to trigger manually
# When this workflow is queued, automatically cancel any previous running
# or pending jobs from the same branch
concurrency:
group: tsan-${{ github.ref }}
cancel-in-progress: true
jobs:
TSAN:
runs-on: ubuntu-latest
container:
image: ghcr.io/nascheme/numpy-tsan:3.14t
steps:
- name: Check out repo
uses: actions/checkout@v6
- name: Install build dependencies
run: python -m pip install -U build pip setuptools wheel cython
- name: Build wheel
run: |
# See setup.py for special handling in flame-blis modules
export CFLAGS="$CFLAGS -fsanitize=thread"
# Build without isolation to use TSAN-enabled NumPy from the container
python -m build --wheel --no-isolation
- name: Install wheel
run: python -m pip install dist/*.whl
- name: Delete source directory
run: rm -rf blis
- name: Test import
run: python -c "import blis" -Werror
- name: Install test requirements
run: python -m pip install -r requirements.txt
- name: Run pytest-run-parallel
env:
# Reference: https://github.com/google/sanitizers/wiki/ThreadSanitizerFlags
TSAN_OPTIONS: "halt_on_error=0 suppressions=tsan_suppressions.txt"
run: pytest -s --parallel-threads 4