Skip to content

Commit 1811bcb

Browse files
committed
Move data download outside of install action
1 parent ef2e8b5 commit 1811bcb

File tree

6 files changed

+79
-39
lines changed

6 files changed

+79
-39
lines changed

.github/actions/install_eitprocessing/action.yml

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ inputs:
88
dependencies:
99
description: "The optional dependencies of eitprocessing to install"
1010
required: false
11-
extract-data:
12-
description: "Whether to extract testing data"
13-
required: false
14-
default: "false"
1511
token:
1612
description: "GitHub TOKEN"
1713
required: true
@@ -26,34 +22,6 @@ runs:
2622
- uses: actions/setup-python@v5
2723
with:
2824
python-version: ${{ inputs.python-version }}
29-
- name: Set data dir
30-
shell: bash
31-
if: ${{ inputs.extract-data == 'true' }}
32-
id: set-path
33-
run: echo "data_dir=$GITHUB_WORKSPACE/test_data" >> "$GITHUB_OUTPUT"
34-
- name: Restore dataset cache
35-
if: ${{ inputs.extract-data == 'true' }}
36-
id: cache
37-
uses: actions/cache@v4
38-
with:
39-
path: ${{ steps.set-path.outputs.data_dir }}
40-
key: eitprocessing-testdata-zenodo.${{ inputs.zenodo-record-id }}
41-
- name: Install zenodo-get
42-
if: ${{ inputs.extract-data == 'true' && steps.cache.outputs.cache-hit != 'true' }}
43-
run: python3 -m pip install zenodo-get
44-
shell: bash
45-
- name: Download test dataset
46-
shell: bash
47-
if: inputs.extract-data == 'true' && steps.cache.outputs.cache-hit != 'true'
48-
run: |
49-
mkdir -p ${{ steps.set-path.outputs.data_dir }}
50-
cd ${{ steps.set-path.outputs.data_dir }}
51-
zenodo_get ${{ inputs.zenodo-record-id }}
52-
cd -
53-
- name: Uninstall zenodo-get
54-
if: ${{ inputs.extract-data == 'true' && steps.cache.outputs.cache-hit != 'true' }}
55-
run: python3 -m pip uninstall --yes zenodo-get
56-
shell: bash
5725
- uses: actions/cache@v4
5826
id: cache-python-env
5927
with:

.github/workflows/coverage.yml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,40 @@ jobs:
1919
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2020
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
2121
COVERALLS_FLAG_NAME: python-${{ matrix.python-version }}
22+
ZENODO_RECORD_ID: 17423608
2223
steps:
2324
- uses: actions/checkout@v4
2425
- uses: ./.github/actions/install_eitprocessing
2526
with:
2627
dependencies: testing
27-
extract-data: true
2828
python-version: ${{ matrix.python-version }}
2929
token: ${{ secrets.GITHUB_TOKEN }}
30+
- name: Set data dir
31+
shell: bash
32+
id: set-path
33+
run: echo "data_dir=$GITHUB_WORKSPACE/test_data" >> "$GITHUB_OUTPUT"
34+
- name: Restore dataset cache
35+
id: cache
36+
uses: actions/cache@v4
37+
with:
38+
path: ${{ steps.set-path.outputs.data_dir }}
39+
key: eitprocessing-testdata-zenodo.$ZENODO_RECORD_ID
40+
- name: Install zenodo-get
41+
if: steps.cache.outputs.cache-hit != 'true'
42+
run: python3 -m pip install zenodo-get
43+
shell: bash
44+
- name: Download test dataset
45+
shell: bash
46+
if: steps.cache.outputs['cache-hit'] != 'true'
47+
run: |
48+
mkdir -p ${{ steps.set-path.outputs.data_dir }}
49+
cd ${{ steps.set-path.outputs.data_dir }}
50+
zenodo_get $ZENODO_RECORD_ID
51+
cd -
52+
- name: Uninstall zenodo-get
53+
if: steps.cache.outputs['cache-hit'] != 'true'
54+
run: python3 -m pip uninstall --yes zenodo-get
55+
shell: bash
3056
- name: Run coveralls
3157
run: |
3258
pytest --cov --cov-report xml --cov-report term --cov-report html

