1
- name : Stable tests
1
+ name : Build and test
2
2
3
3
# This file tests the claimed support range of NiBabel including
4
4
#
35
35
build :
36
36
runs-on : ubuntu-latest
37
37
steps :
38
- - uses : actions/checkout@v3
38
+ - uses : actions/checkout@v4
39
39
with :
40
40
fetch-depth : 0
41
41
- uses : actions/setup-python@v4
@@ -94,70 +94,49 @@ jobs:
94
94
if : matrix.package == 'archive'
95
95
run : pip install archive/nibabel-archive.tgz
96
96
- run : python -c 'import nibabel; print(nibabel.__version__)'
97
- - name : Install test extras
97
+ - name : Install minimum test dependencies
98
98
run : pip install nibabel[test]
99
99
- name : Run tests
100
- run : pytest --doctest-modules --doctest-plus -v --pyargs nibabel
100
+ run : pytest --doctest-modules --doctest-plus -v --pyargs nibabel -n auto
101
101
102
- stable :
102
+ test :
103
103
# Check each OS, all supported Python, minimum versions and latest releases
104
104
runs-on : ${{ matrix.os }}
105
+ continue-on-error : ${{ matrix.dependencies == 'pre' }}
105
106
strategy :
107
+ fail-fast : false
106
108
matrix :
107
109
os : ['ubuntu-latest', 'windows-latest', 'macos-latest']
108
- python-version : [3.8, 3.9, "3.10", "3.11"]
110
+ python-version : [" 3.8", " 3.9" , "3.10", "3.11", "3.12 "]
109
111
architecture : ['x64', 'x86']
110
- install : ['pip']
111
- check : ['test']
112
- pip-flags : ['']
113
- depends : ['REQUIREMENTS']
114
- optional-depends : ['DEFAULT_OPT_DEPENDS']
112
+ dependencies : ['full', 'pre']
115
113
include :
116
114
# Basic dependencies only
117
115
- os : ubuntu-latest
118
116
python-version : 3.8
119
- install : pip
120
- check : test
121
- pip-flags : ' '
122
- depends : REQUIREMENTS
123
- optional-depends : ' '
117
+ dependencies : ' none'
124
118
# Absolute minimum dependencies
125
119
- os : ubuntu-latest
126
120
python-version : 3.8
127
- install : pip
128
- check : test
129
- pip-flags : ' '
130
- depends : MIN_REQUIREMENTS
131
- optional-depends : ' '
132
- # Absolute minimum dependencies plus old MPL, Pydicom, Pillow
121
+ dependencies : ' min'
122
+ # NumPy 2.0
133
123
- os : ubuntu-latest
134
- python-version : 3.8
135
- install : pip
136
- check : test
137
- pip-flags : ' '
138
- depends : MIN_REQUIREMENTS
139
- optional-depends : MIN_OPT_DEPENDS
140
- # Clean install imports only with package-declared dependencies
141
- - os : ubuntu-latest
142
- python-version : 3.8
143
- install : pip
144
- check : skiptests
145
- pip-flags : ' '
146
- depends : ' '
124
+ python-version : ' 3.12'
125
+ dependencies : ' dev'
147
126
exclude :
148
127
- os : ubuntu-latest
149
128
architecture : x86
150
129
- os : macos-latest
151
130
architecture : x86
131
+ - python-version : ' 3.12'
132
+ architecture : x86
133
+
152
134
env :
153
- DEPENDS : ${{ matrix.depends }}
154
- OPTIONAL_DEPENDS : ${{ matrix.optional-depends }}
155
- INSTALL_TYPE : ${{ matrix.install }}
156
- CHECK_TYPE : ${{ matrix.check }}
157
- EXTRA_PIP_FLAGS : ${{ matrix.pip-flags }}
135
+ DEPENDS : ${{ matrix.dependencies }}
136
+ ARCH : ${{ !contains(fromJSON('["none", "min"]'), matrix.dependencies) && matrix.architecture }}
158
137
159
138
steps :
160
- - uses : actions/checkout@v3
139
+ - uses : actions/checkout@v4
161
140
with :
162
141
submodules : recursive
163
142
fetch-depth : 0
@@ -166,36 +145,54 @@ jobs:
166
145
with :
167
146
python-version : ${{ matrix.python-version }}
168
147
architecture : ${{ matrix.architecture }}
148
+ allow-prereleases : true
169
149
- name : Display Python version
170
150
run : python -c "import sys; print(sys.version)"
171
- - name : Create virtual environment
172
- run : tools/ci/create_venv.sh
173
- - name : Build archive
151
+ - name : Install tox
174
152
run : |
175
- source tools/ci/build_archive.sh
176
- echo "ARCHIVE=$ARCHIVE" >> $GITHUB_ENV
177
- - name : Install dependencies
178
- run : tools/ci/install_dependencies.sh
179
- - name : Install NiBabel
180
- run : tools/ci/install.sh
181
- - name : Run tests
182
- if : ${{ matrix.check != 'skiptests' }}
183
- run : tools/ci/check.sh
153
+ python -m pip install --upgrade pip
154
+ python -m pip install tox tox-gh-actions
155
+ - name : Show tox config
156
+ run : tox c
157
+ - name : Run tox
158
+ run : tox -v --exit-and-dump-after 1200
184
159
- uses : codecov/codecov-action@v3
185
160
if : ${{ always() }}
186
161
with :
187
162
files : cov.xml
188
163
- name : Upload pytest test results
189
- if : ${{ always() && matrix.check == 'test' }}
190
164
uses : actions/upload-artifact@v3
191
165
with :
192
166
name : pytest-results-${{ matrix.os }}-${{ matrix.python-version }}
193
- path : for_testing/test-results.xml
167
+ path : test-results.xml
168
+ if : ${{ always() }}
169
+
170
+ checks :
171
+ runs-on : ' ubuntu-latest'
172
+ continue-on-error : true
173
+ strategy :
174
+ matrix :
175
+ check : ['style', 'doctest', 'typecheck']
176
+
177
+ steps :
178
+ - uses : actions/checkout@v4
179
+ - name : Set up Python ${{ matrix.python-version }}
180
+ uses : actions/setup-python@v4
181
+ with :
182
+ python-version : 3
183
+ - name : Display Python version
184
+ run : python -c "import sys; print(sys.version)"
185
+ - name : Show tox config
186
+ run : pipx run tox c
187
+ - name : Show tox config (this call)
188
+ run : pipx run tox c -e ${{ matrix.check }}
189
+ - name : Run check
190
+ run : pipx run tox -e ${{ matrix.check }}
194
191
195
192
publish :
196
193
runs-on : ubuntu-latest
197
194
environment : " Package deployment"
198
- needs : [stable , test-package]
195
+ needs : [test , test-package]
199
196
if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
200
197
steps :
201
198
- uses : actions/download-artifact@v3
0 commit comments