-
Notifications
You must be signed in to change notification settings - Fork 33
708 lines (564 loc) · 20.7 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
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
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-12','macos-13']
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"
if [ "${{ matrix.os }}" == "macos-13" ]; then
sudo xcode-select --switch /Applications/Xcode_15.0.1.app
else
sudo xcode-select --switch /Applications/Xcode_13.2.1.app
fi
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-12','macos-13']
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"
if [ "${{ matrix.os }}" == "macos-13" ]; then
sudo xcode-select --switch /Applications/Xcode_15.0.1.app
else
sudo xcode-select --switch /Applications/Xcode_13.2.1.app
fi
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}}/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-clang_flang_mpi:
needs: [test_indentation]
strategy:
fail-fast: false
matrix:
os: ['ubuntu-24.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 clang flang swig python3-setuptools openmpi-bin libopenmpi-dev;
else
echo "$RUNNER_OS not supported"
exit 1
fi
shell: bash
- name: CMake version
run: cmake --version
- name: clang version
run: clang --version
- name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
shell: bash
working-directory: ${{github.workspace}}/build
run: |
export CC=/usr/bin/clang;
export CXX=/usr/bin/clang++;
export FORTRAN=/usr/bin/flang;
export OMPI_CC=clang;
export OMPI_CXX=clang++;
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-clang_gfortran_mpi:
needs: [test_indentation,coverage]
strategy:
fail-fast: false
matrix:
os: ['ubuntu-24.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 clang swig python3-setuptools openmpi-bin libopenmpi-dev;
else
echo "$RUNNER_OS not supported"
exit 1
fi
shell: bash
- name: CMake version
run: cmake --version
- name: clang version
run: clang --version
- name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
shell: bash
working-directory: ${{github.workspace}}/build
run: |
export CC=/usr/bin/clang;
export CXX=/usr/bin/clang++;
export FORTRAN=/usr/bin/flang;
export OMPI_CC=clang;
export OMPI_CXX=clang++;
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-gcc_no_apps:
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
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_ENABLE_APPS=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
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