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,45 @@ 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", "3.12"]
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
133
- - 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 : ' '
121
+ dependencies : ' min'
147
122
exclude :
148
123
- os : ubuntu-latest
149
124
architecture : x86
150
125
- os : macos-latest
151
126
architecture : x86
127
+ - python-version : ' 3.12'
128
+ architecture : x86
129
+
152
130
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 }}
131
+ DEPENDS : ${{ matrix.dependencies }}
132
+ ARCH : ${{ !contains(fromJSON('["none", "min"]'), matrix.dependencies) && matrix.architecture }}
158
133
159
134
steps :
160
- - uses : actions/checkout@v3
135
+ - uses : actions/checkout@v4
161
136
with :
162
137
submodules : recursive
163
138
fetch-depth : 0
@@ -166,36 +141,54 @@ jobs:
166
141
with :
167
142
python-version : ${{ matrix.python-version }}
168
143
architecture : ${{ matrix.architecture }}
144
+ allow-prereleases : true
169
145
- name : Display Python version
170
146
run : python -c "import sys; print(sys.version)"
171
- - name : Create virtual environment
172
- run : tools/ci/create_venv.sh
173
- - name : Build archive
147
+ - name : Install tox
174
148
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
149
+ python -m pip install --upgrade pip
150
+ python -m pip install tox tox-gh-actions
151
+ - name : Show tox config
152
+ run : tox c
153
+ - name : Run tox
154
+ run : tox -v --exit-and-dump-after 1200
184
155
- uses : codecov/codecov-action@v3
185
156
if : ${{ always() }}
186
157
with :
187
158
files : cov.xml
188
159
- name : Upload pytest test results
189
- if : ${{ always() && matrix.check == 'test' }}
190
160
uses : actions/upload-artifact@v3
191
161
with :
192
162
name : pytest-results-${{ matrix.os }}-${{ matrix.python-version }}
193
- path : for_testing/test-results.xml
163
+ path : test-results.xml
164
+ if : ${{ always() }}
165
+
166
+ checks :
167
+ runs-on : ' ubuntu-latest'
168
+ continue-on-error : true
169
+ strategy :
170
+ matrix :
171
+ check : ['style', 'doctest', 'typecheck']
172
+
173
+ steps :
174
+ - uses : actions/checkout@v4
175
+ - name : Set up Python ${{ matrix.python-version }}
176
+ uses : actions/setup-python@v4
177
+ with :
178
+ python-version : 3
179
+ - name : Display Python version
180
+ run : python -c "import sys; print(sys.version)"
181
+ - name : Show tox config
182
+ run : pipx run tox c
183
+ - name : Show tox config (this call)
184
+ run : pipx run tox c -e ${{ matrix.check }}
185
+ - name : Run check
186
+ run : pipx run tox -e ${{ matrix.check }}
194
187
195
188
publish :
196
189
runs-on : ubuntu-latest
197
190
environment : " Package deployment"
198
- needs : [stable , test-package]
191
+ needs : [test , test-package]
199
192
if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
200
193
steps :
201
194
- uses : actions/download-artifact@v3
0 commit comments