Skip to content

Commit

Permalink
MRG: Use caching in Github Actions and Azure Pipelines (#8695)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
GuillaumeFavelier authored Jan 6, 2021
1 parent 1386e14 commit c4215cb
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/compat_minimal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@ jobs:
- shell: bash -el {0}
run: ./tools/github_actions_infos.sh
name: 'Show infos'
- shell: bash -el {0}
run: ./tools/get_testing_version.sh
name: 'Get testing version'
- uses: actions/cache@v2
with:
key: ${{ env.TESTING_VERSION }}
path: ~/mne_data
name: 'Cache testing data'
- shell: bash -el {0}
run: ./tools/github_actions_download.sh
name: 'Download testing data'
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/compat_old.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ jobs:
- shell: bash -el {0}
run: ./tools/github_actions_infos.sh
name: 'Show infos'
- shell: bash -el {0}
run: ./tools/get_testing_version.sh
name: 'Get testing version'
- uses: actions/cache@v2
with:
key: ${{ env.TESTING_VERSION }}
path: ~/mne_data
name: 'Cache testing data'
- shell: bash -el {0}
run: ./tools/github_actions_download.sh
name: 'Download testing data'
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/linux_conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ jobs:
- shell: bash -el {0}
run: ./tools/github_actions_infos.sh
name: 'Show infos'
- shell: bash -el {0}
run: ./tools/get_testing_version.sh
name: 'Get testing version'
- uses: actions/cache@v2
with:
key: ${{ env.TESTING_VERSION }}
path: ~/mne_data
name: 'Cache testing data'
- shell: bash -el {0}
run: ./tools/github_actions_download.sh
name: 'Download testing data'
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/linux_pip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ jobs:
- shell: bash -el {0}
run: ./tools/github_actions_infos.sh
name: 'Show infos'
- shell: bash -el {0}
run: ./tools/get_testing_version.sh
name: 'Get testing version'
- uses: actions/cache@v2
with:
key: ${{ env.TESTING_VERSION }}
path: ~/mne_data
name: 'Cache testing data'
- shell: bash -el {0}
run: ./tools/github_actions_download.sh
name: 'Download testing data'
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/macos_conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ jobs:
- shell: bash -el {0}
run: ./tools/github_actions_infos.sh
name: 'Show infos'
- shell: bash -el {0}
run: ./tools/get_testing_version.sh
name: 'Get testing version'
- uses: actions/cache@v2
with:
key: ${{ env.TESTING_VERSION }}
path: ~/mne_data
name: 'Cache testing data'
- shell: bash -el {0}
run: ./tools/github_actions_download.sh
name: 'Download testing data'
Expand Down
23 changes: 23 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ stages:
- stage: Main
condition: and(succeeded(), eq(dependencies.Check.outputs['Skip.result.start_main'], 'true'))
dependsOn: Check
variables:
AZURE_CI: 'true'
jobs:
- job: Style
pool:
Expand Down Expand Up @@ -112,6 +114,13 @@ stages:
python -m pip install --upgrade pip setuptools
python -m pip install --upgrade numpy scipy vtk -r requirements.txt -r requirements_testing.txt codecov
displayName: 'Install dependencies with pip'
- bash: source tools/get_testing_version.sh
displayName: 'Get testing version'
- task: Cache@2
inputs:
key: $(testing_version)
path: /home/vsts/mne_data
displayName: 'Cache testing data'
- script: python -c "import mne; mne.datasets.testing.data_path(verbose=True)"
displayName: 'Get test data'
- script: pytest -m "ultraslowtest" --tb=short --cov=mne -vv mne
Expand Down Expand Up @@ -148,6 +157,13 @@ stages:
displayName: 'Install dependencies'
- script: mne sys_info
displayName: 'Print config and test access to commands'
- bash: source tools/get_testing_version.sh
displayName: 'Get testing version'
- task: Cache@2
inputs:
key: $(testing_version)
path: /home/vsts/mne_data
displayName: 'Cache testing data'
- script: python -c "import mne; mne.datasets.testing.data_path(verbose=True)"
displayName: 'Get test data'
- script: pytest --tb=short --cov=mne -vv mne/viz
Expand Down Expand Up @@ -245,6 +261,13 @@ stages:
displayName: 'Print config and test access to commands'
- script: python -c "import numpy; numpy.show_config()"
displayName: Print NumPy config
- bash: source tools/get_testing_version.sh
displayName: 'Get testing version'
- task: Cache@2
inputs:
key: $(testing_version)
path: C:\Users\VssAdministrator\mne_data
displayName: 'Cache testing data'
- script: python -c "import mne; mne.datasets.testing.data_path(verbose=True)"
displayName: 'Get test data'
- script: pytest -m "not slowtest" --tb=short --cov=mne -vv mne
Expand Down
10 changes: 10 additions & 0 deletions tools/get_testing_version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash -ef

TESTING_VERSION=`grep -o "testing='[0-9.]\+'" mne/datasets/utils.py | cut -d \' -f 2 | sed "s/\./-/g"`
if [ ! -z $GITHUB_ENV ]; then
echo "TESTING_VERSION="$TESTING_VERSION >> $GITHUB_ENV
elif [ ! -z $AZURE_CI ]; then
echo "##vso[task.setvariable variable=testing_version]$TESTING_VERSION"
else
echo $TESTING_VERSION
fi

0 comments on commit c4215cb

Please sign in to comment.