@@ -70,34 +70,32 @@ jobs:
7070 fail-fast : false
7171
7272 steps :
73- # used to reset cache every month
74- - name : Get current year-month
75- id : date
76- run : echo "date=$(date +'%Y-%m')" >> $GITHUB_OUTPUT
77-
78- - name : Get pip cache dir
79- id : pip-cache
80- run : |
81- echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
82-
83- - uses : actions/checkout@v3
73+ 8474
8575 - name : Set up Python ${{ matrix.python-version }}
86- uses : actions/setup-python@v4
76+ uses : actions/setup-python@v5.1.0
8777 with :
8878 python-version : ${{ matrix.python-version }}
79+ check-latest : true
8980 cache : ' pip'
90- cache-dependency-path : ' **/requirements.txt'
81+ cache-dependency-path : |
82+ **/requirements.txt
83+ **/requirements-extras.txt
84+ **/requirements-tests.txt
9185
92- - name : Cache test_env
93- uses : actions/cache@v3
86+ - name : Get current hash (SHA) of the elephant_data repo
87+ id : elephant-data
88+ run : |
89+ echo "dataset_hash=$(git ls-remote https://gin.g-node.org/NeuralEnsemble/elephant-data.git HEAD | cut -f1)" >> $GITHUB_OUTPUT
90+
91+ -
uses :
actions/cache/[email protected] 92+ # Loading cache of elephant-data
93+ id : cache-datasets
9494 with :
95- path : ${{ steps.pip-cache.outputs.dir }}
96- # Look to see if there is a cache hit for the corresponding requirements files
97- # cache will be reset on changes to any requirements or every month
98- key : ${{ runner.os }}-venv-${{ hashFiles('**/requirements.txt') }}-${{ hashFiles('**/requirements-tests.txt') }}
99- -${{ hashFiles('**/requirements-extras.txt') }}-${{ hashFiles('**/CI.yml') }}-${{ hashFiles('setup.py') }}
100- -${{ steps.date.outputs.date }}
95+ path : ~/elephant-data
96+ key : datasets-${{ steps.elephant-data.outputs.dataset_hash }}
97+ restore-keys : datasets-
98+ enableCrossOsArchive : true
10199
102100 - name : Install dependencies
103101 run : |
@@ -112,6 +110,11 @@ jobs:
112110
113111 - name : Test with pytest
114112 run : |
113+ if [ -d ~/elephant-data ]; then
114+ export ELEPHANT_DATA_LOCATION=~/elephant-data
115+ echo $ELEPHANT_DATA_LOCATION
116+ fi
117+
115118 coverage run --source=elephant -m pytest
116119 coveralls --service=github || echo "Coveralls submission failed"
117120 env :
@@ -146,6 +149,19 @@ jobs:
146149 path : ~/conda_pkgs_dir
147150 key : ${{ runner.os }}-conda-${{hashFiles('requirements/environment.yml') }}-${{ hashFiles('**/CI.yml') }}-${{ steps.date.outputs.date }}
148151
152+ - name : Get current hash (SHA) of the elephant_data repo
153+ id : elephant-data
154+ run : |
155+ echo "dataset_hash=$(git ls-remote https://gin.g-node.org/NeuralEnsemble/elephant-data.git HEAD | cut -f1)" >> $GITHUB_OUTPUT
156+
157+ -
uses :
actions/cache/[email protected] 158+ # Loading cache of elephant-data
159+ id : cache-datasets
160+ with :
161+ path : ~/elephant-data
162+ key : datasets-${{ steps.elephant-data.outputs.dataset_hash }}
163+ restore-keys : datasets-
164+
149165 - uses : conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # corresponds to v3.0.4
150166 with :
151167 auto-update-conda : true
@@ -173,6 +189,10 @@ jobs:
173189 - name : Test with pytest
174190 shell : bash -l {0}
175191 run : |
192+ if [ -d ~/elephant-data ]; then
193+ export ELEPHANT_DATA_LOCATION=~/elephant-data
194+ echo $ELEPHANT_DATA_LOCATION
195+ fi
176196 pytest --cov=elephant
177197
178198 # __ ___ _
@@ -192,24 +212,32 @@ jobs:
192212 os : [windows-latest]
193213
194214 steps :
195- - name : Get current year-month
196- id : date
197- run : echo "date=$(date +'%Y-%m')" >> $GITHUB_OUTPUT
198-
199- - uses : actions/checkout@v3
215+ 200216
201217 - name : Set up Python ${{ matrix.python-version }}
202- uses : actions/setup-python@v4
218+ uses : actions/setup-python@v5.1.0
203219 with :
204220 python-version : ${{ matrix.python-version }}
221+ check-latest : true
222+ cache : ' pip'
223+ cache-dependency-path : |
224+ **/requirements.txt
225+ **/requirements-extras.txt
226+ **/requirements-tests.txt
205227
206- - name : Cache pip
207- uses : actions/cache@v3
228+ - name : Get current hash (SHA) of the elephant_data repo
229+ id : elephant-data
230+ run : |
231+ echo "dataset_hash=$(git ls-remote https://gin.g-node.org/NeuralEnsemble/elephant-data.git HEAD | cut -f1)" >> $GITHUB_OUTPUT
232+
233+ -
uses :
actions/cache/[email protected] 234+ # Loading cache of elephant-data
235+ id : cache-datasets
208236 with :
209- path : ~\AppData\Local\pip\Cache
210- # Look to see if there is a cache hit for the corresponding requirements files
211- key : ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-${{ hashFiles('**/requirements-tests.txt') }}
212- -${{ hashFiles('**/requirements-extras.txt') }}-${{ hashFiles('setup.py') }} -${{ hashFiles('**/CI.yml') }}-${{ steps.date.outputs.date }}
237+ path : ~/elephant-data
238+ key : datasets-${{ steps.elephant-data.outputs.dataset_hash }}
239+ restore-keys : datasets-
240+ enableCrossOsArchive : true
213241
214242 - name : Install dependencies
215243 run : |
@@ -224,6 +252,10 @@ jobs:
224252
225253 - name : Test with pytest
226254 run : |
255+ if (Test-Path "$env:USERPROFILE\elephant-data") {
256+ $env:ELEPHANT_DATA_LOCATION = "$env:USERPROFILE\elephant-data"
257+ Write-Output $env:ELEPHANT_DATA_LOCATION
258+ }
227259 pytest --cov=elephant
228260
229261 # __ __ ____ ___
@@ -246,29 +278,32 @@ jobs:
246278 fail-fast : false
247279
248280 steps :
249- - name : Get current year-month
250- id : date
251- run : echo "date=$(date +'%Y-%m')" >> $GITHUB_OUTPUT
252- - uses : actions/checkout@v3
281+ 253282
254283 - name : Set up Python ${{ matrix.python-version }}
255- uses : actions/setup-python@v4
284+ uses : actions/setup-python@v5.1.0
256285 with :
257286 python-version : ${{ matrix.python-version }}
287+ check-latest : true
288+ cache : ' pip'
289+ cache-dependency-path : |
290+ **/requirements.txt
291+ **/requirements-extras.txt
292+ **/requirements-tests.txt
258293
259- - name : Get pip cache dir
260- id : pip-cache
294+ - name : Get current hash (SHA) of the elephant_data repo
295+ id : elephant-data
261296 run : |
262- echo "dir =$(pip cache dir )" >> $GITHUB_OUTPUT
297+ echo "dataset_hash =$(git ls-remote https://gin.g-node.org/NeuralEnsemble/elephant-data.git HEAD | cut -f1 )" >> $GITHUB_OUTPUT
263298
264- - name : Cache test_env
265- uses : actions/cache@v3
299+ -
uses :
actions/cache/[email protected] 300+ # Loading cache of elephant-data
301+ id : cache-datasets
266302 with :
267- path : ${{ steps.pip-cache.outputs.dir }}
268- # look to see if there is a cache hit for the corresponding requirements files
269- # cache will be reset on changes to any requirements or every month
270- key : ${{ runner.os }}-venv-${{ hashFiles('**/requirements.txt') }}-${{ hashFiles('**/requirements-tests.txt') }}
271- -${{ hashFiles('**/requirements-extras.txt') }}-${{ hashFiles('setup.py') }} -${{ hashFiles('**/CI.yml') }}-${{ steps.date.outputs.date }}
303+ path : ~/elephant-data
304+ key : datasets-${{ steps.elephant-data.outputs.dataset_hash }}
305+ restore-keys : datasets-
306+ enableCrossOsArchive : true
272307
273308 - name : Setup environment
274309 run : |
@@ -287,6 +322,10 @@ jobs:
287322
288323 - name : Test with pytest
289324 run : |
325+ if [ -d ~/elephant-data ]; then
326+ export ELEPHANT_DATA_LOCATION=~/elephant-data
327+ echo $ELEPHANT_DATA_LOCATION
328+ fi
290329 mpiexec -n 1 python -m mpi4py -m coverage run --source=elephant -m pytest
291330 coveralls --service=github || echo "Coveralls submission failed"
292331 env :
@@ -316,7 +355,7 @@ jobs:
316355 id : date
317356 run : echo "date=$(date +'%Y-%m')" >> $GITHUB_OUTPUT
318357
319- - uses : actions/checkout@v3
358+ - uses : actions/checkout@v4.1.6
320359
321360 - name : Get pip cache dir
322361 id : pip-cache
@@ -330,6 +369,20 @@ jobs:
330369
331370 key : ${{ runner.os }}-pip-${{hashFiles('requirements/environment-tests.yml') }}-${{ hashFiles('**/CI.yml') }}-${{ steps.date.outputs.date }}
332371
372+ - name : Get current hash (SHA) of the elephant_data repo
373+ id : elephant-data
374+ run : |
375+ echo "dataset_hash=$(git ls-remote https://gin.g-node.org/NeuralEnsemble/elephant-data.git HEAD | cut -f1)" >> $GITHUB_OUTPUT
376+
377+ -
uses :
actions/cache/[email protected] 378+ # Loading cache of elephant-data
379+ id : cache-datasets
380+ with :
381+ path : ~/elephant-data
382+ key : datasets-${{ steps.elephant-data.outputs.dataset_hash }}
383+ restore-keys : datasets-
384+ enableCrossOsArchive : true
385+
333386 - uses : conda-incubator/setup-miniconda@030178870c779d9e5e1b4e563269f3aa69b04081 # corresponds to v3.0.3
334387 with :
335388 auto-update-conda : true
@@ -358,6 +411,10 @@ jobs:
358411 - name : Test with pytest
359412 shell : bash -el {0}
360413 run : |
414+ if [ -d ~/elephant-data ]; then
415+ export ELEPHANT_DATA_LOCATION=~/elephant-data
416+ echo $ELEPHANT_DATA_LOCATION
417+ fi
361418 pytest --cov=elephant
362419
363420 # ____
@@ -383,7 +440,7 @@ jobs:
383440 id : date
384441 run : echo "date=$(date +'%Y-%m')" >> $GITHUB_OUTPUT
385442
386- - uses : actions/checkout@v3
443+ - uses : actions/checkout@v4.1.6
387444
388445 - name : Get pip cache dir
389446 id : pip-cache
@@ -448,10 +505,10 @@ jobs:
448505 - name : Get current year-month
449506 id : date
450507 run : echo "::set-output name=date::$(date +'%Y-%m')"
451- - uses : actions/checkout@v3
508+ - uses : actions/checkout@v4.1.6
452509
453510 - name : Set up Python ${{ matrix.python-version }}
454- uses : actions/setup-python@v4
511+ uses : actions/setup-python@v5.1.0
455512 with :
456513 python-version : ${{ matrix.python-version }}
457514
0 commit comments