-
Notifications
You must be signed in to change notification settings - Fork 13
173 lines (150 loc) · 4.74 KB
/
test_suite.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
name: compile code and tests
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
jobs:
test-ubuntu-serial:
runs-on: ubuntu-22.04
container:
image: ghcr.io/nextsimhub/nextsimdg-dev-env:latest
steps:
- uses: actions/checkout@v2
- name: build and compile without XIOS or MPI
run: |
. /opt/spack-environment/activate.sh
mkdir -p build && cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j 4
- name: installs for python tests
run: |
pip install numpy
pip install netCDF4
- name: run serial tests
run: |
. /opt/spack-environment/activate.sh
apt update
apt install -y wget
cd build
(cd core/test && wget "ftp://ftp.nersc.no/nextsim/netCDF/partition_metadata_1.nc")
for component in core physics dynamics
do
cd $component/test
for file in $(find test* -maxdepth 0 -type f)
do
echo $file
./$file
done
cd -
done
mv ../test .
cd test
python3 ThermoIntegration_test.py
./run_test_jan2010_integration_test.sh python3
test-ubuntu-mpi-noxios:
runs-on: ubuntu-22.04
container:
image: ghcr.io/nextsimhub/nextsimdg-dev-env:latest
steps:
- uses: actions/checkout@v2
- name: build and compile with MPI but not XIOS
run: |
. /opt/spack-environment/activate.sh
mkdir -p build && cd build
cmake -DENABLE_MPI=ON -DENABLE_XIOS=OFF -DCMAKE_CXX_COMPILER="$(which mpic++)" ..
make -j 4
- name: run MPI tests
run: |
. /opt/spack-environment/activate.sh
apt update
apt install -y wget
cd build
(cd core/test && wget "ftp://ftp.nersc.no/nextsim/netCDF/partition_metadata_1.nc")
for component in core physics dynamics
do
cd $component/test
for file in $(find test* -maxdepth 0 -type f)
do
echo $file
nprocs=$(echo $file | sed -r "s/.*MPI([0-9]+)/\1/")
mpirun --allow-run-as-root --oversubscribe -n $nprocs ./$file
done
cd -
done
test-ubuntu-mpi-xios:
runs-on: ubuntu-22.04
container:
image: ghcr.io/nextsimhub/nextsimdg-dev-env:latest
steps:
- uses: actions/checkout@v2
- name: build and compile with XIOS and MPI
run: |
. /opt/spack-environment/activate.sh
mkdir -p build && cd build
cmake -DENABLE_MPI=ON -Dxios_DIR="/xios" -DENABLE_XIOS=ON -DCMAKE_CXX_COMPILER="$(which mpic++)" ..
make -j 4
- name: run MPI tests
run: |
. /opt/spack-environment/activate.sh
apt update
apt install -y wget
cd build
(cd core/test && wget "ftp://ftp.nersc.no/nextsim/netCDF/partition_metadata_1.nc")
for component in core physics dynamics
do
cd $component/test
for file in $(find test* -maxdepth 0 -type f)
do
echo $file
nprocs=$(echo $file | sed -r "s/.*MPI([0-9]+)/\1/")
mpirun --allow-run-as-root --oversubscribe -n $nprocs ./$file
done
cd -
done
test-mac-serial:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: installs
run: |
brew install boost
brew unlink pkg-config
brew install pkgconf
brew link --overwrite pkgconf
brew install cmake
brew install eigen
brew install netcdf
brew install netcdf-cxx
pip install netCDF4
pip install numpy
# tmate can be used to get an interactive ssh session to the github runner
# for debugging actions. See
# [here](https://github.com/mxschmitt/action-tmate) for more information.
# uncomment these lines to debug mac build
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3
- name: make
run: |
mkdir -p build
cd build
# added Python_ROOT_DIR to help cmake find correct Python in the mac VM
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_MPI=OFF -DENABLE_XIOS=OFF -DPython_ROOT_DIR=/Library/Frameworks/Python.framework/Versions/Current/bin ..
make -j 4
- name: run serial tests
run: |
cd build
for component in core physics dynamics
do
cd $component/test
for file in $(find test* -maxdepth 0 -type f | grep -v "_MPI\d*$")
do
echo $file
./$file
done
cd -
done
mv ../test .
cd test
python ThermoIntegration_test.py
./run_test_jan2010_integration_test.sh python