Array API Tests #225
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Array API Tests | |
on: [push, pull_request] | |
env: | |
PYTEST_ARGS: "-v -rxXfE --ci --hypothesis-disable-deadline --max-examples 200" | |
API_VERSIONS: "2022.12 2023.12" | |
jobs: | |
array-api-tests: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ['3.9', '3.10', '3.11', '3.12'] | |
numpy-version: ['1.26', 'dev'] | |
exclude: | |
- python-version: '3.8' | |
numpy-version: 'dev' | |
steps: | |
- name: Checkout array-api-strict | |
uses: actions/checkout@v4 | |
with: | |
path: array-api-strict | |
- name: Checkout array-api-tests | |
uses: actions/checkout@v4 | |
with: | |
repository: data-apis/array-api-tests | |
submodules: 'true' | |
path: array-api-tests | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Dependencies | |
run: | | |
python -m pip install --upgrade pip | |
if [[ "${{ matrix.numpy-version }}" == "dev" ]]; then | |
python -m pip install --pre --extra-index https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy; | |
else | |
python -m pip install 'numpy>=1.26,<2.0'; | |
fi | |
python -m pip install ${GITHUB_WORKSPACE}/array-api-strict | |
python -m pip install -r ${GITHUB_WORKSPACE}/array-api-tests/requirements.txt | |
python -m pip install hypothesis | |
- name: Run the array API testsuite | |
env: | |
ARRAY_API_TESTS_MODULE: array_api_strict | |
run: | | |
# Parameterizing this in the CI matrix is wasteful. Just do a loop here. | |
for ARRAY_API_STRICT_API_VERSION in ${API_VERSIONS}; do | |
export ARRAY_API_STRICT_API_VERSION | |
cd ${GITHUB_WORKSPACE}/array-api-tests | |
pytest array_api_tests/ --skips-file ${GITHUB_WORKSPACE}/array-api-strict/array-api-tests-xfails.txt ${PYTEST_ARGS} | |
done |