Merge pull request #204 from AlexanderRichert-NOAA/cmake_spack_updates #247
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a CI workflow for the NCEPLIBS-ip project. | |
# | |
# This workflow builds on MacOS with different options. | |
# | |
# Ed Hartnett, 1/8/23 | |
name: MacOS | |
on: | |
push: | |
branches: | |
- develop | |
pull_request: | |
branches: | |
- develop | |
jobs: | |
MacOS: | |
runs-on: macos-latest | |
env: | |
FC: gfortran-11 | |
CC: gcc-11 | |
strategy: | |
matrix: | |
openmp: [ ON, OFF ] | |
sharedlibs: [ON, OFF] | |
steps: | |
- name: cache-sp | |
id: cache-sp | |
uses: actions/cache@v2 | |
with: | |
path: ~/sp | |
key: sp-${{ matrix.openmp }}-MacOS-2.3.3-1 | |
- name: checkout-sp | |
if: steps.cache-sp.outputs.cache-hit != 'true' | |
uses: actions/checkout@v2 | |
with: | |
repository: NOAA-EMC/NCEPLIBS-sp | |
path: sp | |
ref: v2.3.3 | |
- name: build-sp | |
if: steps.cache-sp.outputs.cache-hit != 'true' | |
run: | | |
cd sp | |
mkdir build | |
cd build | |
cmake -DOPENMP=${{ matrix.openmp }} -DCMAKE_INSTALL_PREFIX=~/sp -DBUILD_SHARED_LIBS=${{ matrix.sharedlibs }} -DBUILD_8=ON .. | |
make -j2 | |
make install | |
ls -l ~/sp | |
ls -l ~/sp/lib | |
- name: checkout | |
uses: actions/checkout@v2 | |
with: | |
path: ip | |
- name: build | |
run: | | |
cd ip | |
mkdir build | |
cd build | |
cmake -DOPENMP=${{ matrix.openmp }} -DCMAKE_PREFIX_PATH="~/sp" -DBUILD_SHARED_LIBS=${{ matrix.sharedlibs }} -DCMAKE_INSTALL_PREFIX=~/install -DBUILD_8=ON .. | |
make -j2 VERBOSE=2 | |
make install | |
ls -l ~/install | |
ls -l ~/install/lib | |
- name: test | |
run: | | |
cd $GITHUB_WORKSPACE/ip/build | |
ctest --verbose --output-on-failure --rerun-failed |