-
Notifications
You must be signed in to change notification settings - Fork 29
519 lines (412 loc) · 15.4 KB
/
test.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
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
name: tests
on:
push:
branches:
- 'main'
- 'GWB-*'
pull_request:
concurrency:
group: ${{ github.actor }}-${{ github.ref }}-test
cancel-in-progress: true
jobs:
test_indentation:
runs-on: ubuntu-latest
steps:
- name: Setup cmake
uses: jwlawson/[email protected]
with:
cmake-version: '3.16.x'
- name: Use cmake
run: cmake --version
- uses: actions/checkout@v2
- name: Install astyle
shell: bash
run: cd .. && mkdir astyle && cd astyle && wget 'https://sourceforge.net/projects/astyle/files/astyle/astyle 2.04/astyle_2.04_linux.tar.gz' && tar -zxvf astyle_2.04_linux.tar.gz && cd astyle/build/gcc && make && sudo make install && cd ../../../../
- name: Create Build Environment
run: |
mkdir build;
cd build;
- name: Configure CMake
shell: bash
working-directory: ${{github.workspace}}/build
run: cmake ..
- name: Indenting
shell: bash
working-directory: ${{github.workspace}}/build
run: make indent
- name: Indenting
shell: bash
working-directory: ${{github.workspace}}/build
run: git status
- name: check indentation
shell: bash
working-directory: ${{github.workspace}}/build
run: |
if [[ "$(git status | grep 'modified' --count)" -gt "0" ]]; then
git diff > diff.log;
cat diff.log;
exit 1;
fi
test_linux_and_macos:
needs: test_indentation
strategy:
fail-fast: false
matrix:
os: ['ubuntu-latest','macos-latest','macos-11']
build_type: ['Release', 'Debug']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Install optional dependencies
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt install gfortran swig python3-setuptools
fi
shell: bash
- name: MacOS_xcode_select
run: |
if [ "$RUNNER_OS" != "Linux" ]; then
xcode-select -p
echo "1"
ls /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/
echo "2"
ls /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/
echo "3"
ls /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/libexec
echo "4"
sudo xcode-select --switch /Applications/Xcode_13.2.1.app
fi
shell: bash
- name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
shell: bash
working-directory: ${{github.workspace}}/build
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_CXX_FLAGS=-Werror
else
cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_CXX_FLAGS=-Werror -DWB_ENABLE_PYTHON=OFF
fi
- name: Build gwb
working-directory: ${{github.workspace}}/build
shell: bash
run: cmake --build . --config ${{ matrix.build_type }}
- name: Install gwb Linux and macOS
working-directory: ${{github.workspace}}/build
shell: bash
run: sudo cmake --install . --config ${{ matrix.build_type }}
- name: Test gwb
working-directory: ${{github.workspace}}/build
shell: bash
run: ctest -VV -C ${{ matrix.build_type }}
test_linux_non_unity_no_optional_dependencies:
needs: test_indentation
strategy:
fail-fast: false
matrix:
os: ['ubuntu-latest']
build_type: ['Debug']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
shell: bash
working-directory: ${{github.workspace}}/build
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_CXX_FLAGS=-Werror -DWB_UNITY_BUILD=OFF
- name: Build gwb
working-directory: ${{github.workspace}}/build
shell: bash
run: cmake --build . --config ${{ matrix.build_type }}
- name: Install gwb Linux and macOS
working-directory: ${{github.workspace}}/build
shell: bash
run: sudo cmake --install . --config ${{ matrix.build_type }}
- name: Test gwb
working-directory: ${{github.workspace}}/build
shell: bash
run: ctest -VV -C ${{ matrix.build_type }}
test_windows:
needs: test_indentation
strategy:
fail-fast: false
matrix:
os: ['windows-2022']
build_type: ['Release', 'Debug']
build_system: ['Visual Studio 17 2022']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
# python in combination with cmake seems to be broken on github actions windows
# todo: fix it
#- name: Install optional dependencies
# run: choco install swig -version=4.0.1 -y
# shell: bash
- uses: ilammy/msvc-dev-cmd@v1
- name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
shell: bash
working-directory: ${{github.workspace}}/build
run: cmake -G"${{ matrix.build_system }}" $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DWB_ENABLE_PYTHON=OFF -DWB_MAKE_FORTRAN_WRAPPER=OFF
- name: Build gwb
working-directory: ${{github.workspace}}/build
shell: bash
run: cmake --build . --config ${{ matrix.build_type }}
- name: Install gwb windows
working-directory: ${{github.workspace}}/build
shell: bash
run: cmake --install . --config ${{ matrix.build_type }}
- name: Test gwb
working-directory: ${{github.workspace}}/build
shell: bash
run: ctest -VV -C ${{ matrix.build_type }} -E _no_coordinates
test_linux_and_macos_mpi:
needs: test_indentation
strategy:
fail-fast: false
matrix:
os: ['ubuntu-latest','macos-latest']
build_type: ['Release']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Install optional dependencies
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt update;
sudo apt install gfortran swig python3-setuptools openmpi-bin libopenmpi-dev
elif [ "$RUNNER_OS" == "macOS" ]; then
sudo brew install open-mpi || true
echo "4"
sudo xcode-select --switch /Applications/Xcode_13.2.1.app
else
echo "$RUNNER_OS not supported"
exit 1
fi
shell: bash
- name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
shell: bash
working-directory: ${{github.workspace}}/build
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_CXX_FLAGS=-Werror
else
cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_CXX_FLAGS=-Werror -DWB_ENABLE_PYTHON=OFF
fi
- name: Build gwb
working-directory: ${{github.workspace}}/build
shell: bash
run: cmake --build . --config ${{ matrix.build_type }}
- name: Install gwb Linux and macOS
working-directory: ${{github.workspace}}/build
shell: bash
run: sudo cmake --install . --config ${{ matrix.build_type }}
- name: Test gwb
working-directory: ${{github.workspace}}/build
shell: bash
run: ctest -VV -C ${{ matrix.build_type }}
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install optional dependencies
run: sudo apt install gfortran swig python3-setuptools openmpi-bin libopenmpi-dev
shell: bash
- name: extend path
run: echo $PATH && export PATH=$PATH:/home/runner/.local/bin && echo $PATH && export PYTHONPATH=$PYTHONPATH:/home/runner/.local/bin
- name: Install coveralls
run: pip install --user cpp-coveralls
shell: bash
- name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
shell: bash
working-directory: ${{github.workspace}}/build
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Coverage
- name: Build gwb
working-directory: ${{github.workspace}}/build
shell: bash
run: cmake --build . --config Coverage
- name: Install gwb
working-directory: ${{github.workspace}}/build
shell: bash
run: sudo cmake --install . --config Coverage
- name: Test gwb
working-directory: ${{github.workspace}}/build
shell: bash
run: |
ctest -VV -C Coverage;
ls;
- name: Codecov
run: bash <(curl -s https://codecov.io/bash);
shell: bash
- name: lcov
working-directory: ${{github.workspace}}/build
shell: bash
run: |
sudo apt install lcov;
lcov --capture --directory ${{github.workspace}}/build --output-file coverage.info;
lcov --remove coverage.info '${{github.workspace}}/build/*' '${{github.workspace}}/source/gwb-grid/*' '${{github.workspace}}/include/*' '${{github.workspace}}/tests/*' '/usr/*' -o coverage_filtered.info
ls;
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ${{github.workspace}}/build/coverage_filtered.info
linux-cmake_mpi:
needs: [test_indentation,coverage]
strategy:
fail-fast: false
matrix:
os: ['ubuntu-latest']
cmake_version: ['2.8.12','3.16.x', '3.20.x']
use_mpi: ['TRUE','FALSE']
build_type: ['Release']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Install optional dependencies
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt update;
sudo apt install gfortran swig python3-setuptools openmpi-bin libopenmpi-dev
elif [ "$RUNNER_OS" == "macOS" ]; then
sudo brew install open-mpi || true
else
echo "$RUNNER_OS not supported"
exit 1
fi
shell: bash
- name: Setup cmake
uses: jwlawson/[email protected]
with:
cmake-version: ${{ matrix.cmake_version }}
- name: Use cmake
run: cmake --version
- name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
shell: bash
working-directory: ${{github.workspace}}/build
run: |
cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_CXX_FLAGS=-Werror -DUSE_MPI=${{ matrix.use_mpi }};
cat ${{github.workspace}}/build/CMakeFiles/CMakeError.log ||:;
- name: Build gwb
working-directory: ${{github.workspace}}/build
shell: bash
run: cmake --build . --config ${{ matrix.build_type }}
- name: Install gwb Linux and macOS
working-directory: ${{github.workspace}}/build
shell: bash
run: sudo cmake --install . --config ${{ matrix.build_type }}
- name: Test gwb
working-directory: ${{github.workspace}}/build
shell: bash
run: ctest -VV -C ${{ matrix.build_type }}
linux-gcc_mpi:
needs: [test_indentation,coverage]
strategy:
fail-fast: false
matrix:
os: ['ubuntu-20.04']
build_type: ['Debug']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Install optional dependencies
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt update;
sudo apt install gfortran swig python3-setuptools openmpi-bin
elif [ "$RUNNER_OS" == "macOS" ]; then
sudo brew install open-mpi || true
else
echo "$RUNNER_OS not supported"
exit 1
fi
shell: bash
- name: CMake version
run: cmake --version
- name: GCC version
run: gcc --version
- name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
shell: bash
working-directory: ${{github.workspace}}/build
run: |
cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_CXX_FLAGS=-Werror;
cat ${{github.workspace}}/build/CMakeFiles/CMakeError.log ||:;
- name: Build gwb
working-directory: ${{github.workspace}}/build
shell: bash
run: cmake --build . --config ${{ matrix.build_type }}
- name: Install gwb Linux and macOS
working-directory: ${{github.workspace}}/build
shell: bash
run: sudo cmake --install . --config ${{ matrix.build_type }}
- name: Test gwb
working-directory: ${{github.workspace}}/build
shell: bash
run: ctest -VV -C ${{ matrix.build_type }}
linux-gdb-valgrind:
needs: [test_indentation]
strategy:
fail-fast: false
matrix:
os: ['ubuntu-22.04']
build_type: ['Debug']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Install optional dependencies
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt update;
sudo apt install gfortran swig python3-setuptools gdb valgrind
elif [ "$RUNNER_OS" == "macOS" ]; then
sudo brew install open-mpi || true
else
echo "$RUNNER_OS not supported"
exit 1
fi
shell: bash
- name: CMake version
run: cmake --version
- name: GCC version
run: gcc --version
- name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
shell: bash
working-directory: ${{github.workspace}}/build
run: |
cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_CXX_FLAGS=-Werror -DWB_RUN_TESTS_WITH_GDB=ON -DWB_RUN_TESTS_WITH_VALGRIND=OFF;
cat ${{github.workspace}}/build/CMakeFiles/CMakeError.log ||:;
- name: Build gwb
working-directory: ${{github.workspace}}/build
shell: bash
run: cmake --build . --config ${{ matrix.build_type }}
- name: Install gwb Linux and macOS
working-directory: ${{github.workspace}}/build
shell: bash
run: sudo cmake --install . --config ${{ matrix.build_type }}
- name: Test gwb normal and gdb
working-directory: ${{github.workspace}}/build
shell: bash
run: ctest -VV -C ${{ matrix.build_type }} -E _no_coordinates_gdb
- name: Configure CMake
shell: bash
working-directory: ${{github.workspace}}/build
run: |
cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_CXX_FLAGS=-Werror -DWB_RUN_TESTS_WITH_GDB=OFF -DWB_RUN_TESTS_WITH_VALGRIND=ON;
cat ${{github.workspace}}/build/CMakeFiles/CMakeError.log ||:;
- name: Test gwb valgrind
working-directory: ${{github.workspace}}/build
shell: bash
run: ctest -VV -C ${{ matrix.build_type }} -R _valgrind -E _no_coordinates_valgrind