Skip to content

Commit

Permalink
use one os for caching
Browse files Browse the repository at this point in the history
  • Loading branch information
Moritz-Alexander-Kern committed Jun 3, 2024
1 parent 767d8a9 commit 0dd56d4
Showing 1 changed file with 4 additions and 18 deletions.
22 changes: 4 additions & 18 deletions .github/workflows/cache_elephant_data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@ jobs:
fail-fast: false
matrix:
# OS [ubuntu-latest, macos-latest, windows-latest]
os: [macos-latest,ubuntu-latest,windows-latest]
os: [macos-latest]

steps:
- name: Get current hash (SHA) of the elephant_data repo
id: elephant-data
run: |
echo "dataset_hash=$(git ls-remote https://gin.g-node.org/NeuralEnsemble/elephant-data.git HEAD | cut -f1)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
- uses: actions/cache@v4.0.2
# Loading cache of elephant-data
id: cache-datasets
with:
path: ~/elephant-data
key: ${{ runner.os }}-datasets-${{ steps.elephant-data.outputs.dataset_hash }}
key: datasets-${{ steps.elephant-data.outputs.dataset_hash }}

- name: Cache found?
run: echo "Cache-hit == ${{steps.cache-datasets.outputs.cache-hit == 'true'}}"
Expand All @@ -46,14 +46,6 @@ jobs:
if: steps.cache-datasets.outputs.cache-hit != 'true' && runner.os == 'macOS'
run: |
brew install datalad
- name: Install Datalad Linux/ Windows
if: steps.cache-datasets.outputs.cache-hit != 'true' && (runner.os == 'Linux' || runner.os == 'Windows')
run: |
python -m pip install -U pip # Official recommended way
pip install datalad-installer
datalad-installer --sudo ok git-annex --method datalad/packages
pip install datalad
- name: Download dataset
id: download-dataset
Expand All @@ -64,15 +56,9 @@ jobs:
datalad --version
datalad install --recursive --get-data https://gin.g-node.org/NeuralEnsemble/elephant-data
- name: Show size of the cache to assert data is downloaded macOS, Linux
if: runner.os == 'Linux' || runner.os == 'macOS'
- name: Show size of the cache to assert data is downloaded macOS
run: |
cd ~
du -hs ~/elephant-data
ls -lh ~/elephant-data
- name: Show size of the cache to assert data is downloaded Windows
if: runner.os == 'Windows'
run: |
cd ~
dir ~\elephant-data

0 comments on commit 0dd56d4

Please sign in to comment.