Skip to content

Commit e91aa11

Browse files
committed
Add CI for running the array API test suite
1 parent e57b8f9 commit e91aa11

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

.github/workflows/array-api-tests.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Array API Tests
2+
3+
env:
4+
PYTEST_ARGS: "-v -rxXfE --ci"
5+
6+
jobs:
7+
tests:
8+
runs-on: ubuntu-latest
9+
strategy:
10+
matrix:
11+
python-version: ['3.8', '3.9', '3.10', '3.11']
12+
numpy-version: ['1', 'dev']
13+
exclude:
14+
- python-version: '3.8'
15+
numpy-version: 'dev'
16+
17+
steps:
18+
- name: Checkout array-api-strict
19+
uses: actions/checkout@v4
20+
with:
21+
path: array-api-strict
22+
- name: Checkout array-api-tests
23+
uses: actions/checkout@v4
24+
with:
25+
repository: data-apis/array-api-tests
26+
submodules: 'true'
27+
path: array-api-tests
28+
- name: Set up Python ${{ matrix.python-version }}
29+
uses: actions/setup-python@v5
30+
with:
31+
python-version: ${{ matrix.python-version }}
32+
- name: Install Dependencies
33+
run: |
34+
python -m pip install --upgrade pip
35+
if [[ "${{ matrix.numpy-version }}" == "dev" ]]; then
36+
python -m pip install --pre --extra-index https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy;
37+
else
38+
python -m pip install numpy<2.0;
39+
fi
40+
- name: Run the array API testsuite
41+
env:
42+
ARRAY_API_TESTS_MODULE: array_api_strict
43+
# This enables the NEP 50 type promotion behavior (without it a lot of
44+
# tests fail in numpy 1.26 on bad scalar type promotion behavior)
45+
NPY_PROMOTION_STATE: weak
46+
run: |
47+
export PYTHONPATH="${GITHUB_WORKSPACE}/array-api-compat"
48+
cd ${GITHUB_WORKSPACE}/array-api-tests
49+
pytest array_api_tests/ --xfails-file ${PYTEST_ARGS}

0 commit comments

Comments
 (0)