Skip to content

Update cobalt_ci.yml #44

Update cobalt_ci.yml

Update cobalt_ci.yml #44

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: cobalt CI
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "dev/cefi" branch
push:
branches: [ "develop" ]
pull_request:
branches: [ "dev/cefi" ]
# Allows you to run this workflow manually from the Actions tab
#workflow_dispatch:
env:
BRANCH_NAME: develop
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# define container
#container:
# image: clouden90/1d_mom6_cobalt:base
# options: --user root
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout Repository
uses: actions/checkout@v3
with:
submodules: recursive
# git clone MOM6_OBGC_examples and replace ocean_BGC
- name: git clone MOM6_OBGC_examples
run: |
cd ..
git clone -b $BRANCH_NAME https://github.com/NOAA-CEFI-Regional-Ocean-Modeling/MOM6_OBGC_examples.git --recursive
rm -rf MOM6_OBGC_examples/src/ocean_BGC
cp -r ocean_BGC MOM6_OBGC_examples/src
# run 1D mom6sis2-cobalt test
- name: Build 1D mom6sis2-cobalt Docker Image
run: |
echo "docker image build ..."
cd ../MOM6_OBGC_examples
docker build --file "./ci/docker/Dockerfile.ci" -t mom6_obgc_1d:develop .
- name: Check mom6_obgc 1D Docker Image build
run: |
docker images
if [[ $(docker image inspect mom6_obgc_1d:develop) ]]; then
echo "mom6_obgc_1d:develop generated ..."
else
echo "mom6_obgc_1d:develop was not generated ..."
exit 1
fi
#cd ../MOM6_OBGC_examples/exps/OM4.single_column.COBALT.p4
#mkdir -p ref
#cp ../../src/ocean_BGC/.github/ref/OM4.single_column.COBALT.p4/docker-linux-gnu/* ./ref
# check ocean.stats
#echo "Check with ref ocean.stats"
#diff -q ref/ocean.stats ./ocean.stats > /dev/null || { echo "Error: ocean.stats are different, check and update ref! Exiting now..."; exit 1; }
# check MOM.res.nc
#echo "check with ref MOM.res.nc"
#ncdump ref/MOM.res.nc > org_ref.txt
#ncdump RESTART/MOM.res.nc > new_ref.txt
#diff -q ./org_ref.txt ./new_ref.txt > /dev/null || { echo "Error: MOM.res.nc are different, check and update ref! Exiting now..."; exit 1; }
#rm org_ref.txt && rm new_ref.txt
# check with ref ocean_cobalt_airsea_flux.res.nc
#echo "check with ref ocean_cobalt_airsea_flux.res.nc"
#ncdump ref/ocean_cobalt_airsea_flux.res.nc > org_ref.txt
#ncdump RESTART/ocean_cobalt_airsea_flux.res.nc > new_ref.txt
#diff -q ./org_ref.txt ./new_ref.txt > /dev/null || { echo "Error: ocean_cobalt_airsea_flux.res.nc are different, check and update ref! Exiting now..."; exit 1; }
#rm org_ref.txt && rm new_ref.txt
# check with ref ice_cobalt.res.nc
#echo "check with ref ice_cobalt.res.nc"
#ncdump ref/ice_cobalt.res.nc > org_ref.txt
#ncdump RESTART/ice_cobalt.res.nc > new_ref.txt
#diff -q ./org_ref.txt ./new_ref.txt > /dev/null || { echo "Error: ice_cobalt.res.nc are different, check and update ref! Exiting now..."; exit 1; }
#rm org_ref.txt && rm new_ref.txt
# check with ref ice_model.res.nc
#echo "check with ref ice_model.res.nc"
#ncdump ref/ice_model.res.nc > org_ref.txt
#ncdump RESTART/ice_model.res.nc > new_ref.txt
#diff -q ./org_ref.txt ./new_ref.txt > /dev/null || { echo "Error: ice_model.res.nc are different, check and update ref! Exiting now..."; exit 1; }
#rm org_ref.txt && rm new_ref.txt