Skip to content

Changed Build Script #31

Changed Build Script

Changed Build Script #31

name: General MOM_interface CI
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the listed branches
push:
branches: ["138-set-up-github-actions-ci-testing" ]
pull_request:
branches: [ "138-set-up-github-actions-ci-testing" ]
jobs:
# This workflow contains 4 jobs
# Build checks out MOM through the CESM and lets us run the standalone version
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
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::"
# Checkout CESM, Build MOM Standalone
- name: Checkout CESM and Externals
run: |
git clone https://github.com/ESCOMP/CESM.git -b cesm3_0_alpha03a cesm3_0_alpha03a
cd cesm3_0_alpha03a
./bin/git-fleximod update
- name: Setup upterm session
uses: lhotari/action-upterm@v1
- name: Checkout MOM Branch
run: |
cd $HOME/work/MOM_interface/MOM_interface/cesm3_0_alpha03a/components/mom/
git checkout main
- name: Build Standalone MOM
run: |
cd standalone/build
./build_examples-ncar.sh
# The takes the build we just made and runs the standalone mom
check_standalone_mom_lightweight_examples:
runs-on: ubuntu-latest
needs: build
steps:
# CDs into a couple MOM examples and runs MOM in them. These are very light weight.
- name: Run simple mom tests
run: |
cd $HOME/work/MOM_interface/MOM_interface/cesm3_0_alpha03a/components/mom/standalone/examples/double_gyre
$HOME/work/MOM_interface/MOM_interface/cesm3_0_alpha03a/components/mom/standalone/build/intel/MOM6/MOM6
cd $HOME/work/MOM_interface/MOM_interface/cesm3_0_alpha03a/components/mom/standalone/examples/single_column/KPP
$HOME/work/MOM_interface/MOM_interface/cesm3_0_alpha03a/components/mom/standalone/build/intel/MOM6/MOM6
# Job to run the check_default_params test
check_default_params_job:
runs-on: ubuntu-latest
# This runs the check_default_params test
steps:
# Checkout the repo
- uses: actions/checkout@v4
# Runs the test
- name: Run the check_default_params script
run: python tests/check_default_params.py
# Job to run the black formatter for cime_config
check_black_format_for_cime_config:
runs-on: ubuntu-latest
# This performs black formatting checks in the cime_config folder
steps:
# Checkout the repo
- uses: actions/checkout@v4
# Run black check
- uses: psf/black@stable
with:
options: "--check --verbose"
src: "./cime_config"