From 4e8f50c6dcf15f861c8e7f974157e3d86c46f275 Mon Sep 17 00:00:00 2001 From: Alex Richert Date: Tue, 2 Apr 2024 09:50:33 -0700 Subject: [PATCH] test spack-package-test --- .github/workflows/Spack.yml | 38 +++++++++---------------------------- 1 file changed, 9 insertions(+), 29 deletions(-) diff --git a/.github/workflows/Spack.yml b/.github/workflows/Spack.yml index 7b9577d8..8b1c4cd6 100644 --- a/.github/workflows/Spack.yml +++ b/.github/workflows/Spack.yml @@ -15,45 +15,25 @@ on: branches: - develop +env: + ACTIONS_STEP_DEBUG: true + jobs: # This job builds with Spack using every combination of variants and runs the CTest suite each time Spack: strategy: matrix: os: ["ubuntu-latest"] - variants: ["+openmp +shared +pic precision=d", "+openmp ~shared ~pic precision=4", "~openmp ~shared +pic precision=8"] +# variants: ["+openmp +shared +pic precision=d", "+openmp ~shared ~pic precision=4", "~openmp ~shared +pic precision=8"] runs-on: ${{ matrix.os }} steps: - - name: checkout-ip - uses: actions/checkout@v4 - with: - path: ip - - - name: spack-build-and-test - run: | - sudo apt install libopenblas-serial-dev - git clone -c feature.manyFiles=true https://github.com/spack/spack - . spack/share/spack/setup-env.sh - spack env create ip-env - spack env activate ip-env - cp $GITHUB_WORKSPACE/ip/spack/package.py $SPACK_ROOT/var/spack/repos/builtin/packages/ip/package.py - spack develop --no-clone --path $GITHUB_WORKSPACE/ip ip@develop - spack add ip@develop%gcc@11 ${{ matrix.variants }} target=x86_64 - precision=$(echo ${{ matrix.variants }} | grep -oP " precision=\K[4d8]") - if [ "$precision" == "d" ]; then spack add grib-util@develop ; fi - spack external find cmake gmake - spack external find --path /usr/lib/x86_64-linux-gnu/openblas-serial openblas - spack config add "packages:lapack:buildable:false" - spack concretize - # Run installation and run CTest suite - spack install --fail-fast --test root - # Run 'spack load' and check that key build options were respected - spack load ip - if [[ "${{ matrix.variants }}" =~ "+shared" ]]; then suffix="so" ; else suffix="a"; fi - libvar=IP_LIB${precision} - ls ${!libvar} | grep -cE "/libip_${precision}\."$suffix'$' + - name: "Test with Spack" + uses: AlexanderRichert-NOAA/spack-package-test@v1 + with: + package-name: ip + dependents-to-test: grib-util # This job validates the Spack recipe by making sure each cmake build option is represented recipe-check: