-
Notifications
You must be signed in to change notification settings - Fork 18
123 lines (95 loc) · 3.92 KB
/
general-ci-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
name: General MOM_interface CI
# This CI workflow tests against the following questions:
# 1. Does standalone mom build and run?
# 2. Does it pass the tests/check_default_params.py test?
# 3. Do the scripts in cime_config pass the black formatter?
# Please see Issue #138 for more information
# 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::"
# Checkout CESM (default branch) and externals
- name: Checkout CESM and Externals
run: |
git clone https://github.com/ESCOMP/CESM.git
cd CESM
./bin/git-fleximod update
# Checkout the correct MOM Branch
- name: Checkout initial event (Pull Request)
if: ${{ github.event_name == 'pull_request' }}
run: |
echo "Handling pull request"
cd $GITHUB_WORKSPACE/CESM/components/mom/
git fetch origin pull/${{ github.event.pull_request.number }}/head:pr-${{ github.event.pull_request.number }}
git checkout pr-${{ github.event.pull_request.number }}
- name: Checkout initial event (Push)
if: ${{ github.event_name == 'push' }}
run: |
echo "Handling push"
cd $GITHUB_WORKSPACE/CESM/components/mom/
git checkout ${{ github.sha }}
# Build the standalone mom using the macos script. build_examples-ncar doesn't work.
- 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 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"