1
+ defaults :
2
+ run :
3
+ shell : bash -leo pipefail {0}
4
+
5
+ concurrency :
6
+ group : ${{ github.head_ref }}
7
+ cancel-in-progress : true
8
+
1
9
jobs :
2
10
test :
3
- defaults :
4
- run :
5
- shell : bash -el {0}
6
11
strategy :
7
12
matrix :
8
13
os : [ubuntu-latest]
9
14
python : ['3.10', '3.11', '3.12']
15
+ pip_opts : ['']
10
16
numba_boundscheck : [0]
11
17
include :
12
18
- os : macos-latest
16
22
- os : ubuntu-latest
17
23
python : ' 3.10'
18
24
numba_boundscheck : 1
25
+ - os : ubuntu-latest
26
+ python : ' 3.10'
27
+ pip_opts : " --pre -U"
19
28
fail-fast : false
20
29
runs-on : ${{ matrix.os }}
21
30
env :
@@ -24,63 +33,33 @@ jobs:
24
33
steps :
25
34
- name : Checkout Repo
26
35
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
38
38
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
45
39
python-version : ${{ matrix.python }}
46
- miniforge-version : latest
40
+ cache : ' pip '
47
41
- name : Install package
48
42
run : |
49
43
pip install -e .[tests]
44
+ pip install ${{ matrix.pip_opts }} numpy numba
50
45
- name : Run tests
51
46
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
53
49
- uses : codecov/codecov-action@v4
54
50
if : always()
55
- - name : Publish Test Results
56
- uses : EnricoMi/publish-unit-test-result-action/composite@v2
57
- if : always()
58
51
with :
59
- files : " **/test- *.xml"
52
+ files : ./ **/coverage *.xml
60
53
docs :
61
- defaults :
62
- run :
63
- shell : bash -el {0}
64
54
runs-on : ubuntu-latest
65
55
steps :
66
56
- name : Checkout Repo
67
57
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
73
60
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
82
61
python-version : ' 3.10'
83
- miniforge-version : latest
62
+ cache : ' pip '
84
63
- name : Install package
85
64
run : |
86
65
pip install -e .[docs]
@@ -92,29 +71,15 @@ jobs:
92
71
name : Documentation
93
72
path : _build/html
94
73
benchmarks :
95
- defaults :
96
- run :
97
- shell : bash -el {0}
98
74
runs-on : ubuntu-latest
99
75
steps :
100
76
- name : Checkout Repo
101
77
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
112
80
with :
113
- activate-environment : sparse-dev
114
- allow-softlinks : true
115
- environment-file : ci/environment.yml
116
81
python-version : ' 3.10'
117
- miniforge-version : latest
82
+ cache : ' pip '
118
83
- name : Install asv
119
84
run : |
120
85
pip install asv
@@ -128,16 +93,22 @@ jobs:
128
93
- name : Checkout Repo
129
94
uses : actions/checkout@v4
130
95
- name : Set up Python
131
- uses : actions/setup-python@v5.1.0
96
+ uses : actions/setup-python@v5
132
97
with :
133
98
python-version : ' 3.11'
99
+ cache : ' pip'
134
100
- name : Build and install Sparse
135
101
run : |
102
+ pip install -U setuptools wheel
136
103
python -m pip install '.[finch]' scipy
137
104
- name : Run examples
138
105
run : |
139
106
source ci/test_examples.sh
140
107
array_api_tests :
108
+ strategy :
109
+ matrix :
110
+ backend : ['Numba', 'Finch']
111
+ fail-fast : false
141
112
runs-on : ubuntu-latest
142
113
steps :
143
114
- name : Checkout Repo
@@ -146,26 +117,27 @@ jobs:
146
117
uses : actions/checkout@v4
147
118
with :
148
119
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
150
121
submodules : ' true'
151
122
path : ' array-api-tests'
152
123
- name : Set up Python
153
- uses : actions/setup-python@v5.1.0
124
+ uses : actions/setup-python@v5
154
125
with :
155
126
python-version : ' 3.11'
127
+ cache : ' pip'
156
128
- name : Install build and test dependencies from PyPI
157
129
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
159
131
- name : Build and install Sparse
160
132
run : |
161
133
python -m pip install '.[finch]'
162
134
- name : Run the test suite
163
135
env :
164
136
ARRAY_API_TESTS_MODULE : sparse
165
- SPARSE_BACKEND : Finch
137
+ SPARSE_BACKEND : ${{ matrix.backend }}
166
138
run : |
167
139
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
169
141
on :
170
142
# Trigger the workflow on push or pull request,
171
143
# but only for the main branch
0 commit comments