forked from ESCOMP/CMEPS
-
Notifications
You must be signed in to change notification settings - Fork 20
177 lines (163 loc) · 6.11 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
# 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.1
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@v4
with:
repository: ESCOMP/CESM
path: cesm
# this cmeps commit
- name: cmeps checkout
uses: actions/checkout@v4
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
./bin/git-fleximod update ccs_config cdeps share mct parallelio
cd ccs_config
git checkout main
cd ../
git clone https://github.com/ESMCI/cime
cd cime
if [[ ! -e "${PWD}/.gitmodules.bak" ]]
then
echo "Converting [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
git submodule update --init
cd ../../share
git checkout main
- name: Cache ESMF
id: cache-esmf
uses: actions/cache@v4
with:
path: ~/ESMF
key: ${{ runner.os }}-${{ env.ESMF_VERSION }}
- name: Cache ParallelIO
id: cache-ParallelIO
uses: actions/cache@v4
with:
path: ${GITHUB_WORKSPACE}/pio
key: ${{ runner.os }}-${{ env.PARALLELIO_VERSION }}.parallelio
- name: Cache inputdata
id: cache-inputdata
uses: actions/cache@v4
with:
path: $HOME/cesm/inputdata
key: inputdata
- 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: ${GITHUB_WORKSPACE}/pio
- name: Install ESMF
uses: esmf-org/install-esmf-action@v1
env:
ESMF_COMPILER: gfortran
ESMF_BOPT: g
ESMF_COMM: openmpi
ESMF_NETCDF: nc-config
ESMF_PNETCDF: pnetcdf-config
ESMF_INSTALL_PREFIX: ${GITHUB_WORKSPACE}/ESMF
ESMF_PIO: external
ESMF_PIO_INCLUDE: ${GITHUB_WORKSPACE}/pio/include
ESMF_PIO_LIBPATH: ${GITHUB_WORKSPACE}/pio/lib
with:
version: ${{ env.ESMF_VERSION }}
esmpy: false
cache: true
- 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=$GITHUB_WORKSPACE/pio/include
export PIO_LIBDIR=$GITHUB_WORKSPACE/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
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