Skip to content

Commit 134c54e

Browse files
committed
Use setup-miniconda to install built distribution
1 parent 781d02b commit 134c54e

File tree

1 file changed

+11
-43
lines changed

1 file changed

+11
-43
lines changed

.github/workflows/release.yml

Lines changed: 11 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -162,61 +162,40 @@ jobs:
162162
mv $installer_name $new_installer_name
163163
echo "asset_name=$new_installer_name" >> $GITHUB_ENV
164164
echo "Installer name: "$new_installer_name
165+
echo "#################################"
166+
installer_path=$(readlink -f $new_installer_name)
167+
echo "installer_path=$installer_path" >> $GITHUB_ENV
168+
echo "Installer path: "$installer_path
169+
echo "#################################"
165170
ls
166171
167172
- name: Get hash
168173
run: |
169174
shasum -a 256 ${{ env.asset_name }}
170175
171-
- name: Install new distribution (Linux)
172-
if: runner.os == 'linux'
173-
env:
174-
install_dir: '${{ github.workspace }}/new_distribution'
175-
run: |
176-
echo "install_dir=${{ env.install_dir }}" >> $GITHUB_ENV
177-
bash ${{ env.asset_name }} -b -p ${{ env.install_dir }}
178-
179-
- name: Install new distribution (MacOS)
180-
if: runner.os == 'macos'
181-
run: |
182-
echo "install_dir=/Users/runner/hyperspy-bundle" >> $GITHUB_ENV
183-
installer -pkg ${{ env.asset_name }} -target CurrentUserHomeDirectory
184-
185-
- name: Install new distribution (Windows)
186-
if: runner.os == 'windows'
187-
env:
188-
install_dir: '${{ github.workspace }}\nd'
189-
run: |
190-
echo "install_dir=${{ env.install_dir }}" >> $GITHUB_ENV
191-
192-
- name: Install new distribution (Windows)
193-
if: runner.os == 'windows'
194-
shell: powershell
195-
run: |
196-
Start-Process -Wait -FilePath ${{ env.asset_name }} -ArgumentList "/S /AddToPath=0 /RegisterPython=0 /NoScripts=1 /D=${{ env.install_dir }}"
197-
198176
- name: Upload artifact
199177
if: startsWith(github.ref, 'refs/tags/') != true
200178
uses: actions/upload-artifact@v4
201179
with:
202180
path: ${{ env.asset_name }}
203181
name: ${{ env.asset_name }}
204182

205-
- name: Show install folder content
206-
run : |
207-
ls "${{ env.install_dir }}"
183+
- uses: conda-incubator/setup-miniconda@v3
184+
with:
185+
channels: conda-forge
186+
installer-url: ${{ env.installer_path }}
187+
auto-activate-base: true
188+
activate-environment: ""
208189

209190
- name: Info new distribution
210191
run: |
211-
conda activate "${{ env.install_dir }}"
212192
conda info
213193
conda config --show channels
214194
conda config --show channel_priority
215195
conda list
216196
217197
- name: Check latest available hyperspy version
218198
run: |
219-
conda activate "${{ env.install_dir }}"
220199
python check_hyperspy_latest.py
221200
222201
- name: Install xvfb
@@ -232,70 +211,59 @@ jobs:
232211
- name: Install test dependencies
233212
if: always()
234213
run: |
235-
conda activate "${{ env.install_dir }}"
236214
mamba install ${{ env.TEST_DEPS }}
237215
238216
- if: always()
239217
name: Test new distribution (HyperSpyUI)
240218
run: |
241-
conda activate "${{ env.install_dir }}"
242219
# Error on closing figure, not critical
243220
pytest --pyargs hyperspyui -k "not plotting"
244221
245222
- name: Test RosettaSciIO
246223
if: always()
247224
run: |
248-
conda activate "${{ env.install_dir }}"
249225
pytest --pyargs rsciio --reruns 3 -n 1 -k "not TestOperate"
250226
251227
- name: Test hyperspy
252228
if: always()
253229
run: |
254-
conda activate "${{ env.install_dir }}"
255230
pytest --pyargs hyperspy --reruns 3 -n 2
256231
257232
- name: Test hyperspy_gui_ipywidgets
258233
if: always()
259234
run: |
260-
conda activate "${{ env.install_dir }}"
261235
pytest --pyargs hyperspy_gui_ipywidgets
262236
263237
- name: Test hyperspy_gui_traitsui
264238
if: runner.os != 'linux' && always()
265239
run: |
266-
conda activate "${{ env.install_dir }}"
267240
# test_image_contrast_tool not supported with agg backend
268241
pytest --pyargs hyperspy_gui_traitsui -k "not test_image_contrast_tool"
269242
270243
- name: Run test exspy
271244
if: always()
272245
run: |
273-
conda activate "${{ env.install_dir }}"
274246
pytest --pyargs exspy
275247
276248
- name: Run test holospy
277249
if: always()
278250
run: |
279-
conda activate "${{ env.install_dir }}"
280251
pytest --pyargs holospy
281252
282253
- name: Run test lumispy
283254
if: always()
284255
run: |
285-
conda activate "${{ env.install_dir }}"
286256
pytest --pyargs lumispy
287257
288258
- name: Run test pyxem
289259
if: always()
290260
run: |
291-
conda activate "${{ env.install_dir }}"
292261
# cause of the TestAddEllipseArrayAsMarkers failure is unknown (seems to be on blas mkl only)
293262
pytest --pyargs pyxem -k "not TestAddEllipseArrayAsMarkers"
294263
295264
- name: Run test atomap
296265
if: always()
297266
run: |
298-
conda activate "${{ env.install_dir }}"
299267
# Skip interactive test
300268
pytest --pyargs atomap -k "not TestSelectAtomsWithGui"
301269

0 commit comments

Comments
 (0)