Skip to content

Commit 0c6c218

Browse files
committed
ci(spack): use spack/setup-spack with buildcache
Replaces the manual spack + spack-packages clone + cache plumbing with the official spack/setup-spack@v3 action. buildcache: true pulls pre-built binaries from spack/github-actions-buildcache for common deps (cantera, boost, fftw, openblas, ...), cutting cold-cache wall time from ~1.5h to minutes when cache hits are available.
1 parent 6f306ba commit 0c6c218

1 file changed

Lines changed: 8 additions & 27 deletions

File tree

.github/workflows/spack.yml

Lines changed: 8 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -12,37 +12,20 @@ jobs:
1212
steps:
1313
- uses: actions/checkout@v4
1414

15-
- name: Check out Spack
16-
uses: actions/checkout@v4
15+
- name: Set up Spack with buildcache
16+
uses: spack/setup-spack@v3
1717
with:
18-
repository: spack/spack
19-
path: spack
20-
21-
- name: Check out spack-packages (sbryngelson/add-mfc until upstream merges)
22-
uses: actions/checkout@v4
23-
with:
24-
repository: sbryngelson/spack-packages
25-
ref: add-mfc
26-
path: spack-packages
27-
28-
- name: Cache Spack store
29-
uses: actions/cache@v4
30-
with:
31-
path: |
32-
spack/opt
33-
spack/var/spack/cache
34-
key: spack-mfc-${{ 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-mfc-${{ runner.os }}-
18+
# Pin to the sbryngelson/add-mfc branch until upstream
19+
# spack/spack-packages merges the mfc recipe.
20+
packages_repository: sbryngelson/spack-packages
21+
packages_ref: add-mfc
22+
buildcache: true
3623

3724
- name: Install mfc+chemistry~mpi
38-
run: |
39-
source spack/share/spack/setup-env.sh
40-
spack repo add --scope=site spack-packages/repos/spack_repo/builtin
41-
spack install --reuse mfc+chemistry~mpi
25+
run: spack install --reuse mfc+chemistry~mpi
4226

4327
- name: Smoke test
4428
run: |
45-
source spack/share/spack/setup-env.sh
4629
spack load mfc
4730
prefix="$(spack location -i mfc)"
4831
echo "MFC prefix: $prefix"
@@ -52,8 +35,6 @@ jobs:
5235
done
5336
test -x "$prefix/bin/mfc" || { echo "missing shim: mfc"; exit 1; }
5437
echo "found shim: $prefix/bin/mfc"
55-
# Validate a small example case file through MFC's toolchain
56-
# (exercises Python venv-skip + PYTHONPATH wiring under MFC_PREBUILT_PREFIX).
5738
cd "$prefix/share/mfc"
5839
./mfc.sh run --prebuilt-prefix="$prefix" \
5940
--no-mpi --dry-run \

0 commit comments

Comments
 (0)