-
Notifications
You must be signed in to change notification settings - Fork 4
68 lines (59 loc) · 2.12 KB
/
Spack.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# This is a CI workflow for the NCEPLIBS-gfsio project.
#
# This workflow builds gfsio 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: 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
# 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