Skip to content

Commit 5614e39

Browse files
committed
ci(spack): cache the spack install store across runs
setup-spack itself doesn't cache the install store between runs (only the spack git tree). Adding actions/cache on spack/opt + spack/var/spack/cache keyed by the relevant recipe file hashes means cantera + py-pyrometheus + all transitive deps are reused across runs that didn't touch those recipes. First push to a new key takes ~1.5h; subsequent pushes are minutes.
1 parent f3caaf4 commit 5614e39

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

.github/workflows/spack.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,15 @@ jobs:
2525
packages_ref: add-mfc
2626
buildcache: true
2727

28+
- name: Cache Spack install store
29+
uses: actions/cache@v4
30+
with:
31+
path: |
32+
spack/opt
33+
spack/var/spack/cache
34+
key: spack-store-${{ runner.os }}-${{ hashFiles('spack-packages/repos/spack_repo/builtin/packages/mfc/package.py', 'spack-packages/repos/spack_repo/builtin/packages/cantera/package.py', 'spack-packages/repos/spack_repo/builtin/packages/py_pyrometheus/package.py') }}
35+
restore-keys: spack-store-${{ runner.os }}-
36+
2837
- name: Install mfc+chemistry~mpi
2938
run: spack install --reuse mfc+chemistry~mpi
3039

0 commit comments

Comments
 (0)