-
Notifications
You must be signed in to change notification settings - Fork 96
125 lines (109 loc) · 3.51 KB
/
CI.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
name: CI
on: [push, pull_request]
env:
CI: "ON" # We can detect this in the build system and other vendors implement it
jobs:
build:
strategy:
fail-fast: true
matrix:
os: [ ubuntu-20.04 ]
# gcc_v: [8, 9] # Version of GFortran we want to use.
TYPE:
- MOM_solo
- MOM_SIS
- CM2M
- ESM2M
- ICCM
# # - EBM
- ACCESS-OM
- ACCESS-CM
- ACCESS-OM-BGC
- ACCESS-ESM
runs-on: ${{ matrix.os }}
env:
# FC: gfortran-${{ matrix.gcc_v }}
# OMPI_FC: gfortran-${{ matrix.gcc_v }}
# GCC_V: ${{ matrix.gcc_v }}
FC: gfortran
OMPI_FC: gfortran
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get -yqq install csh gfortran libgomp1 openmpi-bin libopenmpi-dev libnetcdf-dev libnetcdff-dev netcdf-bin
- name: Determing OS version
uses: kenchan0130/actions-system-info@master
id: system-info
- name: Set OS version
run: |
echo "Release: ${{ steps.system-info.outputs.release }}"
echo "os_version=${{ steps.system-info.outputs.release }}" >> $GITHUB_ENV
# ----------
# ACCESS only models
- name: Download OASIS
if: startsWith(matrix.TYPE, 'ACCESS-')
uses: actions/checkout@v2
with:
repository: COSIMA/oasis3-mct
path: oasis3-mct
- name: Compile OASIS
if: startsWith(matrix.TYPE, 'ACCESS-')
working-directory: ./oasis3-mct
run: |
make ubuntu
echo "oasis_dir=${{ github.workspace }}/oasis3-mct/Linux" >> $GITHUB_ENV
# ----------
# ----------
# ACCESS-OM only models
- name: Download libaccessom2
if: startsWith(matrix.TYPE, 'ACCESS-OM')
run: |
wget https://github.com/COSIMA/libaccessom2/releases/latest/download/binary_release_${{ env.os_version }}.tar.gz
- name: Untar libaccessom2
if: startsWith(matrix.TYPE, 'ACCESS-OM')
run: |
tar -zvxf binary_release_${{ env.os_version }}.tar.gz
echo "libaccessom2_dir=${{ github.workspace }}/libaccessom2" >> $GITHUB_ENV
# ----------
- name: Compile
working-directory: ./exp
env:
OASIS_ROOT: ${{ env.oasis_dir }}
LIBACCESSOM2_ROOT: ${{ env.libaccessom2_dir }}
run: |
env
case "${{ matrix.TYPE }}" in
CM2M|ICCM|ESM2M)
debug=""
;;
*)
debug="--debug"
;;
esac
echo ./MOM_compile.csh $debug --type ${{ matrix.TYPE }} --platform github --use_netcdf4
./MOM_compile.csh $debug --type ${{ matrix.TYPE }} --platform github --use_netcdf4
# ----------
# Test MOM-solo only currently
- name: Download config
if: startsWith(matrix.TYPE, 'MOM_solo')
uses: actions/checkout@v2
with:
repository: mom-ocean/MOM5-examples
ref: master
path: MOM5-examples
- name: Run bowl1 cold start
if: startsWith(matrix.TYPE, 'MOM_solo')
working-directory: MOM5-examples/bowl1
run: |
mpirun -n 4 --oversubscribe ${{ github.workspace }}/exec/github/MOM_solo/fms_MOM_solo.x
rm *.nc.*
mv RESTART/* INPUT
- name: Run bowl1 warm start
if: startsWith(matrix.TYPE, 'MOM_solo')
working-directory: MOM5-examples/bowl1
run: |
mpirun -n 4 --oversubscribe ${{ github.workspace }}/exec/github/MOM_solo/fms_MOM_solo.x
# ----------