Skip to content

Commit 6f306ba

Browse files
committed
ci: add Spack build + smoke test workflow
Installs MFC via Spack on Ubuntu (mfc+chemistry~mpi), verifies the three solver binaries plus the mfc shim land in prefix.bin, and runs mfc.sh run --prebuilt-prefix --dry-run on a tiny example case to exercise the venv-skip and PYTHONPATH wiring under MFC_PREBUILT_PREFIX (added in #1444). The workflow temporarily clones spack-packages from sbryngelson:add-mfc because the mfc recipe PR to upstream spack-packages is not merged yet. Once it lands, the checkout 'repository:'/'ref:' lines will be updated to spack/spack-packages / develop.
1 parent dd231ae commit 6f306ba

1 file changed

Lines changed: 60 additions & 0 deletions

File tree

.github/workflows/spack.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Spack
2+
on:
3+
push:
4+
pull_request:
5+
schedule:
6+
- cron: '17 3 * * 0'
7+
8+
jobs:
9+
spack-install:
10+
name: Spack install + smoke test
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Check out Spack
16+
uses: actions/checkout@v4
17+
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 }}-
36+
37+
- 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
42+
43+
- name: Smoke test
44+
run: |
45+
source spack/share/spack/setup-env.sh
46+
spack load mfc
47+
prefix="$(spack location -i mfc)"
48+
echo "MFC prefix: $prefix"
49+
for t in pre_process simulation post_process; do
50+
test -x "$prefix/bin/$t" || { echo "missing binary: $t"; exit 1; }
51+
echo "found: $prefix/bin/$t"
52+
done
53+
test -x "$prefix/bin/mfc" || { echo "missing shim: mfc"; exit 1; }
54+
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).
57+
cd "$prefix/share/mfc"
58+
./mfc.sh run --prebuilt-prefix="$prefix" \
59+
--no-mpi --dry-run \
60+
examples/1D_sodshocktube/case.py

0 commit comments

Comments
 (0)