diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e924209e..65148a00 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -93,17 +93,14 @@ jobs: matrix: backend: ['Numba', 'Finch'] fail-fast: false + env: + ARRAY_API_TESTS_DIR: ${{ github.workspace }}/array-api-tests runs-on: ubuntu-latest steps: - name: Checkout Repo uses: actions/checkout@v4 - name: Checkout array-api-tests - uses: actions/checkout@v4 - with: - repository: data-apis/array-api-tests - ref: '33f2d2ea2f3dd2b3ceeeb4519d55e08096184149' # Latest commit as of 2024-05-29 - submodules: 'true' - path: 'array-api-tests' + run: ci/clone_array_api_tests.sh - name: Set up Python uses: actions/setup-python@v5 with: @@ -111,7 +108,7 @@ jobs: cache: 'pip' - name: Install build and test dependencies from PyPI run: | - pip install pytest-xdist -r array-api-tests/requirements.txt + pip install pytest-xdist -r ../array-api-tests/requirements.txt - name: Build and install Sparse run: | pip install '.[finch]' diff --git a/ci/clone_array_api_tests.sh b/ci/clone_array_api_tests.sh old mode 100644 new mode 100755 index 0b305752..ad58fa17 --- a/ci/clone_array_api_tests.sh +++ b/ci/clone_array_api_tests.sh @@ -1,8 +1,9 @@ #!/usr/bin/env bash set -euxo pipefail -if [ ! -d "../array-api-tests" ]; then - git clone https://github.com/data-apis/array-api-tests.git "../array-api-tests" +ARRAY_API_TESTS_DIR=${ARRAY_API_TESTS_DIR:-"../array-api-tests"} +if [ ! -d "$ARRAY_API_TESTS_DIR" ]; then + git clone --recursive https://github.com/data-apis/array-api-tests.git "$ARRAY_API_TESTS_DIR" fi -git --git-dir="../array-api-tests/.git" fetch -git --git-dir="../array-api-tests/.git" checkout $(cat "ci/array-api-tests-rev.txt") +git --git-dir="$ARRAY_API_TESTS_DIR/.git" fetch +git --git-dir="$ARRAY_API_TESTS_DIR/.git" checkout $(cat "ci/array-api-tests-rev.txt") diff --git a/ci/setup_env.sh b/ci/setup_env.sh old mode 100644 new mode 100755 diff --git a/ci/test_array_api.sh b/ci/test_array_api.sh index b0b56f2f..d5872aa8 100755 --- a/ci/test_array_api.sh +++ b/ci/test_array_api.sh @@ -6,4 +6,4 @@ source ci/clone_array_api_tests.sh if [ "${SPARSE_BACKEND}" = "Finch" ]; then python -c 'import finch' fi -ARRAY_API_TESTS_MODULE="sparse" pytest ../array-api-tests/array_api_tests/ -v -c ../array-api-tests/pytest.ini --ci --max-examples=2 --derandomize --disable-deadline -o xfail_strict=True -n auto --xfails-file ../sparse/ci/${SPARSE_BACKEND}-array-api-xfails.txt --skips-file ../sparse/ci/${SPARSE_BACKEND}-array-api-skips.txt +ARRAY_API_TESTS_MODULE="sparse" pytest $ARRAY_API_TESTS_DIR/array_api_tests/ -v -c $ARRAY_API_TESTS_DIR/pytest.ini --ci --max-examples=2 --derandomize --disable-deadline -o xfail_strict=True -n auto --xfails-file ../sparse/ci/${SPARSE_BACKEND}-array-api-xfails.txt --skips-file ../sparse/ci/${SPARSE_BACKEND}-array-api-skips.txt