Setup continuous integration testing #21
Workflow file for this run
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
name: Test suite | |
on: | |
# Trigger the CI whenever a commit is pushed to main or develop, i.e., a PR is merged | |
push: | |
branches: [main, develop] | |
# Trigger the CI whenever a commit is pushed to an open PR | |
pull_request: | |
jobs: | |
# Test that GISS-GC can be compiled without error | |
compile: | |
runs-on: ubuntu-22.04 | |
container: | |
image: ghcr.io/fetch4/giss-gc-dev-env:latest | |
credentials: | |
username: ${{ github.actor }} | |
password: ${{ secrets.github_token }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Build GISS-GC with GISS_GC_14 rundeck | |
run: | | |
. /opt/spack-environment/activate.sh | |
# Environment variables for compiler | |
export CC=gcc | |
export CXX=g++ | |
export FC=gfortran | |
export F90=gfortran | |
export F77=gfortran | |
# Environment variables for GISS-GC | |
export GISS_HOME=$(pwd) | |
export RUNID=GISS_GC_14 | |
export ModelE_Support=/run | |
mkdir -p ${ModelE_Support} | |
# export ROOT=/data/ExtData/HEMCO # TODO: Do we need to download the inputs? | |
# Environment variables for passing NetCDF-C paths to GEOS-Chem | |
export NETCDF_HOME=$(nc-config --prefix) | |
export GC_BIN=${NETCDF_HOME}/bin | |
export GC_INCLUDE=${NETCDF_HOME}/include | |
export GC_LIB=${NETCDF_HOME}/lib | |
# Environment variables for passing NetCDF-Fortran paths to GEOS-Chem | |
export NETCDF_F_HOME=$(nf-config --prefix) | |
export GC_F_BIN=${NETCDF_F_HOME}/bin | |
export GC_F_INCLUDE=${NETCDF_F_HOME}/include | |
export GC_F_LIB=${NETCDF_F_HOME}/lib | |
# Environment variable for OpenMPI build | |
export MPI_ROOT=/opt/software/linux-ubuntu22.04-skylake/gcc-11.4.0/openmpi-4.1.6-s3fu5gvaasgjy4jecnb6rvemx7oofexx/ | |
# Misc settings | |
export F_UFMTENDIAN=big | |
export KMP_STACKSIZE=100000000 | |
export OMP_NUM_THREADS=36 | |
# Copy over rundeck and modelErc | |
cp .github/rundecks/GISS_GC_14.R ${GISS_HOME}/decks | |
cp .github/modelErc ~/.modelErc | |
# Make run directories | |
mkdir -p ~/run/exec | |
mkdir -p ~/run/huge_space | |
mkdir -p ~/run/prod_decks | |
mkdir -p ~/run/prod_input_files | |
mkdir -p ~/run/prod_runs | |
# Setup submodules | |
git config --global --add safe.directory /__w/GISS-GC/GISS-GC | |
git submodule init | |
git submodule update | |
# Build the model | |
cd ${GISS_HOME}/decks | |
apt install cpp m4 -y | |
make -j setup RUN=${RUNID} F90=mpif90 GC=YES |