-
Notifications
You must be signed in to change notification settings - Fork 4
406 lines (326 loc) · 11.6 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
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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
name: CI
on:
pull_request:
branches:
- master
# schedule:
# - cron: '0 1 * * *'
workflow_dispatch:
concurrency:
group: CI-${{ github.head_ref }}
cancel-in-progress: true
jobs:
Ubuntu-Cpp-C:
runs-on: ubuntu-latest
name: "Ubuntu C++ & C (${{ matrix.compiler }} / ${{ matrix.mpi }})"
strategy:
fail-fast: false
matrix:
compiler: [GCC, CLANG, ICC]
mpi: [OpenMPI, IntelMPI]
exclude:
# CLANG is not properly supported by Intel, better use LLVMIntel in the future
- compiler: CLANG
mpi: IntelMPI
timeout-minutes: 30
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
# see https://software.intel.com/content/www/us/en/develop/articles/installing-intel-oneapi-toolkits-via-apt.html#pkgtable
cd /tmp
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main"
sudo apt-get update
sudo apt-get install \
valgrind \
clang-11
- name: Install Intel compiler
if: ${{ matrix.compiler == 'ICC' }}
run: sudo apt-get install intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic
- name: Install MPI
run: |
if [ ${{ matrix.mpi }} = OpenMPI ]; then
sudo apt-get install libopenmpi-dev openmpi-bin
else
sudo apt-get install intel-oneapi-mpi-devel
fi
- name: Build CoSimIO
run: |
if [ ${{ matrix.compiler }} = GCC ]; then
export CXX=/usr/bin/g++
export CC=/usr/bin/gcc
elif [ ${{ matrix.compiler }} = CLANG ]; then
export CXX=/usr/bin/clang++-11
export CC=/usr/bin/clang-11
elif [ ${{ matrix.compiler }} = ICC ]; then
export CXX=icpc
export CC=icc
else
echo 'Unsupported compiler: ${{ matrix.compiler }}'
exit 1
fi
if [ ${{ matrix.compiler }} = ICC ] || [ ${{ matrix.mpi }} = IntelMPI ]; then
source /opt/intel/oneapi/setvars.sh
fi
build_mpi_comm=OFF
if [ ${{ matrix.mpi }} = IntelMPI ]; then
build_mpi_comm=ON
fi
cmake -H"." -B"build" \
-DCMAKE_BUILD_TYPE="Debug" \
-DCO_SIM_IO_BUILD_C=ON \
-DCO_SIM_IO_BUILD_FORTRAN=OFF \
-DCO_SIM_IO_BUILD_MPI=ON \
-DCO_SIM_IO_BUILD_MPI_COMMUNICATION=$build_mpi_comm \
-DCO_SIM_IO_STRICT_COMPILER=ON
cmake --build "build" --target install -- -j2
- name: Running tests
env:
OMPI_MCA_rmaps_base_oversubscribe: 1 # Allow oversubscription for MPI (needed for OpenMPI >= 3.0)
run: |
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${GITHUB_WORKSPACE}/bin
export PATH=${PATH}:${GITHUB_WORKSPACE}/bin # required for IntelMPI
export PATH=${PATH}:${GITHUB_WORKSPACE}/bin/tests_c_mpi # required for IntelMPI
if [ ${{ matrix.compiler }} = ICC ] || [ ${{ matrix.mpi }} = IntelMPI ]; then
source /opt/intel/oneapi/setvars.sh
fi
cd build
ctest -T memcheck --output-on-failure
- uses: actions/upload-artifact@v2
if: failure()
with:
name: "CTest Log Ubuntu C++ & C (${{ matrix.compiler }}-${{ matrix.mpi }})"
path: ${{ github.workspace }}/build/Testing/
Ubuntu-Python:
runs-on: ubuntu-latest
name: Ubuntu Python ${{ matrix.python-version }} (${{ matrix.compiler }})
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
compiler: [GCC, ICC]
timeout-minutes: 15
steps:
- uses: actions/checkout@v2
- name: Install Intel compiler
if: ${{ matrix.compiler == 'ICC' }}
run: |
# see https://software.intel.com/content/www/us/en/develop/articles/installing-intel-oneapi-toolkits-via-apt.html#pkgtable
cd /tmp
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main"
sudo apt-get update
sudo apt-get install intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic
- name: Install MPI
run: |
sudo apt-get update
sudo apt-get install libopenmpi-dev openmpi-bin
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Build CoSimIO
run: |
cmake -H"." -B"build" \
-DCMAKE_BUILD_TYPE="Debug" \
-DCO_SIM_IO_BUILD_PYTHON=ON \
-DCO_SIM_IO_BUILD_MPI=ON \
-DPYBIND11_PYTHON_VERSION=${{ matrix.python-version }} \
-DCO_SIM_IO_STRICT_COMPILER=ON
cmake --build "build" --target install -- -j2
- name: Running tests
run: |
if [ ${{ matrix.compiler }} = ICC ]; then
source /opt/intel/oneapi/setvars.sh
fi
export PYTHONPATH=${PYTHONPATH}:${GITHUB_WORKSPACE}/bin
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${GITHUB_WORKSPACE}/bin
cd tests
# TODO delete build dir to make sure the linking etc works correctly?
python run_python_tests.py
- name: Running MPI tests
run: |
if [ ${{ matrix.compiler }} = ICC ]; then
source /opt/intel/oneapi/setvars.sh
fi
export PYTHONPATH=${PYTHONPATH}:${GITHUB_WORKSPACE}/bin
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${GITHUB_WORKSPACE}/bin
cd tests
#TODO run the tests...
# TODO delete build dir to make sure the linking etc works correctly?
# python run_python_tests.py
MacOS-Cpp-C:
runs-on: macOS-latest
name: MacOS C++ & C
timeout-minutes: 15
steps:
- uses: actions/checkout@v2
- name: Build CoSimIO
run: |
cmake -H"." -B"build" \
-DCMAKE_BUILD_TYPE="Debug" \
-DCO_SIM_IO_BUILD_C=ON \
-DCO_SIM_IO_STRICT_COMPILER=ON
cmake --build "build" --target install -- -j3
- name: Running tests
run: |
cd build
ctest --output-on-failure
MacOS-Python:
runs-on: macOS-latest
name: MacOS Python ${{ matrix.python-version }}
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
timeout-minutes: 15
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Build CoSimIO
run: |
cmake -H"." -B"build" \
-DCMAKE_BUILD_TYPE="Debug" \
-DCO_SIM_IO_BUILD_PYTHON=ON \
-DPYBIND11_PYTHON_VERSION=${{ matrix.python-version }} \
-DCO_SIM_IO_STRICT_COMPILER=ON
cmake --build "build" --target install -- -j3
- name: Running tests
run: |
export PYTHONPATH=${PYTHONPATH}:${GITHUB_WORKSPACE}/bin
export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:${GITHUB_WORKSPACE}/bin
cd tests
# TODO delete build dir to make sure the linking etc works correctly?
python run_python_tests.py
Windows-Cpp-C:
runs-on: windows-latest
name: Windows C++ & C
timeout-minutes: 15
steps:
- uses: actions/checkout@v2
- name: Build CoSimIO
shell: cmd
run: |
call "%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 || goto :error
set CC=cl.exe
set CXX=cl.exe
cmake ^
-G"Visual Studio 17 2022" ^
-H"." ^
-B"build" ^
-DCMAKE_BUILD_TYPE="Debug" ^
-DCO_SIM_IO_BUILD_C=ON ^
-DCO_SIM_IO_STRICT_COMPILER=ON || goto :error
cmake --build "build" --target install -- /p:Platform=x64 || goto :error
goto :EOF
:error
echo Failed with error #%errorlevel%.
exit /b %errorlevel%
- name: Running tests
shell: cmd
run: |
set PATH=%PATH%;%GITHUB_WORKSPACE%/bin
cd build
ctest -C Debug --output-on-failure
Windows-Python:
runs-on: windows-latest
name: Windows Python ${{ matrix.python-version }}
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
timeout-minutes: 15
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Installing dependencies
shell: cmd
run: |
pip install numpy
- name: Build CoSimIO
shell: cmd
run: |
call "%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 || goto :error
set CC=cl.exe
set CXX=cl.exe
cmake ^
-G"Visual Studio 17 2022" ^
-H"." ^
-B"build" ^
-DCO_SIM_IO_BUILD_PYTHON=ON ^
-DCO_SIM_IO_STRICT_COMPILER=ON || goto :error
cmake --build "build" --target install -- /p:Platform=x64 || goto :error
goto :EOF
:error
echo Failed with error #%errorlevel%.
exit /b %errorlevel%
- name: Running tests
env:
PYTHON_CMD: python # for the tests (subprocess)
shell: cmd
run: |
set PYTHONPATH=%PYTHONPATH%;%GITHUB_WORKSPACE%/bin
cd tests
rem TODO delete build dir to make sure the linking etc works correctly?
python run_python_tests.py
CentOS-7:
runs-on: ubuntu-latest
name: CentOS 7
container:
image: kratosmultiphysics/kratos-image-ci-centos7:latest
steps:
- uses: actions/checkout@v2
- name: Build CoSimIO
run: |
cmake -H"." -B"build" \
-DCMAKE_BUILD_TYPE="Debug" \
-DCO_SIM_IO_BUILD_C=ON \
-DCO_SIM_IO_BUILD_PYTHON=ON \
-DCO_SIM_IO_STRICT_COMPILER=ON
cmake --build "build" --target install -- -j2
- name: Running tests (Ctest)
run: |
cd build
ctest --output-on-failure
- name: Running tests (Python)
run: |
export PYTHONPATH=${PYTHONPATH}:${GITHUB_WORKSPACE}/bin
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${GITHUB_WORKSPACE}/bin
cd tests
# TODO delete build dir to make sure the linking etc works correctly? (Needs to be done after running CTests)
python3.8 run_python_tests.py
Ubuntu-old-CMake:
runs-on: ubuntu-latest
steps:
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v1.10
with:
cmake-version: '2.8.x'
- name: Use cmake
run: cmake --version
- name: Install MPI
run: |
sudo apt-get update
sudo apt-get install libopenmpi-dev openmpi-bin
- uses: actions/checkout@v2
- name: Build CoSimIO
run: |
cmake -H"." -B"build" \
-DCMAKE_BUILD_TYPE="Debug" \
-DCO_SIM_IO_BUILD_C=ON \
-DCO_SIM_IO_BUILD_PYTHON=OFF \
-DCO_SIM_IO_BUILD_TESTING=OFF \
-DCO_SIM_IO_BUILD_MPI=ON \
-DCO_SIM_IO_STRICT_COMPILER=ON
cmake --build "build" --target install -- -j2