-
Notifications
You must be signed in to change notification settings - Fork 6
216 lines (188 loc) · 7.33 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
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', 'RnMajor']
# When RostteSciIO is released, extent build matrix with released version
RSIO_VERSION: ['']
EXTENSION_VERSION: ['release', 'dev']
DEPENDENCIES_DEV: [false]
DEPENDENCIES_PRE_RELEASE: [false]
DEPENDENCIES_NUMBA_DEV: [false]
USE_MAMBA: [true]
PYTHON_VERSION: ['3.10']
include:
# test against upstream dev
- DEPENDENCIES_DEV: true
# Install dev version from https://pypi.anaconda.org/scipy-wheels-nightly/simple
# using pip
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://pypi.anaconda.org/scipy-wheels-nightly/simple
# add numpy when it is working again (import error)
DEPENDENCIES: numba scipy scikit-image scikit-learn
USE_MAMBA: false
- DEPENDENCIES_DEV: true
LABEL: -dependencies_dev
HYPERSPY_VERSION: 'RnMajor'
RSIO_VERSION: 'dev'
EXTENSION_VERSION: 'dev'
DEPENDENCIES: numba 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
PYTHON_VERSION: '3.11'
- DEPENDENCIES_NUMBA_DEV: true
# Install dev version from numba/label/dev channel using mamba
LABEL: -dependencies_numba_dev
HYPERSPY_VERSION: 'RnMajor'
EXTENSION_VERSION: 'dev'
DEPENDENCIES: numba
USE_MAMBA: true
PYTHON_VERSION: '3.11'
exclude:
# Don't test RELEASE_next_major with released version of extension as
# they don't support the hyperspy 2.0 API changes
- HYPERSPY_VERSION: 'RnMajor'
EXTENSION_VERSION: 'release'
env:
ETS_TOOLKIT: qt
EXTENSION: hyperspy-gui-ipywidgets hyperspy-gui-traitsui kikuchipy lumispy pyxem
MPLBACKEND: agg
TEST_DEPS: pytest pytest-xdist pytest-rerunfailures pytest-mpl
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@main
with:
miniforge-variant: Mambaforge
miniforge-version: latest
python-version: ${{ matrix.PYTHON_VERSION }}
# use base environment, so that when using pip, this is from the
# mambaforge distribution
# auto-activate-base: true
activate-environment: "test"
- name: 'Install Ubuntu packages for Qt'
shell: bash
run: |
sudo apt-get update
sudo apt-get install qtbase5-dev
- name: Install pip
run: |
mamba install pip
- 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/scipy-wheels-nightly/simple \
${{ matrix.DEPENDENCIES }}
pip install https://github.com/scikit-image/scikit-image/archive/main.zip
- name: Install dependencies pre release version
if: ${{ matrix.DEPENDENCIES_PRE_RELEASE }}
run: |
pip install --upgrade --pre ${{ matrix.DEPENDENCIES }}
- name: Install Test dependencies
run: |
pip install ${{ env.TEST_DEPS }}
- name: Conda list
run: |
conda list
- 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 https://github.com/hyperspy/hyperspy/archive/RELEASE_next_patch.zip#egg=hyperspy[all,tests]
- name: Install HyperSpy RnMinor
if: contains(matrix.HYPERSPY_VERSION, 'RnMinor')
run: |
pip install https://github.com/hyperspy/hyperspy/archive/RELEASE_next_minor.zip#egg=hyperspy[all,tests]
- name: Install HyperSpy RnMajor and RosettaSciIO
if: contains(matrix.HYPERSPY_VERSION, 'RnMajor')
run: |
pip install https://github.com/hyperspy/hyperspy/archive/RELEASE_next_major.zip#egg=hyperspy[all,tests]
- 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 https://github.com/lumispy/lumispy/archive/main.zip
pip install https://github.com/pyxem/kikuchipy/archive/develop.zip
pip install https://github.com/pyxem/pyxem/archive/main.zip
pip install https://github.com/hyperspy/hyperspy_gui_ipywidgets/archive/main.zip
pip install https://github.com/hyperspy/hyperspy_gui_traitsui/archive/main.zip
- name: Clear conda and pip cache
run: |
conda clean --all
pip cache purge
- name: Conda list
run: |
conda list
- name: Run HyperSpy Test Suite
run: |
python -m pytest --pyargs hyperspy --reruns 3 -n 2
- name: Run RosettaScio Test Suite
if: contains(matrix.HYPERSPY_VERSION, 'RnMajor')
run: |
python -m pytest --pyargs rsciio -n 2
- 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 kikuchipy Test Suite
if: ${{ always() }}
run: |
python -m pytest --pyargs kikuchipy
- 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