Skip to content

Commit c4215cb

Browse files
MRG: Use caching in Github Actions and Azure Pipelines (#8695)
* First test [skip azp][skip circle] * Download anyway [skip azp][skip circle] * Unify cache key [skip azp][skip circle] * Test new key * Test linux_pip [skip azp][skip circle] * Try again [skip azp][skip circle] * Deploy to all jobs * Try another syntax * Test new key format [skip azp][skip circle] * Use home env variable * Fix key [skip azp][skip circle] * Try naive version on Azure * Try again [skip github][skip circle] * Try again [skip github][skip circle] * Try another syntax [skip github][skip circle] * Try again [skip github] * Try again [skip github] * Try again [skip github] * Try again [skip github] * Try again [skip github] * Debug variable [skip github] * Debug variable [skip github] * Debug variable [skip github] * Debug variable [skip github] * Debug variable [skip github] * Debug variable [skip github] * Debug variable [skip github] * Debug variable [skip github] * Debug variable [skip github] * Debug variable [skip github] * Test again? [skip github] * Debug variable [skip github] * Debug variable [skip github] * Debug variable [skip github] * Debug variable [skip github] * Test new key format [skip github] * Test new key format [skip github] * Test new key format [skip github] * Try again [skip github] * Try again [skip github] * Try again [skip github] * Deploy to all jobs * Try another syntax [skip github][skip circle] * Try another syntax [skip github][skip circle] * Try another syntax [skip github][skip circle] * Test again
1 parent 1386e14 commit c4215cb

File tree

7 files changed

+73
-0
lines changed

7 files changed

+73
-0
lines changed

.github/workflows/compat_minimal.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,14 @@ jobs:
6464
- shell: bash -el {0}
6565
run: ./tools/github_actions_infos.sh
6666
name: 'Show infos'
67+
- shell: bash -el {0}
68+
run: ./tools/get_testing_version.sh
69+
name: 'Get testing version'
70+
- uses: actions/cache@v2
71+
with:
72+
key: ${{ env.TESTING_VERSION }}
73+
path: ~/mne_data
74+
name: 'Cache testing data'
6775
- shell: bash -el {0}
6876
run: ./tools/github_actions_download.sh
6977
name: 'Download testing data'

.github/workflows/compat_old.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,14 @@ jobs:
5757
- shell: bash -el {0}
5858
run: ./tools/github_actions_infos.sh
5959
name: 'Show infos'
60+
- shell: bash -el {0}
61+
run: ./tools/get_testing_version.sh
62+
name: 'Get testing version'
63+
- uses: actions/cache@v2
64+
with:
65+
key: ${{ env.TESTING_VERSION }}
66+
path: ~/mne_data
67+
name: 'Cache testing data'
6068
- shell: bash -el {0}
6169
run: ./tools/github_actions_download.sh
6270
name: 'Download testing data'

.github/workflows/linux_conda.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,14 @@ jobs:
5959
- shell: bash -el {0}
6060
run: ./tools/github_actions_infos.sh
6161
name: 'Show infos'
62+
- shell: bash -el {0}
63+
run: ./tools/get_testing_version.sh
64+
name: 'Get testing version'
65+
- uses: actions/cache@v2
66+
with:
67+
key: ${{ env.TESTING_VERSION }}
68+
path: ~/mne_data
69+
name: 'Cache testing data'
6270
- shell: bash -el {0}
6371
run: ./tools/github_actions_download.sh
6472
name: 'Download testing data'

.github/workflows/linux_pip.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,14 @@ jobs:
5757
- shell: bash -el {0}
5858
run: ./tools/github_actions_infos.sh
5959
name: 'Show infos'
60+
- shell: bash -el {0}
61+
run: ./tools/get_testing_version.sh
62+
name: 'Get testing version'
63+
- uses: actions/cache@v2
64+
with:
65+
key: ${{ env.TESTING_VERSION }}
66+
path: ~/mne_data
67+
name: 'Cache testing data'
6068
- shell: bash -el {0}
6169
run: ./tools/github_actions_download.sh
6270
name: 'Download testing data'

.github/workflows/macos_conda.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,14 @@ jobs:
5656
- shell: bash -el {0}
5757
run: ./tools/github_actions_infos.sh
5858
name: 'Show infos'
59+
- shell: bash -el {0}
60+
run: ./tools/get_testing_version.sh
61+
name: 'Get testing version'
62+
- uses: actions/cache@v2
63+
with:
64+
key: ${{ env.TESTING_VERSION }}
65+
path: ~/mne_data
66+
name: 'Cache testing data'
5967
- shell: bash -el {0}
6068
run: ./tools/github_actions_download.sh
6169
name: 'Download testing data'

azure-pipelines.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ stages:
3232
- stage: Main
3333
condition: and(succeeded(), eq(dependencies.Check.outputs['Skip.result.start_main'], 'true'))
3434
dependsOn: Check
35+
variables:
36+
AZURE_CI: 'true'
3537
jobs:
3638
- job: Style
3739
pool:
@@ -112,6 +114,13 @@ stages:
112114
python -m pip install --upgrade pip setuptools
113115
python -m pip install --upgrade numpy scipy vtk -r requirements.txt -r requirements_testing.txt codecov
114116
displayName: 'Install dependencies with pip'
117+
- bash: source tools/get_testing_version.sh
118+
displayName: 'Get testing version'
119+
- task: Cache@2
120+
inputs:
121+
key: $(testing_version)
122+
path: /home/vsts/mne_data
123+
displayName: 'Cache testing data'
115124
- script: python -c "import mne; mne.datasets.testing.data_path(verbose=True)"
116125
displayName: 'Get test data'
117126
- script: pytest -m "ultraslowtest" --tb=short --cov=mne -vv mne
@@ -148,6 +157,13 @@ stages:
148157
displayName: 'Install dependencies'
149158
- script: mne sys_info
150159
displayName: 'Print config and test access to commands'
160+
- bash: source tools/get_testing_version.sh
161+
displayName: 'Get testing version'
162+
- task: Cache@2
163+
inputs:
164+
key: $(testing_version)
165+
path: /home/vsts/mne_data
166+
displayName: 'Cache testing data'
151167
- script: python -c "import mne; mne.datasets.testing.data_path(verbose=True)"
152168
displayName: 'Get test data'
153169
- script: pytest --tb=short --cov=mne -vv mne/viz
@@ -245,6 +261,13 @@ stages:
245261
displayName: 'Print config and test access to commands'
246262
- script: python -c "import numpy; numpy.show_config()"
247263
displayName: Print NumPy config
264+
- bash: source tools/get_testing_version.sh
265+
displayName: 'Get testing version'
266+
- task: Cache@2
267+
inputs:
268+
key: $(testing_version)
269+
path: C:\Users\VssAdministrator\mne_data
270+
displayName: 'Cache testing data'
248271
- script: python -c "import mne; mne.datasets.testing.data_path(verbose=True)"
249272
displayName: 'Get test data'
250273
- script: pytest -m "not slowtest" --tb=short --cov=mne -vv mne

tools/get_testing_version.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash -ef
2+
3+
TESTING_VERSION=`grep -o "testing='[0-9.]\+'" mne/datasets/utils.py | cut -d \' -f 2 | sed "s/\./-/g"`
4+
if [ ! -z $GITHUB_ENV ]; then
5+
echo "TESTING_VERSION="$TESTING_VERSION >> $GITHUB_ENV
6+
elif [ ! -z $AZURE_CI ]; then
7+
echo "##vso[task.setvariable variable=testing_version]$TESTING_VERSION"
8+
else
9+
echo $TESTING_VERSION
10+
fi

0 commit comments

Comments
 (0)