diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index ba0ccfa682..6ba181eb48 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -86,6 +86,34 @@ jobs: - uses: ./.github/actions/build-windows - uses: ./.github/actions/test-windows + array_api_tests: + name: Array API Tests + if: github.repository == 'ml-explore/mlx' + needs: check_lint + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v6 + - uses: ./.github/actions/setup-linux + - uses: ./.github/actions/build-linux + - name: Checkout array-api-tests + uses: actions/checkout@v6 + with: + repository: data-apis/array-api-tests + ref: '41379d15d26d67a1e66c840e775d41a8a7fb1516' # v2026.02.26 + submodules: 'true' + path: 'array-api-tests' + persist-credentials: false + - name: Install dependencies + run: | + python -m pip install pytest-xdist -r array-api-tests/requirements.txt + - name: Run the test suite + env: + ARRAY_API_TESTS_MODULE: mlx.core + PYTHONWARNINGS: 'ignore::UserWarning::,ignore::DeprecationWarning::,ignore::RuntimeWarning::' + run: | + cd ${GITHUB_WORKSPACE}/array-api-tests + pytest array_api_tests -v -c pytest.ini -n 2 --max-examples=1000 --derandomize --disable-deadline + build_documentation: name: Build Documentation if: github.repository == 'ml-explore/mlx'