Enable testing on Github Actions (#841) #44
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
# UFS_UTILS test workflow. | |
# | |
# Check UFS_UTILS build based on the NCEPLIBS project (deprecated, but still works). | |
# | |
# Ed Hartnett 12/13/22 | |
name: Linux_nceplibs | |
on: | |
push: | |
branches: | |
- develop | |
paths-ignore: | |
- README.md | |
pull_request: | |
branches: | |
- develop | |
paths-ignore: | |
- README.md | |
defaults: | |
run: | |
shell: bash -exo pipefail {0} | |
jobs: | |
Linux_nceplibs: | |
runs-on: ubuntu-latest | |
steps: | |
- name: install-dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install libmpich-dev libpng-dev libjpeg-dev | |
sudo apt-get install libnetcdf-dev libnetcdff-dev netcdf-bin pkg-config | |
- name: cache-esmf | |
id: cache-esmf | |
uses: actions/cache@v2 | |
with: | |
path: ~/esmf | |
key: esmf-8.2.0-${{ runner.os }}3 | |
- name: build-esmf | |
if: steps.cache-esmf.outputs.cache-hit != 'true' | |
run: | | |
pushd ~ | |
export ESMF_DIR=~/esmf-ESMF_8_2_0 | |
wget https://github.com/esmf-org/esmf/archive/ESMF_8_2_0.tar.gz &> /dev/null | |
tar zxf ESMF_8_2_0.tar.gz | |
cd esmf-ESMF_8_2_0 | |
export ESMF_COMM=mpich3 | |
export ESMF_INSTALL_BINDIR=bin | |
export ESMF_INSTALL_LIBDIR=lib | |
export ESMF_INSTALL_MODDIR=mod | |
export ESMF_COMPILER=gfortran | |
export ESMF_INSTALL_PREFIX=~/esmf | |
export ESMF_NETCDF=split | |
export ESMF_NETCDF_INCLUDE=/usr/include | |
export ESMF_NETCDF_LIBPATH=/usr/x86_64-linux-gnu | |
make -j2 | |
make install | |
- name: cache-jasper | |
id: cache-jasper | |
uses: actions/cache@v2 | |
with: | |
path: ~/jasper | |
key: jasper-2.0.25-${{ runner.os }}3 | |
- name: build-jasper | |
if: steps.cache-jasper.outputs.cache-hit != 'true' | |
run: | | |
wget https://github.com/jasper-software/jasper/archive/version-2.0.25.tar.gz &> /dev/null | |
tar zxf version-2.0.25.tar.gz | |
cd jasper-version-2.0.25 | |
mkdir build-jasper && cd build-jasper | |
cmake .. -DCMAKE_INSTALL_PREFIX=~/jasper -DJAS_ENABLE_SHARED=OFF | |
make -j2 | |
make install | |
- name: cache-nceplibs | |
id: cache-nceplibs | |
uses: actions/cache@v2 | |
with: | |
path: ~/nceplibs | |
key: nceplibs-1.4.0-${{ runner.os }}3 | |
- name: build-nceplibs | |
if: steps.cache-nceplibs.outputs.cache-hit != 'true' | |
run: | | |
wget https://github.com/NOAA-EMC/NCEPLIBS/archive/v1.4.0.tar.gz &> /dev/null | |
tar zxf v1.4.0.tar.gz | |
cd NCEPLIBS-1.4.0 | |
export ESMFMKFILE=~/esmf/lib/esmf.mk | |
mkdir build && cd build | |
cmake .. -DCMAKE_PREFIX_PATH='~;~/jasper' -DCMAKE_INSTALL_PREFIX='~/nceplibs' -DFLAT=ON | |
make -j2 | |
- name: checkout-ufs-utils | |
uses: actions/checkout@v2 | |
with: | |
path: ufs_utils | |
submodules: recursive | |
- name: cache-data | |
id: cache-data | |
uses: actions/cache@v2 | |
with: | |
path: ~/data | |
key: data-1 | |
- name: build | |
run: | | |
export ESMFMKFILE=~/esmf/lib/esmf.mk | |
cd ufs_utils | |
mkdir build && cd build | |
export CC=mpicc | |
export CXX=mpicxx | |
export FC=mpifort | |
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:~/jasper/lib;~/jasper/lib64" | |
cmake -DTEST_FILE_DIR=/home/runner/data -DCMAKE_PREFIX_PATH='~/jasper;~/nceplibs' .. | |
make -j2 | |
- name: test | |
run: | | |
cd ufs_utils/build | |
ctest --rerun-failed --output-on-failure |