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 21, 2024
1 parent ed33134 commit 43b2b00
Showing 1 changed file with 14 additions and 50 deletions.
64 changes: 14 additions & 50 deletions .github/workflows/Spack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,62 +24,26 @@ jobs:

steps:

- name: checkout-wrf-io
uses: actions/checkout@v4
with:
path: wrf-io

- name: cache-spack
id: cache-spack
uses: actions/cache@v3
with:
path: ~/spack-build-cache
key: spack-build-cache-${{ matrix.os }}-1

- name: spack-build-and-test
run: |
cd
git clone -c feature.manyFiles=true https://github.com/jcsda/spack
. spack/share/spack/setup-env.sh
spack env create wrf-io-env
spack env activate wrf-io-env
cp $GITHUB_WORKSPACE/wrf-io/spack/package.py $SPACK_ROOT/var/spack/repos/builtin/packages/wrf-io/package.py
spack develop --no-clone --path $GITHUB_WORKSPACE/wrf-io wrf-io@develop
spack add wrf-io@develop%gcc@11 ^netcdf-c ~blosc ~szip ~mpi ^hdf5~mpi
spack external find cmake gmake openmpi
spack config add "packages:openmpi:buildable:false"
for mirror in $(spack mirror list | awk '{print $1}'); do
spack mirror rm --scope defaults ${mirror}
done
spack mirror add spack-build-cache ~/spack-build-cache
spack concretize
# Run installation and run CTest suite
if [ "${{ steps.cache.outputs.cache-hit }}" == true ]; then deps=only; else deps=auto; fi
spack install --verbose --fail-fast --no-check-signature --use-buildcache package:never,dependencies:${deps} --test root
spack buildcache push --only dependencies --unsigned --allow-root ~/spack-build-cache wrf-io
- name: Upload test results
uses: actions/upload-artifact@v3
if: ${{ failure() }}
- name: "Build Spack package"
uses: NOAA-EMC/ci-test-spack-package@develop
with:
name: spackci-ctest-output-${{ matrix.os }}-${{ matrix.openmp }}
path: ${{ github.workspace }}/wrf-io/spack-build-*/Testing/Temporary/LastTest.log
package-name: wrf-io
package-variants: "^netcdf-c ~blosc ~szip ~mpi ^hdf5~mpi"
custom-recipe: spack/package.py
use-repo-cache: true
spack-compiler: gcc
repo-cache-key-suffix: ${{ matrix.os }}-1
spack-externals: cmake gmake perl openmpi

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

steps:

- name: checkout-wrf-io
uses: actions/checkout@v4
with:
path: wrf-io

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

0 comments on commit 43b2b00

Please sign in to comment.