-
Notifications
You must be signed in to change notification settings - Fork 79
194 lines (181 loc) · 7.07 KB
/
srt.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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
# CIME scripts regression tests
name: scripts regression tests
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the main branch
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
# 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
strategy:
matrix:
python-version: [ 3.10.9 ]
env:
CC: mpicc
FC: mpifort
CXX: mpicxx
CPPFLAGS: "-I/usr/include -I/usr/local/include "
LDFLAGS: "-L/usr/lib/x86_64-linux-gnu -lnetcdf -lnetcdff -lpnetcdf"
# Versions of all dependencies can be updated here
ESMF_VERSION: v8.6.0
PARALLELIO_VERSION: pio2_6_2
CIME_MODEL: cesm
CIME_DRIVER: nuopc
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# 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: Setup Ubuntu Environment
id: load-env
run: |
set -x
sudo apt-get update
sudo apt-get install libxml2-utils
sudo apt-get install netcdf-bin
sudo apt-get install libnetcdf-dev
sudo apt-get install libnetcdff-dev
sudo apt-get install pnetcdf-bin
sudo apt-get install libpnetcdf-dev
sudo apt-get install doxygen
sudo apt-get install graphviz
sudo apt-get install wget
sudo apt-get install gfortran
sudo apt-get install libjpeg-dev
sudo apt-get install libz-dev
sudo apt-get install openmpi-bin
sudo apt-get install libopenmpi-dev
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- run: echo "PyYAML" > requirements.txt
- name: Install PyYAML
run: pip install -r requirements.txt
# use the latest cesm main
- name: cesm checkout
uses: actions/checkout@v3
with:
repository: ESCOMP/CESM
path: cesm
# this cmeps commit
- name: cmeps checkout
uses: actions/checkout@v3
with:
path: cesm/components/cmeps
# Checkout cesm datamodels and support
# cpl7 is needed - i think that's a bug
- name: checkout externals
run: |
pushd cesm
./manage_externals/checkout_externals ccs_config cdeps share mct cpl7 parallelio
cd ccs_config
git checkout main
cd ../
git clone https://github.com/ESMCI/cime
if [[ ! -e "${PWD}/.gitmodules.bak" ]]
then
echo "Convering [email protected] to https://github.com urls in ${PWD}/.gitmodules"
sed -i".bak" "s/[email protected]:/https:\/\/github.com\//g" "${PWD}/.gitmodules"
fi
git submodule update --init
cd ../components/cdeps
git checkout main
- name: Cache ESMF
id: cache-esmf
uses: actions/cache@v3
with:
path: ~/ESMF
key: ${{ runner.os }}-${{ env.ESMF_VERSION }}-ESMF1
# - name: cache pnetcdf
# id: cache-pnetcdf
# uses: actions/cache@v3
# with:
# path: ~/pnetcdf
# key: ${{ runner.os }}-${{ env.PNETCDF_VERSION}}-pnetcdf
# - name: Cache netcdf-fortran
# id: cache-netcdf-fortran
# uses: actions/cache@v3
# with:
# path: ~/netcdf-fortran
# key: ${{ runner.os }}-${{ env.NETCDF_FORTRAN_VERSION }}-netcdf-fortran
- name: Cache ParallelIO
id: cache-ParallelIO
uses: actions/cache@v3
with:
path: ~/pio
key: ${{ runner.os }}-${{ env.PARALLELIO_VERSION }}.parallelio
- name: Cache inputdata
id: cache-inputdata
uses: actions/cache@v3
with:
path: $HOME/cesm/inputdata
key: inputdata
# - name: Build PNetCDF
# if: steps.cache-pnetcdf.outputs.cache-hit != 'true'
# uses: ESCOMP/CDEPS/.github/actions/buildpnetcdf@e06246b560d3132170bb1a5443fa3d65dfbd2040
# with:
# pnetcdf_version: ${{ env.PNETCDF_VERSION }}
# install_prefix: $HOME/pnetcdf
# - name: Build NetCDF Fortran
# if: steps.cache-netcdf-fortran.outputs.cache-hit != 'true'
# uses: ESCOMP/CDEPS/.github/actions/buildnetcdff@e06246b560d3132170bb1a5443fa3d65dfbd2040
# with:
# netcdf_fortran_version: ${{ env.NETCDF_FORTRAN_VERSION }}
# install_prefix: $HOME/netcdf-fortran
# netcdf_c_path: /usr
- name: Build ParallelIO
if: steps.cache-PARALLELIO.outputs.cache-hit != 'true'
uses: NCAR/ParallelIO/.github/actions/parallelio_cmake@05173a6556ea8d80eb34e3881a5014ea8f4b7543
with:
parallelio_version: ${{ env.ParallelIO_VERSION }}
enable_fortran: True
install_prefix: /home/runner/pio
- name: Build ESMF
if: steps.cache-esmf.outputs.cache-hit != 'true'
uses: ESCOMP/CDEPS/.github/actions/buildesmf@e06246b560d3132170bb1a5443fa3d65dfbd2040
with:
esmf_version: ${{ env.ESMF_VERSION }}
esmf_bopt: g
esmf_comm: openmpi
install_prefix: ~/ESMF
netcdf_c_path: /usr
netcdf_fortran_path: /usr
pnetcdf_path: /usr
parallelio_path: ~/pio
- name: PREP for scripts regression test
run: |
mkdir -p $HOME/cesm/scratch
mkdir -p $HOME/cesm/inputdata
pushd $GITHUB_WORKSPACE/cesm/cime/CIME/tests
export SRCROOT=$GITHUB_WORKSPACE/cesm/
export CIME_TEST_PLATFORM=ubuntu-latest
export PIO_INCDIR=$HOME/pio/include
export PIO_LIBDIR=$HOME/pio/lib
export PIO_VERSION_MAJOR=2
export PIO_TYPENAME_VALID_VALUES="netcdf,pnetcdf"
export NETCDF_PATH=/usr
export PNETCDF_PATH=/usr
export LD_LIBRARY_PATH=/usr/lib/libx86_64-linux-gnu/:$LD_LIBRARY_PATH
export ESMFMKFILE=$HOME/ESMF/lib/libg/Linux.gfortran.64.openmpi.default/esmf.mk
cat <<EOF >> $GITHUB_WORKSPACE/cesm/ccs_config/machines/cmake_macros/ubuntu-latest.cmake
set(NetCDF_Fortran_INCLUDE_DIR /usr/include)
set(NetCDF_Fortran_LIBRARY /usr/lib/x86_64-gnu-Linux/libnetcdff.so)
EOF
printenv >> $GITHUB_ENV
popd
- name: scripts regression tests
run: |
pushd $GITHUB_WORKSPACE/cesm/cime/CIME/tests
./scripts_regression_tests.py --no-fortran-run --compiler gnu --mpilib openmpi --machine ubuntu-latest
popd
# the following can be used by developers to login to the github server in case of errors
# see https://github.com/marketplace/actions/debugging-with-tmate for further details
# - name: Setup tmate session
# if: ${{ failure() }}
# uses: mxschmitt/action-tmate@v3