Skip to content

Commit

Permalink
update Spack.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderRichert-NOAA committed May 17, 2024
1 parent 48cf69e commit 2a772df
Showing 1 changed file with 12 additions and 33 deletions.
45 changes: 12 additions & 33 deletions .github/workflows/Spack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,44 +25,23 @@ jobs:

steps:

- name: checkout-gfsio
uses: actions/checkout@v4
with:
path: gfsio

- 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 gfsio-env
spack env activate gfsio-env
cp $GITHUB_WORKSPACE/gfsio/spack/package.py $SPACK_ROOT/var/spack/repos/builtin/packages/gfsio/package.py
spack develop --no-clone --path $GITHUB_WORKSPACE/gfsio gfsio@develop
spack add gfsio@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 gfsio
ls $GFSIO_LIB
ls $GFSIO_LIB4
- name: "Build Spack package"
uses: NOAA-EMC/ci-test-spack-package@develop
with:
package-name: gfsio
custom-recipe: spack/package.py
use-repo-cache: true
spack-compiler: gcc
repo-cache-key-suffix: ${{ matrix.os }}-1

# This job validates the Spack recipe by making sure each cmake build option is represented
recipe-check:
runs-on: ubuntu-latest

steps:

- name: checkout-gfsio
uses: actions/checkout@v4
with:
path: gfsio

- 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/gfsio/CMakeLists.txt) ; do
echo "Checking for presence of '$opt' CMake option in package.py"
grep -cP "define.+\b${opt}\b" $GITHUB_WORKSPACE/gfsio/spack/package.py
done
uses: NOAA-EMC/ci-check-spack-recipe@develop
with:
recipe-file: package/spack/package.py
cmakelists-txt: package/CMakeLists.txt

0 comments on commit 2a772df

Please sign in to comment.