Skip to content

test CI

test CI #50

Workflow file for this run

# This is a CI workflow for the NCEPLIBS-ip project.
#
# This workflow builds ip with Spack, including installing with the "--test
# root" option to run the CTest suite. It also has a one-off job that validates
# the recipe by ensuring that every CMake option that should be set in the
# Spack recipe is so set.
#
# Alex Richert, Sep 2023
name: Spack
on:
push:
branches:
- develop
pull_request:
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"]
runs-on: ${{ matrix.os }}
permissions:
contents: read
packages: write
steps:
- name: "Test with Spack"
uses: NOAA-EMC/spack-package-test@develop
with:
package-name: ip
package-variants: ${{ matrix.variants }}
spack-compiler: gcc@11
cache-secret: ${{ secrets.GITHUB_TOKEN }}
upload-artifacts: always
custom-recipe: spack/package.py
spack-ref: 6f7eb3750cc100dc9cd6c02730d16ff8eb0c2d9e
# This job validates the Spack recipe by making sure each cmake build option is represented
recipe-check:
runs-on: ubuntu-latest
steps:
- name: checkout-ip
uses: actions/checkout@v4
with:
path: ip
- 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|TEST_TIME_LIMIT))[^ ]+' $GITHUB_WORKSPACE/ip/CMakeLists.txt) ; do
echo "Checking for presence of '$opt' CMake option in package.py"
grep -cP "define.+\b${opt}\b" $GITHUB_WORKSPACE/ip/spack/package.py
done