Skip to content

Update CI in MOM_interface so that "check_standalone_mom_build_and_run_lightweight_examples" works on MOM_interface forks #143

Update CI in MOM_interface so that "check_standalone_mom_build_and_run_lightweight_examples" works on MOM_interface forks

Update CI in MOM_interface so that "check_standalone_mom_build_and_run_lightweight_examples" works on MOM_interface forks #143

name: General MOM_interface CI
# Please see Issue #138 for more information on this CI workflow
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the listed branches
push:
branches: ["main" ]
pull_request:
branches: [ "main" ]
jobs:
check_standalone_mom_build_and_run_lightweight_examples:
# The type of runner that the job will run on
runs-on: ubuntu-latest
steps:
# Copied from NCAR/MOM6 - Install Basic Build Packages for MOM6
- name: Install Ubuntu Linux packages
shell: bash
run: |
echo "::group::Install linux packages"
sudo apt-get update
sudo apt-get install netcdf-bin
sudo apt-get install libnetcdf-dev
sudo apt-get install libnetcdff-dev
sudo apt-get install openmpi-bin
sudo apt-get install libopenmpi-dev
sudo apt-get install linux-tools-common
sudo apt-get install -y csh
echo "::endgroup::"
- name: Checkout MOM_interface to temp folder
uses: actions/checkout@v4
with:
submodules: recursive
path: MOM_interface_temp
# Checkout CESM (default branch) and externals
- name: Checkout CESM
uses: actions/checkout@v4
with:
repository: ESCOMP/CESM
path: CESM
# Run git-fleximod
- name: Checkout CESM Submodules
env:
GIT_CLONE_PROTECTION_ACTIVE: false
run: |
cd CESM
./bin/git-fleximod update
- name: Check submodule hash consistency (Seperate Test)
run: |
echo "Checking if .gitmodules and external hashes are consistent"
cd $GITHUB_WORKSPACE/CESM/components/mom/
../../bin/git-fleximod test
# Copy the correct MOM_interface Branch to the CESM
- name: Copy the current MOM_interface to the correct place in CESM
run: |
cp -r $GITHUB_WORKSPACE/MOM_interface_temp/* $GITHUB_WORKSPACE/CESM/components/mom/
# Build the standalone mom using the ubuntu script.
- name: Build Standalone MOM
run: |
cd $GITHUB_WORKSPACE/CESM/components/mom/standalone/build
./build_examples.sh --compiler gnu --machine ubuntu
# CD into a couple MOM examples and run MOM in them. These are very light weight and quick.
- name: Run Double Gyre Test
run: |
cd $GITHUB_WORKSPACE/CESM/components/mom/standalone/examples/double_gyre
$GITHUB_WORKSPACE/CESM/components/mom/standalone/build/gnu/MOM6/MOM6
- name: Run Single Column KPP Test
run: |
cd $GITHUB_WORKSPACE/CESM/components/mom/standalone/examples/single_column/KPP
$GITHUB_WORKSPACE/CESM/components/mom/standalone/build/gnu/MOM6/MOM6
# Job to run the check_default_params script, which is a test
check_default_params:
runs-on: ubuntu-latest
steps:
# Checkout the repo
- uses: actions/checkout@v4
# Run the test
- name: Run the check_default_params script
run: python tests/check_default_params.py
# Job to run check_input_data_list script
check_input_data_list:
runs-on: ubuntu-latest
steps:
# Checkout the repo
- uses: actions/checkout@v4
# Run the test
- name: Run the check_input_data_list script
run: python tests/check_input_data_list.py
# Job to run check_input_data_repo script
check_input_data_repo:
runs-on: ubuntu-latest
steps:
# Checkout the repo
- uses: actions/checkout@v4
# Run the test
- name: Run the check_input_data_repo script
run: |
sudo apt-get update && sudo apt-get install -y subversion
pip install 'svn>=1,<1.1'
python tests/check_input_data_repo.py
# Job to run the black formatter for cime_config, see black documentation for more info
check_black_format_for_cime_config:
runs-on: ubuntu-latest
steps:
# Checkout the repo
- uses: actions/checkout@v4
# Run black check
- uses: psf/black@stable
with:
options: "--check --verbose"
src: "./cime_config"