.github/workflows/release_github.yml

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,34 @@ jobs:
8585
uses: ./.github/actions/install_eitprocessing
8686
with:
8787
dependencies: testing
88-
extract-data: true
8988
python-version: ${{ matrix.python-version }}
9089
token: ${{ secrets.GITHUB_TOKEN }}
91-
90+
- name: Set data dir
91+
shell: bash
92+
id: set-path
93+
run: echo "data_dir=$GITHUB_WORKSPACE/test_data" >> "$GITHUB_OUTPUT"
94+
- name: Restore dataset cache
95+
id: cache
96+
uses: actions/cache@v4
97+
with:
98+
path: ${{ steps.set-path.outputs.data_dir }}
99+
key: eitprocessing-testdata-zenodo.$ZENODO_RECORD_ID
100+
- name: Install zenodo-get
101+
if: steps.cache.outputs.cache-hit != 'true'
102+
run: python3 -m pip install zenodo-get
103+
shell: bash
104+
- name: Download test dataset
105+
shell: bash
106+
if: steps.cache.outputs['cache-hit'] != 'true'
107+
run: |
108+
mkdir -p ${{ steps.set-path.outputs.data_dir }}
109+
cd ${{ steps.set-path.outputs.data_dir }}
110+
zenodo_get $ZENODO_RECORD_ID
111+
cd -
112+
- name: Uninstall zenodo-get
113+
if: steps.cache.outputs['cache-hit'] != 'true'
114+
run: python3 -m pip uninstall --yes zenodo-get
115+
shell: bash
92116
- name: Run pytest
93117
run: pytest -v --runslow
94118

.github/workflows/release_pypi.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ jobs:
1616
- uses: ./.github/actions/install_eitprocessing
1717
with:
1818
dependencies: publishing
19-
extract-data: false
2019
python-version: "3.10"
2120
- name: Build wheel and source distribution
2221
run: python -m build

.github/workflows/test_build_documentation.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ jobs:
2323
- uses: ./.github/actions/install_eitprocessing
2424
with:
2525
dependencies: docs
26-
extract-data: false
2726
python-version: "3.10"
2827
- name: Link notebooks
2928
run: ln -s ../../notebooks docs/examples

.github/workflows/testing.yml

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ on:
1414
branches:
1515
- main
1616
- develop
17-
1817
jobs:
1918
test_and_build:
2019
if: github.event.pull_request.draft == false
@@ -30,8 +29,33 @@ jobs:
3029
- uses: ./.github/actions/install_eitprocessing
3130
with:
3231
dependencies: testing
33-
extract-data: true
3432
python-version: ${{ matrix.python-version }}
3533
token: ${{ secrets.GITHUB_TOKEN }}
34+
- name: Set data dir
35+
shell: bash
36+
id: set-path
37+
run: echo "data_dir=$GITHUB_WORKSPACE/test_data" >> "$GITHUB_OUTPUT"
38+
- name: Restore dataset cache
39+
id: cache
40+
uses: actions/cache@v4
41+
with:
42+
path: ${{ steps.set-path.outputs.data_dir }}
43+
key: eitprocessing-testdata-zenodo.$ZENODO_RECORD_ID
44+
- name: Install zenodo-get
45+
if: steps.cache.outputs.cache-hit != 'true'
46+
run: python3 -m pip install zenodo-get
47+
shell: bash
48+
- name: Download test dataset
49+
shell: bash
50+
if: steps.cache.outputs['cache-hit'] != 'true'
51+
run: |
52+
mkdir -p ${{ steps.set-path.outputs.data_dir }}
53+
cd ${{ steps.set-path.outputs.data_dir }}
54+
zenodo_get $ZENODO_RECORD_ID
55+
cd -
56+
- name: Uninstall zenodo-get
57+
if: steps.cache.outputs['cache-hit'] != 'true'
58+
run: python3 -m pip uninstall --yes zenodo-get
59+
shell: bash
3660
- name: Run pytest
3761
run: pytest -v

0 commit comments

Comments
 (0)