Skip to content

Commit 5c93887

Browse files
committed
Cache RosettaSciIO test data
1 parent 22cabca commit 5c93887

File tree

1 file changed

+32
-3
lines changed

1 file changed

+32
-3
lines changed

.github/workflows/release.yml

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ env:
2626
TEST_DEPS: '"pytest<9" pytest-qt pytest-xdist pytest-rerunfailures pytest-mpl filelock'
2727
CONSTRUCTOR_VERSION: '3.14.0'
2828
CONDA_STANDALONE: '24.11.0'
29+
ROSETTASCIIO_CACHE_NUMBER: 0 # Increase this value to reset cache
2930

3031
defaults:
3132
run:
@@ -274,7 +275,7 @@ jobs:
274275
275276
- name: Check latest available hyperspy version
276277
run: |
277-
conda activate "${{ env.install_dir }}"
278+
conda activate "${{ env.install_dir }}"
278279
python check_hyperspy_latest.py
279280
280281
- name: Install xvfb
@@ -293,6 +294,20 @@ jobs:
293294
conda activate "${{ env.install_dir }}"
294295
mamba install ${{ env.TEST_DEPS }}
295296
297+
- name: Get rosettasciio tests data location
298+
run: |
299+
conda activate "${{ env.install_dir }}"
300+
python -c "from rsciio.tests import registry; print(f'ROSETTASCIIO_TEST_DATA={str(registry.TESTS_PATH / \"data\") }')" >> $GITHUB_ENV
301+
302+
- name: Cache rosettasciio data
303+
uses: actions/cache@v4
304+
with:
305+
path: ${{ env.ROSETTASCIIO_TEST_DATA }}
306+
key:
307+
RosettaSciIO-test_data-${{ env.ROSETTASCIIO_CACHE_NUMBER }}
308+
restore-keys: |
309+
RosettaSciIO-test_data-${{ env.ROSETTASCIIO_CACHE_NUMBER }}
310+
296311
- if: always()
297312
name: Test new distribution (HyperSpyUI)
298313
run: |
@@ -420,8 +435,8 @@ jobs:
420435
call "${{ env.WP_DIR_NAME }}\scripts\env.bat"
421436
pip list
422437
423-
- shell: bash -l {0}
424-
name: Set installer name
438+
- name: Set installer name
439+
shell: bash -l {0}
425440
env:
426441
VERSION: ${{ needs.create_release_job.outputs.VERSION }}
427442
run: |
@@ -463,6 +478,20 @@ jobs:
463478
call "${{ env.WP_DIR_NAME }}\scripts\env.bat"
464479
python check_hyperspy_latest.py
465480
481+
- name: Get rosettasciio tests data location
482+
run: |
483+
call "${{ env.WP_DIR_NAME }}\scripts\env.bat"
484+
python -c "from rsciio.tests import registry; data_path=str(registry.TESTS_PATH / 'data'); print(f'ROSETTASCIIO_TEST_DATA={data_path}')">> %GITHUB_ENV%
485+
486+
- name: Cache rosettasciio data
487+
uses: actions/cache@v4
488+
with:
489+
path: ${{ env.ROSETTASCIIO_TEST_DATA }}
490+
key:
491+
RosettaSciIO-test_data-${{ env.ROSETTASCIIO_CACHE_NUMBER }}
492+
restore-keys: |
493+
RosettaSciIO-test_data-${{ env.ROSETTASCIIO_CACHE_NUMBER }}
494+
466495
- name: Install testing libraries
467496
if: always()
468497
run: |

0 commit comments

Comments
 (0)