-
Notifications
You must be signed in to change notification settings - Fork 0
121 lines (99 loc) · 3.06 KB
/
test.yml
File metadata and controls
121 lines (99 loc) · 3.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
name: Test
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
workflow_call:
inputs:
run_asan:
description: "Run ASAN job"
type: boolean
default: false
concurrency:
group: test-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Test (Ubuntu)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install system deps
run: |
sudo apt-get update
sudo apt-get install -y libopenblas-dev meson ninja-build
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Install Python package
run: uv pip install --system ".[test]"
- name: Run tests
run: pytest tests/python/ -v -n auto --reruns 2 --only-rerun "worker .* crashed"
test-macos:
name: Test (macOS)
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Install deps and package
run: |
uv pip install --system scipy-openblas32 meson ninja
mkdir -p /tmp/openblas
python -c "import scipy_openblas32 as sc; open('/tmp/openblas/openblas.pc','w').write(sc.get_pkg_config())"
PKG_CONFIG_PATH=/tmp/openblas uv pip install --system ".[test]"
- name: Run quick test
run: pytest tests/python/test_ab01md.py -v
asan:
name: Full Test (ASAN)
if: >-
github.event_name == 'pull_request' ||
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'workflow_call' && inputs.run_asan)
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/devcontainers/cpp:ubuntu
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install system dependencies
run: |
apt-get update
apt-get install -y \
libblas-dev \
liblapack-dev \
gfortran \
ninja-build \
python3-dev
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Setup venv
run: |
uv venv venv
. venv/bin/activate
uv pip install ".[test]"
- name: Build with sanitizers
run: |
. venv/bin/activate
meson setup build -Db_sanitize=address,undefined -Db_lundef=false --buildtype=debug
meson compile -C build
uv pip install . --reinstall --no-deps
- name: Run tests
run: |
. venv/bin/activate
export LD_PRELOAD=$(gcc -print-file-name=libasan.so)
pytest tests/python/ -v -n auto --reruns 2 --only-rerun "worker .* crashed"
env:
ASAN_OPTIONS: detect_leaks=0:symbolize=1:abort_on_error=1:verify_asan_link_order=0
UBSAN_OPTIONS: print_stacktrace=1:halt_on_error=1