Skip to content

Commit

Permalink
cache datasets
Browse files Browse the repository at this point in the history
  • Loading branch information
lobis committed Dec 6, 2023
1 parent 58cd135 commit 68e0992
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,6 @@ jobs:
key: geant4-${{ matrix.geant4-version }}-${{ matrix.platform }}
fail-on-cache-miss: true

- name: Cache Geant4 Datasets
id: cache-geant4-data
uses: actions/cache@v3
with:
path: ${{ github.workspace }}/geant4-data
key: geant4-${{ matrix.geant4-version }}-data
fail-on-cache-miss: true
enableCrossOsArchive: true

- name: Check Geant4
run: |
mv ${{ github.workspace }}/geant4-data ${{ github.workspace }}/geant4/share/Geant4/data
Expand All @@ -196,7 +187,20 @@ jobs:
with:
limit-access-to-actor: false

# Need to run each "run" test separately to avoid error (TODO: investigate)
- name: Save datasets location to env
run: |
GEANT4_DATA_DIR=$(python -c "import geant4_python_application; print(geant4_python_application.datasets.data_dir)")
echo "GEANT4_DATA_DIR=${GEANT4_DATA_DIR}" >> $GITHUB_ENV
- name: Cache Geant4 Datasets
id: cache-geant4-data
uses: actions/cache@v3
with:
path: ${{ github.env.GEANT4_DATA_DIR }}
key: geant4-${{ matrix.geant4-version }}-data
fail-on-cache-miss: true
enableCrossOsArchive: true

- name: Run tests
run: |
source ${{ github.workspace }}/geant4/bin/geant4.sh
Expand Down

0 comments on commit 68e0992

Please sign in to comment.