ci: add Spack install + smoke test workflow #45
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Spack | |
| on: | |
| push: | |
| pull_request: | |
| schedule: | |
| - cron: '17 3 * * 0' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| spack-install: | |
| name: Spack install + smoke test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Spack with buildcache | |
| uses: spack/setup-spack@v3 | |
| with: | |
| # Pinned to a specific commit of sbryngelson/spack-packages | |
| # until spack/spack-packages merges the mfc recipe. | |
| # Update this SHA when the recipe branch advances. | |
| packages_repository: sbryngelson/spack-packages | |
| packages_ref: f0bb11a611fb7f311e788da778208be234601797 | |
| buildcache: true | |
| - name: Cache Spack install store | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| spack/opt | |
| spack/var/spack/cache | |
| 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') }} | |
| restore-keys: spack-store-${{ runner.os }}- | |
| - name: Install mfc (defaults to +mpi +pre_process +simulation +post_process) | |
| run: spack install --reuse mfc | |
| - name: Smoke test | |
| run: | | |
| source spack/share/spack/setup-env.sh | |
| spack load mfc | |
| prefix="$(spack location -i mfc)" | |
| echo "MFC prefix: $prefix" | |
| for t in pre_process simulation post_process; do | |
| test -x "$prefix/bin/$t" || { echo "missing binary: $t"; exit 1; } | |
| echo "found: $prefix/bin/$t" | |
| done | |
| test -x "$prefix/bin/mfc" || { echo "missing shim: mfc"; exit 1; } | |
| echo "found shim: $prefix/bin/mfc" | |
| cd "$prefix/share/mfc" | |
| ./mfc.sh run --prebuilt-prefix="$prefix" \ | |
| --mpi -N 1 -n 1 --dry-run \ | |
| examples/1D_sodshocktube/case.py |