Skip to content

CI updates

CI updates #7

Workflow file for this run

# This is a CI workflow for the NCEPLIBS-sfcio project.
#
# This workflow builds sfcio with Spack, including installing with the "--test
# root" option to run the pFunit test. 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
jobs:
Spack:
strategy:
matrix:
os: ["ubuntu-latest"]
runs-on: ${{ matrix.os }}
steps:
- name: "Build Spack package"
uses: NOAA-EMC/ci-test-spack-package@develop
with:
package-name: sfcio
package-variants: +pfunit
custom-recipe: spack/package.py
use-repo-cache: true
spack-compiler: gcc
spack-externals: cmake gmake python perl m4
repo-cache-key-suffix: ${{ matrix.os }}-${{ matrix.variants }}-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-sfcio
uses: actions/checkout@v4
with:
path: sfcio
- 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/sfcio/CMakeLists.txt) ; do
echo "Checking for presence of '$opt' CMake option in package.py"
grep -cP "define.+\b${opt}\b" $GITHUB_WORKSPACE/sfcio/spack/package.py
done