Skip to content

Add Spack-based CI

Add Spack-based CI #3

Workflow file for this run

# This is a CI workflow for the NCEPLIBS-grib_util project.
#
# This workflow builds grib_util with Spack, including installing with the "--test
# root" option to run the CTest suite.
#
# Alex Richert, Sep 2023
name: Spack
on:
push:
branches:
- develop
pull_request:
branches:
- develop
jobs:
# This job builds with Spack using every combination of variants and runs the CTest suite each time
MacOS:
runs-on: macos-latest
strategy:
matrix:
openmp: ["+openmp", "~openmp"]
steps:
- name: checkout-grib-util
uses: actions/checkout@v4
with:
path: grib-util
- name: spack-build-and-test
run: |
git clone -c feature.manyFiles=true https://github.com/spack/spack
. spack/share/spack/setup-env.sh
spack env create grib-util-env $GITHUB_WORKSPACE/grib-util/spack/spack.yaml
spack env activate grib-util-env
cp $GITHUB_WORKSPACE/grib-util/spack/package.py $SPACK_ROOT/var/spack/repos/builtin/packages/grib-util/package.py
mv $GITHUB_WORKSPACE/grib-util $SPACK_ENV/grib-util
spack develop --no-clone grib-util@develop
spack add grib-util@develop%gcc@11 ${{ matrix.openmp }}
spack external find cmake gmake
spack concretize
spack install --verbose --test root