Skip to content

CI: parametrize over Array API modules #152

CI: parametrize over Array API modules

CI: parametrize over Array API modules #152

Workflow file for this run

name: Test Array API Strict
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11"]
array-api-module: ["array_api_strict", "array_api_compat.numpy", "array_api_compat.torch", "jax.numpy"]
fail-fast: false
steps:
- name: Checkout array-api-tests
uses: actions/checkout@v1
with:
submodules: 'true'
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [[ ${{ matrix.array-api-module }} == *"torch"* ]]
then
python -m pip install torch --index-url https://download.pytorch.org/whl/cpu
elif [[ ${{ matrix.array-api-module }} == *"jax.numpy"* ]]
then
python -m pip install "jax[cpu]"
elif [[ ${{ matrix.array-api-module }} == *"numpy"* ]]; then
python -m pip install numpy
else
python -m pip install ${{ matrix.array-api-module }}
fi
python -m pip install -r requirements.txt
python -m pip install git+https://github.com/data-apis/array-api-compat.git
- name: Run the test suite
env:
ARRAY_API_TESTS_MODULE: ${{ matrix.array-api-module }}
ARRAY_API_STRICT_API_VERSION: 2023.12
run: |
pytest -v -rxXfE --skips-file array-api-strict-skips.txt array_api_tests/
# We also have internal tests that isn't really necessary for adopters
pytest -v -rxXfE meta_tests/