forked from CESM-Development/cime
-
Notifications
You must be signed in to change notification settings - Fork 1
99 lines (88 loc) · 3.45 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
# 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 master branch
on:
push:
branches: [ master, maint-5.6 ]
pull_request:
branches: [ master, maint-5.6 ]
# 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 2.7 has been removed
python-version: ["3.8", "3.10"]
env:
CC: mpicc
FC: mpifort
CXX: mpicxx
CPPFLAGS: "-I/usr/include -I/usr/local/include"
# Versions of all dependencies can be updated here
FCFLAGS: "-ffree-form -ffree-line-length-none -fallow-argument-mismatch"
NETCDF_FORTRAN_VERSION: v4.5.2
NETCDF_C_PATH: /usr
NETCDF_FORTRAN_PATH: ${HOME}/netcdf-fortran
CIME_MODEL: cesm
# 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
- uses: actions/checkout@v2
- id: load-env
run: |
sudo apt-get update
sudo apt-get install libxml2-utils wget gfortran openmpi-bin netcdf-bin libopenmpi-dev cmake libnetcdf-dev pylint
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Cache netcdf-fortran
id: cache-netcdf-fortran
uses: actions/cache@v2
with:
path: ~/netcdf-fortran
key: ${{ runner.os }}-${{ env.NETCDF_FORTRAN_VERSION }}-netcdf-fortran-redo
- name: netcdf fortran build
if: steps.cache-netcdf-fortran.outputs.cache-hit != 'true'
run: |
sudo apt-get install libnetcdf-dev
wget https://github.com/Unidata/netcdf-fortran/archive/${{ env.NETCDF_FORTRAN_VERSION }}.tar.gz
tar -xzvf ${{ env.NETCDF_FORTRAN_VERSION }}.tar.gz
ls -l
pushd netcdf-fortran-*
./configure --prefix=$HOME/netcdf-fortran
make
make install
- name: link netcdf-c to netcdf-fortran path
# link netcdf c library here to simplify build
run: |
pushd ${{ env.NETCDF_FORTRAN_PATH }}/include
ln -fs /usr/include/*netcdf* .
pushd ${{ env.NETCDF_FORTRAN_PATH }}/lib
clibdir=`nc-config --libdir`
ln -fs $clibdir/lib* .
- name: Cache inputdata
id: cache-inputdata
uses: actions/cache@v2
with:
path: $HOME/cesm/inputdata
key: inputdata
#
- name: scripts regression tests
run: |
mkdir -p $HOME/cesm/scratch
mkdir -p $HOME/cesm/inputdata
cd $HOME/work/cime/cime/scripts/tests
export NETCDF=$HOME/netcdf-fortran
export PATH=$NETCDF/bin:$PATH
export LD_LIBRARY_PATH=$NETCDF/lib:$LD_LIBRARY_PATH
./scripts_regression_tests.py --no-fortran-run --compiler gnu --mpilib openmpi --machine ubuntu-latest
# 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