forked from CICE-Consortium/CICE
-
Notifications
You must be signed in to change notification settings - Fork 0
179 lines (175 loc) · 6.05 KB
/
test-cice.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
name: GHActions
# This workflow is triggered on pushes, pull-requeust, and releases
# ghactions* branch names will trigger this to support development testing
# To Do: get it working with bash and ubuntu
on:
push:
branches:
- main
- 'CICE*'
- 'ghactions*'
pull_request:
release:
types:
- created
defaults:
run:
shell: /bin/csh -e {0}
jobs:
build:
name: "CICETesting"
runs-on: ${{ matrix.os }}
strategy:
matrix:
# os: [macos-latest, ubuntu-latest]
os: [macos-latest]
# os: [macos-13]
# os: [ubuntu-latest]
include:
# - os: macos-13
# envdef: macos
# minicond: Miniconda3-latest-MacOSX-x86_64.sh
- os: macos-latest
envdef: macos
minicond: Miniconda3-latest-MacOSX-x86_64.sh
# - os: ubuntu-latest
# envdef: linux
# minicond: Miniconda3-latest-Linux-x86_64.sh
steps:
- name: reset macos toolchain to commandlinetools
shell: /bin/bash {0}
if: contains( matrix.envdef, 'macos')
run: |
sudo xcode-select -r
sudo xcode-select -s /Library/Developer/CommandLineTools
sudo ln -s /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/* /usr/local/include/
echo "xcrun --show-sdk-path: $(xcrun --show-sdk-path)"
echo "xcode-select -p: $(xcode-select -p)"
- name: system info
shell: /bin/bash {0}
run: |
type wget
type curl
type csh
echo "readlink \$(which csh): $(python -c 'import os, sys; print os.path.realpath(sys.argv[1])' $(which csh))"
echo "csh --version: $(csh --version)"
echo "uname -a: $(uname -a)"
echo "sw_vers: $(sw_vers)"
echo "HOME: $HOME"
echo "GITHUB_WORKSPACE: $GITHUB_WORKSPACE"
echo "OS: ${{ matrix.os }}"
echo "ENVDEF: ${{ matrix.envdef }}"
echo "MINICOND: ${{ matrix.minicond }}"
- name : install miniconda
shell: /bin/bash {0}
run: |
wget https://repo.anaconda.com/miniconda/${{ matrix.minicond }} -O ~/miniconda.sh
bash ~/miniconda.sh -b -p $HOME/miniconda
- name: clone
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: link
run: |
ln -s ${GITHUB_WORKSPACE}/../CICE ${HOME}/cice
# ls -al ${HOME}/
# ls -al ${GITHUB_WORKSPACE}/
- name: check for tabs
run: |
cd $HOME/cice/cicecore
set cnt = 0
set ffiles = `find -P . -iname "*.f*"`
set cfiles = `find -P . -iname "*.c*"`
foreach file ($ffiles $cfiles)
set fcnt = `sed -n '/\t/p' $file | wc -l`
@ cnt = $cnt + $fcnt
if ($fcnt > 0) then
echo "TAB found: $fcnt $file"
endif
end
exit $cnt
- name: setup conda env
shell: /bin/bash {0}
run: |
cd $HOME && mkdir -p cice-dirs/runs cice-dirs/baseline cice-dirs/input
source $HOME/miniconda/bin/activate
conda init tcsh
cd $HOME/cice
conda env create -f configuration/scripts/machines/environment.yml
- name: check conda env
run: |
conda activate cice && which clang && which gfortran && which mpicc && which mpifort && which make
clang --version
gfortran --version
mpifort --version
mpicc --version
make --version
# echo "mpifort -v:"
# mpifort -v
# echo "mpifort --showme:compile:"
# mpifort --showme:compile
# echo "mpifort --showme:link:"
# mpifort --showme:link
# echo "mpifort --showme:command:"
# mpifort --showme:command
# echo "mpifort --showme:libdirs:"
# mpifort --showme:libdirs
# echo "mpifort --showme:libs:"
# mpifort --showme:libs
# echo "mpifort --showme:incdirs:"
# mpifort --showme:incdirs
- name: check setup case
run: |
cd $HOME/cice
./cice.setup -m conda -e ${{ matrix.envdef }} -c case0 --pes 1x1 -s diag1
- name: check setup test
run: |
cd $HOME/cice
./cice.setup -m conda -e ${{ matrix.envdef }} --test smoke --testid c0
- name: run hello world unit test
run: |
cd $HOME/cice
./cice.setup -m conda -e ${{ matrix.envdef }} --test unittest --pes 2x1 -s helloworld --testid hw01
cd *helloworld*hw01
./cice.build
./cice.run
- name: check cice compile
run: |
cd $HOME/cice
./cice.setup -m conda -e ${{ matrix.envdef }} -c case1 --pes 2x2 -s diag1
cd case1
./cice.build
- name: download input data
run: |
cd $HOME/cice-dirs/input
wget --progress=dot:giga https://zenodo.org/record/3728358/files/CICE_data_gx3_grid_ic-20200320.tar.gz && tar xvfz CICE_data_gx3_grid_ic-20200320.tar.gz
wget --progress=dot:giga https://zenodo.org/records/10419929/files/CICE_data_gx3_forcing_JRA55_200501_20231220.tar.gz && tar xvfz CICE_data_gx3_forcing_JRA55_200501_20231220.tar.gz
pwd
cd CICE_data/forcing/gx3/JRA55/8XDAILY
ln -s JRA55_gx3_03hr_forcing_200501.nc JRA55_gx3_03hr_forcing_2005.nc
cd $HOME/cice-dirs/input
ls -alR
# - name: run case
# run: |
# cd $HOME/cice
# cd case1
# ./cice.run
- name: run suite
run: |
cd $HOME/cice
./cice.setup -m conda -e ${{ matrix.envdef }} --suite travis_suite --testid ${{ matrix.os }}
- name: write output
run: |
cd $HOME/cice
./.github/workflows/write_logfiles.csh
cd testsuite.${{ matrix.os }}
./results.csh
- name: successful run
if: ${{ success() }}
run: |
echo "${{ job.name }} PASSED"
- name: trap failure
if: ${{ failure() }}
run: |
echo "${{ job.name }} FAILED"
exit 99