-
Notifications
You must be signed in to change notification settings - Fork 370
853 lines (725 loc) · 29.9 KB
/
nestbuildmatrix.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
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
#
# detailed syntax defined in
# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions
#
name: "NEST CI"
on: [push, pull_request]
jobs:
clang-format:
runs-on: "ubuntu-22.04"
env:
CLANG_REQUIRE_VERSION: 17.0.4
CLANG_FORMAT_FILE: ".clang-format"
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit
disable-telemetry: true
- name: "Checkout repository content"
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
- name: "Install dependencies"
run: |
python -m pip install --force-reinstall clang-format==${{ env.CLANG_REQUIRE_VERSION }}
- name: "Run clang-format..."
run: |
files=$(find . \( -iname "*.h" -o -iname "*.c" -o -iname "*.cc" -o -iname "*.cpp" \) -not -path "./thirdparty/*")
diff -u <(cat ${files}) <(clang-format ${files})
cppcheck:
runs-on: "ubuntu-22.04"
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit
disable-telemetry: true
- name: "Checkout repository content"
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
- name: "Install Linux system dependencies"
run: |
sudo apt-get update
sudo apt-get install cppcheck
- name: "Run cppcheck..."
run: |
cppcheck --enable=all --language=c++ --std=c++17 -i sli/ --suppressions-list=.cppcheck_suppressions ./
rstcheck:
runs-on: "ubuntu-22.04"
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit
disable-telemetry: true
- name: "Checkout repository content"
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
- name: "Set up Python 3.x"
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
with:
python-version: "3.10"
- name: "Install dependencies"
run: |
pip install rstcheck
- name: "Run rstcheck..."
run: |
rstcheck -r doc/
vale:
runs-on: "ubuntu-22.04"
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit
disable-telemetry: true
- name: "Checkout repository content"
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
- name: "Set up Python 3.x"
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
with:
python-version: "3.10"
- name: "Install dependencies"
run: |
sudo apt update
sudo apt install python3-docutils
wget --progress=dot:mega 'https://github.com/errata-ai/vale/releases/download/v2.26.0/vale_2.26.0_Linux_64-bit.tar.gz'
echo '956577b214ce3db8fb11483f99a183cf65673e3bd47423c6d4ebe37f085cadc7 vale_2.26.0_Linux_64-bit.tar.gz' | sha256sum -c
tar -xzf 'vale_2.26.0_Linux_64-bit.tar.gz'
- name: "Run vale..."
run: |
./vale -v
./vale doc
copyright_headers:
runs-on: "ubuntu-22.04"
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit
disable-telemetry: true
- name: "Checkout repository content"
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
- name: "Set up Python 3.x"
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
with:
python-version: "3.10"
- name: "Install dependencies"
run: |
pip install pydocstyle
- name: "Check copyright headers..."
run: |
python build_support/check_copyright_headers.py
unused_names:
runs-on: "ubuntu-22.04"
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit
disable-telemetry: true
- name: "Checkout repository content"
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
- name: "Set up Python 3.x"
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
with:
python-version: "3.10"
- name: "Check for unused nest::names..."
run: |
python build_support/check_unused_names.py
forbidden_types:
runs-on: "ubuntu-22.04"
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit
disable-telemetry: true
- name: "Checkout repository content"
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
- name: "Check for forbidden types..."
run: |
./build_support/check_forbidden_types.sh
lychee_IGNORED:
runs-on: "ubuntu-22.04"
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit
disable-telemetry: true
- name: "Checkout repository content"
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
- name: "Install dependencies"
run: |
wget --progress=dot:mega 'https://github.com/lycheeverse/lychee/releases/download/v0.8.2/lychee-v0.8.2-x86_64-unknown-linux-gnu.tar.gz'
echo '12c27c9b6d551aea9178080d27de75ed26125b130722153399259432f723e606 lychee-v0.8.2-x86_64-unknown-linux-gnu.tar.gz' | sha256sum -c
tar -xzf 'lychee-v0.8.2-x86_64-unknown-linux-gnu.tar.gz'
- name: "Run lychee..."
continue-on-error: true
run: "pwd; ls -l; ./lychee build_support/ doc/{*.txt,*.md,htmldoc} examples/ lib* models/ nest* pynest/ testsuite/ *.md"
# TODO: doc/auto_examples and doc/models need to be added here, but exists only after a `make html`
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
pydocstyle:
runs-on: "ubuntu-22.04"
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit
disable-telemetry: true
- name: "Checkout repository content"
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
- name: "Set up Python 3.x"
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
with:
python-version: "3.10"
- name: "Install dependencies"
run: |
pip install pydocstyle
- name: "Run pydocstyle..."
run: |
pydocstyle pynest/
mypy:
runs-on: "ubuntu-22.04"
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit
disable-telemetry: true
- name: "Checkout repository content"
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
- name: "Set up Python 3.x"
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
with:
python-version: "3.10"
- name: "Install dependencies"
run: |
pip install mypy matplotlib numpy scipy data-science-types
- name: "Run mypy..."
run: |
mypy pynest/
# pytest-linux:
# runs-on: "ubuntu-22.04"
# needs: [build_linux]
# env:
# NEST_VPATH: "build"
# NEST_RESULT: "result"
# strategy:
# fail-fast: true
# matrix:
# os: ["ubuntu-22.04"]
# cpp_compiler: ["gcc"]
# # available use flags (all default to "OFF"):
# use:
# - "boost, optimize, warning" # formerly "minimal"
# # - "openmp, python, gsl, ltdl, boost, optimize, warning" # formerly "openmp_only"
# # - "mpi, python, gsl, ltdl, boost, optimize, warning" # formerly "mpi_only"
# # - "openmp, mpi, python, gsl, ltdl, boost, sionlib, libneurosim, optimize, warning" # formerly "full"
# steps:
# - name: "Download binary artifacts"
# uses: actions/download-artifact@v3
# with:
# name: "build-${{ matrix.os }}-${{ matrix.cpp_compiler }}-${{ matrix.use }}"
# - name: "Set up Python 3.x"
# uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
# with:
# python-version: "3.10"
# - name: "Install dependencies"
# run: |
# pip install pytest pytest-cov pytest-doctestplus
# - name: "Run pytest..."
# run: |
# pwd
# ls -lisa
# cd "$NEST_VPATH"
# pwd
# ls -lisa
# pytest testsuite/pytests/
# pytest-mac:
# runs-on: "macos-latest"
# needs: [build_macos]
# steps:
# - name: "Checkout repository content"
# uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
# with:
# fetch-depth: 0
# - name: "Set up Python 3.x"
# uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
# with:
# python-version: "3.10"
# - name: "Install dependencies"
# run: |
# pip install pytest pytest-cov pytest-doctestplus
# - name: "Run pytest..."
# run: |
# pytest pynest/
pylint:
runs-on: "ubuntu-22.04"
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit
disable-telemetry: true
- name: "Checkout repository content"
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
- name: "Set up Python 3.x"
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
with:
python-version: "3.10"
- name: "Install dependencies"
run: |
pip install pylint
- name: "Run pylint..."
run: |
pylint --jobs=$(nproc) pynest/ testsuite/pytests/*.py testsuite/regressiontests/*.py
isort:
runs-on: "ubuntu-20.04"
steps:
- name: "Checkout repository content"
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
- name: "Run isort..."
uses: isort/isort-action@f14e57e1d457956c45a19c05a89cccdf087846e5 # 1.1.0
with:
configuration: --profile=black --thirdparty="nest" --check-only --diff
black:
runs-on: "ubuntu-22.04"
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit
disable-telemetry: true
- name: "Checkout repository content"
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
- name: "Run black..."
uses: psf/black@d9ad09a32b0e0481bb4fef548d35b7a49cc03c5d # 23.12.0
with:
jupyter: true
flake8:
runs-on: "ubuntu-22.04"
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit
disable-telemetry: true
- name: "Checkout repository content"
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
- name: "Set up Python 3.x"
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
with:
python-version: "3.10"
- name: "Install dependencies"
run: |
pip install flake8
- name: "Run flake8..."
run: |
flake8 .
sphinx-rtd:
# as close as possible to the Readthedocs setup (system install cmake, pip install -r doc/requirements.txt)
runs-on: "ubuntu-22.04"
needs: [pydocstyle, rstcheck, vale]
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit
disable-telemetry: true
- name: "Checkout repository content"
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
- name: "Set up Python 3.x"
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
with:
# Using 3.8 because Read the docs does not work with higher versions.
# See also: https://github.com/nest/nest-simulator/pull/2744
python-version: "3.10"
- name: "Install dependencies"
run: |
sudo apt update
pip install -r doc/requirements.txt
# The pandoc executable, which is required, cannot be installed via pip see: https://stackoverflow.com/a/71585691
sudo apt install pandoc
- name: "Test-build documentation"
run: |
mkdir -pv build
cd build
cmake -Dwith-userdoc=ON -DCMAKE_INSTALL_PREFIX=../install ..
make docs |& tee sphinx-output.log
- name: Upload artifacts
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
with:
name: "sphinx-rtd output"
path: |
build/sphinx-output.log
build/doc/_build/html/
sphinx-conda:
# as close as possible to the suggested user docs build in the documentation
runs-on: "ubuntu-22.04"
if: false
needs: [pydocstyle, rstcheck, vale]
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit
disable-telemetry: true
- name: "Checkout repository content"
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
- name: Install Conda
uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3.0.4
with:
auto-update-conda: true
python-version: "3.10"
- name: Install conda dependencies
shell: bash -l {0}
run: |
conda info
conda env create -p conda
- name: "Test-build documentation"
shell: bash -l {0}
run: |
conda activate conda/
mkdir -pv build
cd build
cmake -DCMAKE_INSTALL_PREFIX=../install ..
make html |& tee sphinx-output.log
- name: Upload artifacts
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
with:
path: |
build/sphinx-output.log
build/doc/_build/html/
build_linux:
if: ${{ !contains(github.event.head_commit.message, 'ci skip') }}
runs-on: ${{ matrix.os }}
needs: [clang-format, mypy, copyright_headers, unused_names, forbidden_types, pylint, isort, black, flake8]
env:
CXX_FLAGS: "-pedantic -Wextra -Woverloaded-virtual -Wno-unknown-pragmas"
NEST_VPATH: "build"
NEST_RESULT: "result"
strategy:
fail-fast: false
matrix:
os: ["ubuntu-22.04"]
cpp_compiler: ["gcc"]
# available use flags (all default to "OFF"):
# openmp, mpi, python, gsl, ltdl, boost, sionlib, libneurosim, optimize, warning, userdoc, music
use:
- "boost, optimize, warning"
- "openmp, python, gsl, ltdl, boost, optimize, warning"
- "mpi, python, gsl, ltdl, boost, optimize, warning"
- "openmp, mpi, python, gsl, ltdl, boost, hdf5, sionlib, libneurosim, optimize, warning, music"
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit
disable-telemetry: true
- name: "Checkout repository content"
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
- name: "Set up Python 3.x"
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
with:
python-version: "3.10"
- name: "Restore apt cache"
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
env:
cache-name: "apt-cache"
with:
path: |
!/var/cache/apt/archives/lock
!/var/cache/apt/archives/partial
/var/cache/apt
key: ${{ runner.os }}-system-${{ env.cache-name }}-${{ hashFiles('**/environment.yml') }}
restore-keys: |
${{ runner.os }}-system-${{ env.cache-name }}-
${{ runner.os }}-system-
- name: "Install Linux system dependencies"
run: |
sudo apt-get update
# https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-README.md
sudo apt-get install ccache
sudo apt-get install libltdl-dev libreadline6-dev libncurses5-dev libgsl0-dev python3-all-dev jq libpcre3 libpcre3-dev
sudo apt-get install tcl8.6 tcl8.6-dev tk8.6-dev
# Install MPI dependencies regardless of whether we compile NEST with or without MPI, so the installation of MPI4Py works
sudo apt-get install openmpi-bin libopenmpi-dev
sudo apt-get install libboost-filesystem-dev libboost-regex-dev libboost-wave-dev libboost-python-dev libboost-program-options-dev libboost-test-dev
sudo apt-get install pkg-config
sudo ldconfig
- name: "Install GSL system dependencies"
if: "${{ contains(matrix.use, 'gsl') }}"
run: |
sudo apt-get install libgsl0-dev
- name: "Install HDF5 system dependencies"
if: "${{ contains(matrix.use, 'hdf5') }}"
run: |
sudo apt-get install libhdf5-dev
- name: "Restore ccache"
# Using CCache to re-use compiled objects from prior runs that have the same
# source (hashed), compiler (mtime+size) and compile flags.
env:
cache-name: "ccache"
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: |
$HOME/.ccache
.ccache
/home/runner/.ccache
key: ${{ runner.os }}-${{ env.cache-name }}-${{ matrix.cpp_compiler }}-${{ matrix.NEST_BUILD_TYPE }}
restore-keys: |
${{ runner.os }}-${{ env.cache-name }}-${{ matrix.cpp_compiler }}-${{ matrix.NEST_BUILD_TYPE }}
${{ runner.os }}-${{ env.cache-name }}-${{ matrix.cpp_compiler }}
${{ runner.os }}-${{ env.cache-name }}
${{ runner.os }}
- name: "Restore pip cache"
env:
cache-name: "pip-cache"
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: |
/opt/hostedtoolcache/Python/**/site-packages/*
$HOME/.cache/pip
key: ${{ runner.os }}-python-${{ env.cache-name }}-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-python-${{ env.cache-name }}-
${{ runner.os }}-python-
- name: "Install Python dependencies"
run: |
python -m pip install --upgrade pip setuptools
python -c "import setuptools; print('package location:', setuptools.__file__)"
python -m pip install --force-reinstall --upgrade scipy 'junitparser>=2' numpy pytest pytest-timeout pytest-xdist cython matplotlib terminaltables pandoc pandas
# Install mpi4py regardless of whether we compile NEST with or without MPI, so regressiontests/issue-1703.py will run in both cases
python -m pip install --force-reinstall --upgrade mpi4py
test \! -e "=2" # assert junitparser is correctly quoted and '>' is not interpreted as shell redirect
python -c "import pytest; print('package location:', pytest.__file__)"
pip list
- name: "Install h5py"
if: "${{ contains(matrix.use, 'hdf5') }}"
run: |
python -m pip install --force-reinstall --upgrade --no-binary=h5py h5py
- name: "Install MUSIC"
if: "${{ contains(matrix.use, 'music') }}"
run: |
chmod +x build_support/install_music.sh
./build_support/install_music.sh
- name: "Install SIONlib"
if: "${{ contains(matrix.use, 'sionlib') }}"
run: |
chmod +x build_support/install_sionlib.sh
./build_support/install_sionlib.sh
- name: "Install LibNeurosim – WARNING WARNING NO PROPER PYTHON INSTALL!"
if: "${{ contains(matrix.use, 'libneurosim') }}"
run: |
chmod +x build_support/install_csa-libneurosim.sh
PYLIB_DIR="$(python3 -c "import sysconfig; print(sysconfig.get_path('include'))" | sed 's/include/lib/')"
./build_support/install_csa-libneurosim.sh $PYLIB_DIR
- name: "Configure NEST build"
env:
CMAKE_C_COMPILER_LAUNCHER: ccache
CMAKE_CXX_COMPILER_LAUNCHER: ccache
run: |
mkdir -p "$NEST_VPATH/reports" "$NEST_RESULT"
if [ "$xNEST_BUILD_COMPILER" = "CLANG" ]; then
export CC=clang-11
export CXX=clang++-11
fi
export CXX_FLAGS="-pedantic -Wextra -Wno-unknown-pragmas -D_GLIBCXX_ASSERTIONS"
cd "$NEST_VPATH"
cmake \
-DCMAKE_INSTALL_PREFIX="$NEST_RESULT" \
-DCMAKE_CXX_FLAGS="$CXX_FLAGS" \
-Dwith-optimize=${{ contains(matrix.use, 'optimize') && 'ON' || 'OFF' }} \
-Dwith-warning=${{ contains(matrix.use, 'warning') && 'ON' || 'OFF' }} \
-Dwith-boost=${{ contains(matrix.use, 'boost') && 'ON' || 'OFF' }} \
-Dwith-openmp=${{ contains(matrix.use, 'openmp') && 'ON' || 'OFF' }} \
-Dwith-mpi=${{ contains(matrix.use, 'mpi') && 'ON' || 'OFF' }} \
-Dwith-python=${{ contains(matrix.use, 'python') && 'ON' || 'OFF' }} \
-Dwith-gsl=${{ contains(matrix.use, 'gsl') && 'ON' || 'OFF' }} \
-Dwith-ltdl=${{ contains(matrix.use, 'ltdl') && 'ON' || 'OFF' }} \
-Dwith-readline=${{ contains(matrix.use, 'readline') && 'ON' || 'OFF' }} \
-Dwith-hdf5=${{ contains(matrix.use, 'hdf5') && 'ON' || 'OFF' }} \
-Dwith-sionlib=${{ contains(matrix.use, 'sionlib') && '$HOME/.cache/sionlib.install' || 'OFF' }} \
-Dwith-libneurosim=${{ contains(matrix.use, 'libneurosim') && '$HOME/.cache/libneurosim.install' || 'OFF' }} \
-Dwith-music=${{ contains(matrix.use, 'music') && '$HOME/.cache/music.install' || 'OFF' }} \
..
- name: "Add GCC problem matcher"
run: |
echo "::add-matcher::gcc_problem_matcher.json"
- name: "Build NEST"
run: |
cd "$NEST_VPATH"
env
make VERBOSE=1
- name: "Remove GCC problem matcher"
run: |
echo "::remove-matcher owner=gcc-problem-matcher::"
- name: "Install NEST"
run: |
cd "$NEST_VPATH"
make install
- name: "Initialize Matplotlibrc"
run: |
# initialize matplotlib backend
mkdir -p $HOME/.matplotlib
echo "backend : svg" > $HOME/.matplotlib/matplotlibrc
- name: "Run NEST testsuite"
env:
DO_TESTS_SKIP_TEST_REQUIRING_MANY_CORES: ${{ contains(matrix.use, 'mpi') && contains(matrix.use, 'openmp') }}
run: |
pwd
cd "$NEST_VPATH"
chmod -v u+x ${NEST_RESULT}/share/nest/testsuite/do_tests.sh
make VERBOSE=1 installcheck
- name: "Upload install and test results"
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
if: always()
with:
name: "build-logs-${{ matrix.os }}-${{ matrix.cpp_compiler }}-${{ matrix.use }}"
path: |
build/install_manifest.txt
build/test_report_*/
build_macos:
if: ${{ !contains(github.event.head_commit.message, 'ci skip') }}
runs-on: ${{ matrix.os }}
needs: [clang-format, mypy, copyright_headers, unused_names, forbidden_types, pylint, isort, black, flake8]
env:
CXX_FLAGS: "-pedantic -Wextra -Woverloaded-virtual -Wno-unknown-pragmas"
NEST_VPATH: "build"
NEST_RESULT: "result"
strategy:
fail-fast: false
matrix:
os: [macos-latest]
cpp_compiler: ["clang"]
# available use flags (all default to "OFF"):
# openmp, mpi, python, gsl, ltdl, boost, hdf5, sionlib, libneurosim, optimize, warning, userdoc, music
use:
- "openmp, mpi, python, gsl, ltdl, boost, hdf5, optimize, warning"
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit
disable-telemetry: true
- name: "Checkout repository content"
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
- name: "Set up Python 3.x"
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
with:
python-version: 3.12
- name: "Install MacOS system dependencies"
run: |
brew install coreutils gsl open-mpi libomp automake autoconf libtool boost hdf5
- name: "Restore pip cache"
env:
cache-name: "pip-cache"
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: |
/opt/hostedtoolcache/Python/**/site-packages/*
$HOME/.cache/pip
key: ${{ runner.os }}-python-${{ env.cache-name }}-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-python-${{ env.cache-name }}-
${{ runner.os }}-python-
- name: "Install Python dependencies"
run: |
python -m pip install --upgrade pip setuptools
python -c "import setuptools; print('package location:', setuptools.__file__)"
python -m pip install --force-reinstall --upgrade scipy 'junitparser>=2' numpy pytest pytest-timeout pytest-xdist mpi4py h5py cython matplotlib terminaltables pandoc pandas
test \! -e "=2" # assert junitparser is correctly quoted and '>' is not interpreted as shell redirect
python -c "import pytest; print('package location:', pytest.__file__)"
pip list
- name: "Configure NEST build"
run: |
mkdir -p "$NEST_VPATH/reports" "$NEST_RESULT"
cd "$NEST_VPATH"
cmake \
-DCMAKE_INSTALL_PREFIX="$NEST_RESULT" \
-DCMAKE_CXX_FLAGS="$CXX_FLAGS" \
-Dwith-optimize=${{ contains(matrix.use, 'optimize') && 'ON' || 'OFF' }} \
-Dwith-warning=${{ contains(matrix.use, 'warning') && 'ON' || 'OFF' }} \
-Dwith-boost=${{ contains(matrix.use, 'boost') && 'ON' || 'OFF' }} \
-Dwith-openmp=${{ contains(matrix.use, 'openmp') && 'ON' || 'OFF' }} \
${{ contains(matrix.use, 'openmp') && '-DOpenMP_ROOT=$(brew --prefix libomp)' }} \
-Dwith-mpi=${{ contains(matrix.use, 'mpi') && 'ON' || 'OFF' }} \
-Dwith-python=${{ contains(matrix.use, 'python') && 'ON' || 'OFF' }} \
-Dwith-gsl=${{ contains(matrix.use, 'gsl') && 'ON' || 'OFF' }} \
-Dwith-ltdl=${{ contains(matrix.use, 'ltdl') && 'ON' || 'OFF' }} \
-Dwith-readline=${{ contains(matrix.use, 'readline') && 'ON' || 'OFF' }} \
-Dwith-hdf5=${{ contains(matrix.use, 'hdf5') && 'ON' || 'OFF' }} \
-Dwith-sionlib=${{ contains(matrix.use, 'sionlib') && '$HOME/.cache/sionlib.install' || 'OFF' }} \
-Dwith-libneurosim=${{ contains(matrix.use, 'libneurosim') && '$HOME/.cache/libneurosim.install' || 'OFF' }} \
-Dwith-music=${{ contains(matrix.use, 'music') && '$HOME/.cache/music.install' || 'OFF' }} \
..
- name: "Add GCC problem matcher"
run: |
echo "::add-matcher::gcc_problem_matcher.json"
- name: "Build NEST"
run: |
cd "$NEST_VPATH"
env
make VERBOSE=1
- name: "Remove GCC problem matcher"
run: |
echo "::remove-matcher owner=gcc-problem-matcher::"
- name: "Install NEST"
run: |
cd "$NEST_VPATH"
make install
- name: "Initialize Matplotlibrc"
run: |
# initialize matplotlib backend
mkdir -p $HOME/.matplotlib
echo "backend : svg" > $HOME/.matplotlib/matplotlibrc
- name: "Run NEST testsuite"
run: |
pwd
cd "$NEST_VPATH"
chmod -v u+x ${NEST_RESULT}/share/nest/testsuite/do_tests.sh
make VERBOSE=1 installcheck
- name: "Upload install and test results"
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
if: ${{ always() }}
with:
name: "${{ matrix.NEST_BUILD_TYPE }}-build-logs-${{ matrix.os }}-${{ matrix.cpp_compiler }}"
path: |
build/install_manifest.txt
build/test_report_*/