From 0d8b1019236c72ef1e172a82e4dd4c097d3373ef Mon Sep 17 00:00:00 2001 From: Alex Richert Date: Wed, 22 May 2024 11:06:53 -0700 Subject: [PATCH] update Spack.yml --- .github/workflows/Spack.yml | 46 +++++++++++-------------------------- 1 file changed, 13 insertions(+), 33 deletions(-) diff --git a/.github/workflows/Spack.yml b/.github/workflows/Spack.yml index 3029cbd..52462e4 100644 --- a/.github/workflows/Spack.yml +++ b/.github/workflows/Spack.yml @@ -24,29 +24,16 @@ jobs: runs-on: ${{ matrix.os }} steps: - - - name: checkout-landsfcutil - uses: actions/checkout@v4 - with: - path: landsfcutil - - name: spack-build-and-test - run: | - git clone -c feature.manyFiles=true https://github.com/jcsda/spack - . spack/share/spack/setup-env.sh - spack env create landsfcutil-env - spack env activate landsfcutil-env - cp $GITHUB_WORKSPACE/landsfcutil/spack/package.py $SPACK_ROOT/var/spack/repos/builtin/packages/landsfcutil/package.py - spack develop --no-clone --path $GITHUB_WORKSPACE/landsfcutil landsfcutil@develop - spack add landsfcutil@develop%gcc@11 +pfunit - spack external find cmake gmake m4 python - spack concretize - # Run installation and run pFunit testing - spack install --verbose --fail-fast --test root - # Run 'spack load' to check for obvious errors in setup_run_environment - spack load landsfcutil - ls $LANDSFCUTIL_LIB - ls $LANDSFCUTIL_LIB4 + - name: "Build Spack package" + uses: NOAA-EMC/ci-test-spack-package@develop + with: + package-name: bacio + package-variants: +pfunit + custom-recipe: spack/package.py + spack-compiler: gcc + spack-externals: cmake gmake m4 python perl + repo-cache-key-suffix: ${{ matrix.os }}-1 # This job validates the Spack recipe by making sure each cmake build option is represented recipe-check: @@ -54,15 +41,8 @@ jobs: steps: - - name: checkout-landsfcutil - uses: actions/checkout@v4 - with: - path: landsfcutil - - name: recipe-check - run: | - echo "If this jobs fails, look at the most recently output CMake option below and make sure that option appears in spack/package.py" - for opt in $(grep -ioP '^option\(\K(?!(DUMMY_ENTRY))[^ ]+' $GITHUB_WORKSPACE/landsfcutil/CMakeLists.txt) ; do - echo "Checking for presence of '$opt' CMake option in package.py" - grep -cP "define.+\b${opt}\b" $GITHUB_WORKSPACE/landsfcutil/spack/package.py - done + uses: NOAA-EMC/ci-check-spack-recipe@develop + with: + recipe-file: package/spack/package.py + cmakelists-txt: package/CMakeLists.txt