1+ defaults :
2+ run :
3+ shell : bash -leo pipefail {0}
4+
5+ concurrency :
6+ group : ${{ github.head_ref }}
7+ cancel-in-progress : true
8+
19jobs :
210 test :
3- defaults :
4- run :
5- shell : bash -el {0}
611 strategy :
712 matrix :
813 os : [ubuntu-latest]
914 python : ['3.10', '3.11', '3.12']
15+ pip_opts : ['']
1016 numba_boundscheck : [0]
1117 include :
1218 - os : macos-latest
1622 - os : ubuntu-latest
1723 python : ' 3.10'
1824 numba_boundscheck : 1
25+ - os : ubuntu-latest
26+ python : ' 3.10'
27+ pip_opts : " --pre -U"
1928 fail-fast : false
2029 runs-on : ${{ matrix.os }}
2130 env :
@@ -24,63 +33,33 @@ jobs:
2433 steps :
2534 - name : Checkout Repo
2635 uses : actions/checkout@v4
27- - name : Cache conda
28- uses : actions/cache@v4
29- env :
30- # Increase this value to reset cache if ci/environment.yml has not changed
31- CACHE_NUMBER : 0
32- with :
33- path : ~/conda_pkgs_dir
34- key :
35- test-${{ matrix.os }}-conda-py${{ matrix.python }}-${{ env.CACHE_NUMBER }}-${{
36- hashFiles('ci/environment.yml') }}
37- - uses : julia-actions/setup-julia@v1
36+ - name : Set up Python
37+ uses : actions/setup-python@v5
3838 with :
39- version : ' 1.10.0'
40- - uses : conda-incubator/setup-miniconda@v3
41- with :
42- activate-environment : sparse-dev
43- allow-softlinks : true
44- environment-file : ci/environment.yml
4539 python-version : ${{ matrix.python }}
46- miniforge-version : latest
40+ cache : ' pip '
4741 - name : Install package
4842 run : |
4943 pip install -e .[tests]
44+ pip install ${{ matrix.pip_opts }} numpy numba
5045 - name : Run tests
5146 run : |
52- pytest --pyargs sparse
47+ SPARSE_BACKEND=Numba pytest --pyargs sparse --cov-report=xml:coverage_Numba.xml -n 4 -vvv
48+ SPARSE_BACKEND=Finch pytest --pyargs sparse/tests --cov-report=xml:coverage_Finch.xml -n 4 -vvv
5349 - uses : codecov/codecov-action@v4
5450 if : always()
55- - name : Publish Test Results
56- uses : EnricoMi/publish-unit-test-result-action/composite@v2
57- if : always()
5851 with :
59- files : " **/test- *.xml"
52+ files : ./ **/coverage *.xml
6053 docs :
61- defaults :
62- run :
63- shell : bash -el {0}
6454 runs-on : ubuntu-latest
6555 steps :
6656 - name : Checkout Repo
6757 uses : actions/checkout@v4
68- - name : Cache conda
69- uses : actions/cache@v4
70- env :
71- # Increase this value to reset cache if ci/environment.yml has not changed
72- CACHE_NUMBER : 0
58+ - name : Set up Python
59+ uses : actions/setup-python@v5
7360 with :
74- path : ~/conda_pkgs_dir
75- key :
76- docs-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('ci/environment.yml') }}
77- - uses : conda-incubator/setup-miniconda@v3
78- with :
79- activate-environment : sparse-dev
80- allow-softlinks : true
81- environment-file : ci/environment.yml
8261 python-version : ' 3.10'
83- miniforge-version : latest
62+ cache : ' pip '
8463 - name : Install package
8564 run : |
8665 pip install -e .[docs]
@@ -92,29 +71,15 @@ jobs:
9271 name : Documentation
9372 path : _build/html
9473 benchmarks :
95- defaults :
96- run :
97- shell : bash -el {0}
9874 runs-on : ubuntu-latest
9975 steps :
10076 - name : Checkout Repo
10177 uses : actions/checkout@v4
102- - name : Cache conda
103- uses : actions/cache@v4
104- env :
105- # Increase this value to reset cache if ci/environment.yml has not changed
106- CACHE_NUMBER : 0
107- with :
108- path : ~/conda_pkgs_dir
109- key :
110- benchmarks-${{ env.CACHE_NUMBER }}-${{ hashFiles('ci/environment.yml') }}
111- - uses : conda-incubator/setup-miniconda@v3
78+ - name : Set up Python
79+ uses : actions/setup-python@v5
11280 with :
113- activate-environment : sparse-dev
114- allow-softlinks : true
115- environment-file : ci/environment.yml
11681 python-version : ' 3.10'
117- miniforge-version : latest
82+ cache : ' pip '
11883 - name : Install asv
11984 run : |
12085 pip install asv
@@ -128,16 +93,22 @@ jobs:
12893 - name : Checkout Repo
12994 uses : actions/checkout@v4
13095 - name : Set up Python
131- uses : actions/setup-python@v5.1.0
96+ uses : actions/setup-python@v5
13297 with :
13398 python-version : ' 3.11'
99+ cache : ' pip'
134100 - name : Build and install Sparse
135101 run : |
102+ pip install -U setuptools wheel
136103 python -m pip install '.[finch]' scipy
137104 - name : Run examples
138105 run : |
139106 source ci/test_examples.sh
140107 array_api_tests :
108+ strategy :
109+ matrix :
110+ backend : ['Numba', 'Finch']
111+ fail-fast : false
141112 runs-on : ubuntu-latest
142113 steps :
143114 - name : Checkout Repo
@@ -146,26 +117,27 @@ jobs:
146117 uses : actions/checkout@v4
147118 with :
148119 repository : data-apis/array-api-tests
149- ref : ' 3cf8ef654c456d9fd1633d64e67b4470465940e9 ' # Latest commit as of 2024-04-09
120+ ref : ' 33f2d2ea2f3dd2b3ceeeb4519d55e08096184149 ' # Latest commit as of 2024-05-29
150121 submodules : ' true'
151122 path : ' array-api-tests'
152123 - name : Set up Python
153- uses : actions/setup-python@v5.1.0
124+ uses : actions/setup-python@v5
154125 with :
155126 python-version : ' 3.11'
127+ cache : ' pip'
156128 - name : Install build and test dependencies from PyPI
157129 run : |
158- python -m pip install -r array-api-tests/requirements.txt
130+ python -m pip install pytest-xdist -r array-api-tests/requirements.txt
159131 - name : Build and install Sparse
160132 run : |
161133 python -m pip install '.[finch]'
162134 - name : Run the test suite
163135 env :
164136 ARRAY_API_TESTS_MODULE : sparse
165- SPARSE_BACKEND : Finch
137+ SPARSE_BACKEND : ${{ matrix.backend }}
166138 run : |
167139 cd ${GITHUB_WORKSPACE}/array-api-tests
168- pytest array_api_tests/test_signatures.py -v -c pytest.ini --ci --max-examples=2 --derandomize --disable-deadline -o xfail_strict=True --xfails-file ${GITHUB_WORKSPACE}/ci/array-api-skips.txt
140+ pytest array_api_tests -v -c pytest.ini -n 4 --max-examples=2 --derandomize --disable-deadline -o xfail_strict=True --xfails-file ${GITHUB_WORKSPACE}/ci/${{ matrix.backend }}-array-api-xfails.txt --skips-file ${GITHUB_WORKSPACE}/ci/${{ matrix.backend }}- array-api-skips.txt
169141on :
170142 # Trigger the workflow on push or pull request,
171143 # but only for the main branch
0 commit comments