-
Notifications
You must be signed in to change notification settings - Fork 7
230 lines (198 loc) · 8.05 KB
/
tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
name: Integration tests
on:
workflow_dispatch:
schedule:
- cron: '10 0 * * *'
push:
branches:
- '*'
pull_request:
branches:
- '*'
jobs:
integration_test:
name: rs_${{ matrix.RSIO_VERSION }}-hs_${{ matrix.HYPERSPY_VERSION }}-ext_${{ matrix.EXTENSION_VERSION }}${{ matrix.LABEL }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
HYPERSPY_VERSION: ['release', 'RnPatch', 'RnMinor']
# When RostteSciIO is released, extent build matrix with released version
RSIO_VERSION: ['release']
EXTENSION_VERSION: ['release', 'dev']
DEPENDENCIES_DEV: [false]
DEPENDENCIES_PRE_RELEASE: [false]
DEPENDENCIES_NUMBA_DEV: [false]
USE_MAMBA: [true]
include:
# test against upstream dev
- DEPENDENCIES_DEV: true
# Install dev version from https://anaconda.org/scientific-python-nightly-wheels/
LABEL: -dependencies_dev
HYPERSPY_VERSION: 'RnMinor'
RSIO_VERSION: 'dev'
EXTENSION_VERSION: 'dev'
# numba dev version is installed separately from numba/label/dev channel
# others are installed as wheels from
# https://anaconda.org/scientific-python-nightly-wheels/
# see https://scientific-python.org/specs/spec-0004/
DEPENDENCIES: matplotlib scipy scikit-image scikit-learn
USE_MAMBA: false
- DEPENDENCIES_PRE_RELEASE: true
# Install RC version available on pypi
LABEL: -dependencies_pre_release
HYPERSPY_VERSION: 'RnMinor'
RSIO_VERSION: 'dev'
EXTENSION_VERSION: 'dev'
DEPENDENCIES: matplotlib scipy scikit-learn sympy h5py scikit-image numba
USE_MAMBA: false
- DEPENDENCIES_NUMBA_DEV: true
# Install dev version from numba/label/dev channel using mamba
LABEL: -dependencies_numba_dev
HYPERSPY_VERSION: 'RnMinor'
RSIO_VERSION: 'dev'
EXTENSION_VERSION: 'dev'
DEPENDENCIES: numba
USE_MAMBA: true
env:
EXTENSION: hyperspy-gui-ipywidgets hyperspy-gui-traitsui kikuchipy lumispy pyxem exspy holospy etspy
TEST_DEPS: pytest pytest-xdist pytest-rerunfailures pytest-mpl filelock
PYTHON_VERSION: '3.12'
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: latest
python-version: ${{ env.PYTHON_VERSION }}
# use base environment, so that when using pip, this is from the
# miniforge distribution
# auto-activate-base: true
activate-environment: "test"
- name: Install pip, pyqt and Test dependencies
run: |
# astra-toolbox from pypi.org only works with gpu
# ffmpeg is a missing dependencies from etspy, see https://github.com/usnistgov/etspy/issues/25
mamba install pip pyqt astra-toolbox ffmpeg ${{ env.TEST_DEPS }}
- name: Install dask 2024.11.2
run: |
# remove when tests failure with dask >=2024.12.0 are sorted
# https://github.com/hyperspy/rosettasciio/issues/345
mamba install dask-core=2024.8.0
- name: Conda info
run: |
conda info
conda list
- name: Install numba development version
if: ${{ matrix.DEPENDENCIES_NUMBA_DEV }}
run: |
# Install numba dev version
mamba install -c numba/label/dev ${{ matrix.DEPENDENCIES }}
- name: Install dependencies development version
if: ${{ matrix.DEPENDENCIES_DEV }}
run: |
pip install --upgrade --pre --extra-index-url \
https://pypi.anaconda.org/scientific-python-nightly-wheels/simple \
${{ matrix.DEPENDENCIES }}
- name: Install dependencies pre release version
if: ${{ matrix.DEPENDENCIES_PRE_RELEASE }}
run: |
pip install --upgrade --pre ${{ matrix.DEPENDENCIES }}
- name: Conda list
run: |
conda list
- name: Install RosettaSciIO release
if: contains(matrix.RSIO_VERSION, 'release')
run: |
mamba install rosettasciio
- name: Install RosettaSciIO dev
if: contains(matrix.RSIO_VERSION, 'dev')
run: |
pip install "rosettasciio[all] @ git+https://github.com/hyperspy/rosettasciio.git"
- name: Install HyperSpy release
if: contains(matrix.HYPERSPY_VERSION, 'release')
run: |
mamba install hyperspy-base
- name: Install HyperSpy RnPatch
if: contains(matrix.HYPERSPY_VERSION, 'RnPatch')
run: |
pip install "hyperspy[all] @ git+https://github.com/hyperspy/hyperspy.git@RELEASE_next_patch"
- name: Install HyperSpy RnMinor
if: contains(matrix.HYPERSPY_VERSION, 'RnMinor')
run: |
pip install "hyperspy[all] @ git+https://github.com/hyperspy/hyperspy.git@RELEASE_next_minor"
- name: Install HyperSpy RnMajor
if: contains(matrix.HYPERSPY_VERSION, 'RnMajor')
run: |
pip install "hyperspy[all] @ git+https://github.com/hyperspy/hyperspy.git@RELEASE_next_major"
- name: Install Extension Release
if: contains(matrix.EXTENSION_VERSION, 'release')
run: |
mamba install ${{ env.EXTENSION }}
- name: Install Extension Dev
if: contains(matrix.EXTENSION_VERSION, 'dev')
run: |
pip install git+https://github.com/hyperspy/exspy.git
pip install git+https://github.com/hyperspy/holospy.git
pip install git+https://github.com/lumispy/lumispy.git
pip install git+https://github.com/pyxem/kikuchipy.git
pip install git+https://github.com/pyxem/pyxem.git
pip install git+https://github.com/hyperspy/hyperspy_gui_ipywidgets.git
pip install git+https://github.com/hyperspy/hyperspy_gui_traitsui.git
pip install git+https://github.com/usnistgov/etspy.git
- name: Clear conda and pip cache
run: |
conda clean --all
pip cache purge
- name: Conda list
run: |
conda list
- name: Run HyperSpy Test Suite
if: ${{ always() }}
run: |
python -m pytest --pyargs hyperspy --reruns 3 -n 2
- name: Run RosettaScio Test Suite
if: ${{ always() }}
run: |
# mrcz and pyusid doesn't support numpy 2
python -m pytest --pyargs rsciio -n 1 -k "not test_mrcz.py and not test_usid.py and not TestOperate"
- name: Run hyperspy_gui_ipywidgets Test Suite
if: ${{ always() }}
run: |
python -m pytest --pyargs hyperspy_gui_ipywidgets
- name: Run hyperspy_gui_traitsui Test Suite
if: ${{ always() }}
# run the tests headlessly
run: |
xvfb-run python -m pytest --pyargs hyperspy_gui_traitsui
- name: Run exspy Test Suite
if: ${{ always() }}
run: |
python -m pytest --pyargs exspy
- name: Run holospy Test Suite
if: ${{ always() }}
run: |
python -m pytest --pyargs holospy
- name: Run kikuchipy Test Suite
if: ${{ always() }}
# Run the tests headlessly (pyvista)
# Unskip test when https://github.com/pyxem/kikuchipy/issues/707 is fixed and
# released.
run: |
xvfb-run python -m pytest --pyargs kikuchipy -k "not test_not_allow_download_raises"
- name: Run LumiSpy Test Suite
if: ${{ always() }}
#if: contains(matrix.EXTENSION_VERSION, 'dev') # Tests only against development version, if a fix is not released yet.
run: |
python -m pytest --pyargs lumispy
- name: Run Pyxem Test Suite
if: ${{ always() }}
run: |
python -m pytest --pyargs pyxem
- name: Run ETSpy Test Suite
if: ${{ always() }}
# Test needs to be fixed, see https://github.com/usnistgov/etspy/issues/24
run: |
python -m pytest --pyargs etspy -n 2 -k "not test_version"