-
Notifications
You must be signed in to change notification settings - Fork 23
1918 lines (1785 loc) · 68.6 KB
/
test-install.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
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# DO NOT MODIFY THIS FILE, IT IS GENERATED.
# To make changes, modify '.git/../utils/test-install-base.yml'
# and run 'ygggha'
env:
BUILDDOCS: 0
INSTALLC: 1
INSTALLEXCEL: 1
INSTALLFORTRAN: 1
INSTALLIMAGES: 1
INSTALLJULIA: 1
INSTALLLPY: 0
INSTALLMATLAB: 0
INSTALLMPI: 1
INSTALLOMP: 1
INSTALLPYGMENTS: 1
INSTALLPYTORCH: 1
INSTALLR: 1
INSTALLRMQ: 0
INSTALLSBML: 0
INSTALLSEQ: 1
INSTALLTRIMESH: 1
INSTALLZMQ: 1
NUMPY: numpy
TMPDIR: /tmp/
USEVIRTUALENV: 0
YGG_GHA_JOB_ID_SUFFIX: null
jobs:
build_sdist:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
name: Build source distribution
needs:
- test_pip
- test_conda
- test_rmq_pip
- test_rmq_conda
- test_stripped
- docs
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: true
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Build sdist
run: 'python setup.py sdist
'
- name: Install sdist
run: 'python -m pip install dist/*.gz
python utils/setup_test_env.py deps pip
'
- name: Test sdist
run: 'ygginfo
pytest -m subset_rapidjson --import-mode=importlib tests
'
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: sdist
path: ./dist/*
build_wheels:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
name: Build wheels on ${{ matrix.os }}
needs:
- test_pip
- test_conda
- test_rmq_pip
- test_rmq_conda
- test_stripped
- docs
runs-on: ${{ matrix.os }}
steps:
- name: Checkout sources
uses: actions/checkout@v3
with:
submodules: true
- if: runner.os == 'Linux'
name: (LINUX) Set up QEMU
uses: docker/setup-qemu-action@v1
with:
platforms: all
- if: ${{ matrix.windows_arch == 'x86' }}
name: setup rtools for 32-bit
run: 'echo "PLAT=i686" >> $env:GITHUB_ENV
echo "PATH=$env:RTOOLS40_HOME\mingw32\bin;$env:PATH" >> $env:GITHUB_ENV
gfortran --version
'
- env:
CIBW_ARCHS_LINUX: ${{ matrix.linux_arch }}
CIBW_ARCHS_MACOS: ${{ matrix.mac_arch }}
CIBW_ARCHS_WINDOWS: ${{ matrix.windows_arch }}
name: Build wheels
uses: pypa/[email protected]
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
strategy:
fail-fast: false
matrix:
include:
- os: windows-2019
windows_arch: x86
- linux_arch: aarch64
os: ubuntu-20.04
- linux_arch: ppc64le
os: ubuntu-20.04
linux_arch:
- auto
mac_arch:
- x86_64 arm64
os:
- ubuntu-20.04
- macOS-11
- windows-2019
windows_arch:
- AMD64
docker:
if: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags')) || github.event.schedule
== '0 10 1 * *'
name: Build and Publish Docker images
needs:
- test_pip
- test_conda
- test_rmq_pip
- test_rmq_conda
- test_stripped
- docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Login to DockerHub
uses: docker/login-action@v1
with:
password: ${{ secrets.DOCKERHUB_TOKEN }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
- name: Build and push environment docker images for the new release
run: python utils/build_docker.py --push
- name: Build and push executable docker images for the new release
run: python utils/build_docker.py --push executable
docs:
env:
BUILDDOCS: 1
name: Build the Docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install dependencies
run: python utils/setup_test_env.py install pip
- name: Verify installation
run: python utils/setup_test_env.py verify
- name: Build the docs
run: 'cd docs
make autodoc
cd ../
'
- if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
name: Publish docs to Github pages
uses: JamesIves/[email protected]
with:
BRANCH: gh-pages
FOLDER: docs/build/html/
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
params:
name: Prepare test parameters
outputs:
os-versions: ${{ steps.set-os-versions.outputs.versions }}
runs-on: ubuntu-latest
steps:
- id: set-os-versions
run: echo "versions={\"ubuntu\":\"latest\", \"macos\":\"latest\", \"windows\":\"latest\"}"
>> $GITHUB_OUTPUT
schema:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
name: Update the schema used by the model submission form
needs:
- test_pip
- test_conda
- test_rmq_pip
- test_rmq_conda
- test_stripped
- docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install dependencies
run: 'python -m pip install PyGithub
python utils/setup_test_env.py install pip
'
- name: Verify installation
run: python utils/setup_test_env.py verify
- name: Update the form
run: python utils/update_form_schema.py --token=${{ secrets.YGGDRASIL_UPDATE_TOKEN
}}
test_conda:
defaults:
run:
shell: bash -l {0}
name: Test (${{ matrix.python-version }}, ${{ matrix.os-base }}, ${{ matrix.install-method
}}, ${{ matrix.test-flags1 }}, ${{ matrix.test-flags2 }}), Install C = ${{ matrix.install-c
}}
needs: params
runs-on: ${{ matrix.os-base }}-${{ fromJSON(needs.params.outputs.os-versions)[matrix.os-base]
}}
steps:
- uses: actions/checkout@v3
with:
submodules: true
- if: matrix.install-c != true && matrix.install-method != 'conda' && matrix.install-method
!= 'mamba'
name: Set C installation based on matrix value
run: echo "INSTALLC=0" >> $GITHUB_ENV
shell: bash -l {0}
- if: matrix.install-mpi != true
name: Set MPI installation based on matrix value
run: echo "INSTALLMPI=0" >> $GITHUB_ENV
shell: bash -l {0}
- if: matrix.install-sbml == true
name: Set SBML installation based on matrix value
run: echo "INSTALLSBML=1" >> $GITHUB_ENV
shell: bash -l {0}
- name: Store an ID string for the job
run: echo "YGG_GHA_JOB_ID=${{ runner.os }}-${{ matrix.install-method }}-py${{
matrix.python-version }}-C${{ env.INSTALLC }}-RMQ${{ env.INSTALLRMQ }}${{
env.YGG_GHA_JOB_ID_SUFFIX }}" >> $GITHUB_ENV
shell: bash -l {0}
- if: runner.os == 'Windows'
name: (WINDOWS) Patch TEMP/TMPDIR on Windows
run: 'echo "TMPDIR=$USERPROFILE\\AppData\\Local\\Temp" >> $GITHUB_ENV
echo "TEMP=$USERPROFILE\\AppData\\Local\\Temp" >> $GITHUB_ENV
'
shell: bash -l {0}
- if: runner.os == 'Windows' && startsWith(matrix.test-flags1, '--suite=examples')
name: (WINDOWS) Disable interpreted language example on Windows for speed
run: 'echo "TEST_FLAGS1_SUFFIX=--skip-languages python R julia" >> $GITHUB_ENV
'
shell: bash -l {0}
- if: runner.os == 'Windows' && matrix.install-method == 'pip' && env.INSTALLC
== 1
name: (WINDOWS,PIP) Set up MSVC Compiler
uses: ilammy/msvc-dev-cmd@v1
with:
toolset: 14.0
- if: runner.os == 'Windows' && matrix.install-method == 'pip' && env.INSTALLMPI
== 1
name: (WINDOWS,PIP) Set up MSMPI
uses: mpi4py/setup-mpi@v1
- if: runner.os == 'Windows' && matrix.install-method == 'pip' && env.INSTALLR
== 1
name: Install R
uses: r-lib/actions/setup-r@v2
with:
r-version: 4.2.3
- if: startsWith(runner.os, 'Linux') && matrix.install-method == 'pip'
name: (LINUX,PIP) Cache pip
uses: actions/cache@v3
with:
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
path: ~/.cache/pip
restore-keys: '${{ runner.os }}-pip-
'
- if: startsWith(runner.os, 'macOS') && matrix.install-method == 'pip'
name: (MACOS,PIP) Cache pip
uses: actions/cache@v3
with:
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
path: ~/Library/Caches/pip
restore-keys: '${{ runner.os }}-pip-
'
- if: startsWith(runner.os, 'Windows') && matrix.install-method == 'pip'
name: (WINDOWS,PIP) Cache pip
uses: actions/cache@v3
with:
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
path: ~\AppData\Local\pip\Cache
restore-keys: '${{ runner.os }}-pip-
'
- if: matrix.install-method == 'pip' && (matrix.python-version != 3.7 || runner.os
!= 'macOS')
name: (PIP) Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- if: matrix.install-method == 'pip' && matrix.python-version == 3.7 && runner.os
== 'macOS'
name: (PIP) Set up Python 3.7
uses: actions/setup-python@v4
with:
python-version: 3.7.16
- if: matrix.install-method == 'pip' && env.INSTALLJULIA == 1
name: (PIP) Set up Julia
uses: julia-actions/setup-julia@v1
- if: env.INSTALLMATLAB == 1 && runner.os != 'Windows'
name: Set up Matlab
uses: matlab-actions/setup-matlab@v1
- if: env.USEVIRTUALENV == 1 && matrix.install-method == 'pip'
name: (PIP) Set up Virtual Env
run: 'python utils/setup_test_env.py env virtualenv ${{ matrix.python-version
}} --env-name=test
echo "source activate ygg" > ~/.bashrc
source test/bin/activate
echo "$VIRTUAL_ENV"
echo "VIRTUAL_ENV=$VIRTUAL_ENV" >> $GITHUB_ENV
echo "PATH=$VIRTUAL_ENV/bin:$PATH" >> $GITHUB_ENV
'
- if: matrix.install-method == 'pip'
name: (PIP) Install dependencies & package
run: python utils/setup_test_env.py install ${{ matrix.install-method }}
- if: runner.os == 'Windows' && matrix.install-method == 'pip' && env.INSTALLC
== 1
name: (WINDOWS,PIP) Set the vcpkg root config value
run: yggconfig --vcpkg-dir=C:\\vcpkg
- if: runner.os == 'Windows' && matrix.install-method == 'pip' && env.INSTALLR
== 1
name: (WINDOWS,PIP) Update R requirements
run: ygginstall R --update-r-requirements
- if: matrix.install-method == 'pip' && runner.os == 'macOS'
name: (MACOS,PIP) Set C compiler to llvm clang
run: yggconfig --c-compiler=/usr/local/opt/llvm/bin/clang --c++-compiler=/usr/local/opt/llvm/bin/clang++
- if: (matrix.install-method == 'conda' || matrix.install-method == 'mamba')
name: (CONDA) Set up miniconda base environment
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
channel-priority: strict
channels: conda-forge
miniforge-variant: Mambaforge
python-version: ${{ matrix.python-version }}
use-mamba: true
use-only-tar-bz2: true
- if: (matrix.install-method == 'conda' || matrix.install-method == 'mamba') &&
runner.os == 'Windows' && env.INSTALLC == 1
name: (WINDOWS,CONDA) Set up MSVC Compiler
uses: ilammy/msvc-dev-cmd@v1
with:
toolset: 14.0
- continue-on-error: true
id: conda_build
if: matrix.install-method == 'conda' || matrix.install-method == 'mamba'
name: (CONDA) Build package in base environment
run: 'conda activate base
python utils/setup_test_env.py build ${{ matrix.install-method }} --python
${{ matrix.python-version }} --use-mamba
'
- if: ${{ steps.conda_build.outcome == 'failure' && (matrix.install-method ==
'conda' || matrix.install-method == 'mamba')}}
name: (CONDA) Build package in base environment (re-attempt)
run: 'conda activate base
python utils/setup_test_env.py build ${{ matrix.install-method }} --python
${{ matrix.python-version }} --use-mamba
'
- if: runner.os == 'macOS' && (matrix.install-method == 'conda' || matrix.install-method
== 'mamba')
name: (MACOS,CONDA) Install old MacOSX SDK for compatibility with the conda
llvm (7)
run: ./utils/setup_old_mac_sdk.sh
- if: runner.os == 'Linux' && matrix.install-sbml == true
name: (LINUX) Install ncurses 5 for SBML runs with libroadrunner
run: sudo apt-get install libncurses5 libncurses5-dev libncursesw5-dev
- continue-on-error: true
id: conda_install
if: matrix.install-method == 'conda' || matrix.install-method == 'mamba'
name: (CONDA) Install dependencies & package from existing build
run: python utils/setup_test_env.py install ${{ matrix.install-method }} --without-build
--use-mamba
- if: ${{ steps.conda_install.outcome == 'failure' && (matrix.install-method ==
'conda' || matrix.install-method == 'mamba')}}
name: (CONDA) Install dependencies & package from existing build (re-attempt)
run: python utils/setup_test_env.py install ${{ matrix.install-method }} --without-build
--use-mamba
- if: (matrix.install-method == 'conda' || matrix.install-method == 'mamba') &&
runner.os == 'macOS'
name: (MACOS,CONDA) Set allow_multiple_omp config
run: '[[ -d $CONDA_PREFIX/lib/clang/9.0.1 ]] && install_name_tool -change "@rpath/libc++abi.1.dylib"
"/usr/lib/libc++abi.1.dylib" $CONDA_PREFIX/lib/clang/9.0.1/lib/darwin/libclang_rt.asan_osx_dynamic.dylib
yggconfig --allow-multiple-omp
'
- name: Verify installation
run: python utils/setup_test_env.py verify
- name: Compile libraries
run: yggcompile
- if: runner.os == 'Windows'
name: Run cmake test in command prompt
run: 'cmake -h
pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py
'
shell: cmd /C CALL {0}
timeout-minutes: 180
- continue-on-error: true
id: test1
name: Run tests (1st)
run: pytest --import-mode=importlib --ci --cov-append ${{ matrix.test-flags1
}} ${{ env.TEST_FLAGS1_SUFFIX }}
timeout-minutes: 180
- if: ${{ steps.test1.outcome == 'failure' }}
name: Re-run test failures (1st)
run: pytest --import-mode=importlib --ci --cov-append ${{ matrix.test-flags1
}} ${{ env.TEST_FLAGS1_SUFFIX }} --last-failed --last-failed-no-failures=all
--second-attempt
timeout-minutes: 180
- continue-on-error: true
id: test1_script
if: ${{ contains(matrix.test-flags1, '--mpi-script') }}
name: Run generated test script (1st)
run: ./run_mpi.sh
timeout-minutes: 180
- if: ${{ steps.test1_script.outcome == 'failure' }}
name: Re-run test script failures (1st)
run: ./run_mpi.sh --last-failed --last-failed-no-failures=all --second-attempt
timeout-minutes: 180
- continue-on-error: true
id: test2
if: ${{ matrix.test-flags2 != '' }}
name: Run tests (2nd)
run: pytest --import-mode=importlib --ci --cov-append ${{ matrix.test-flags2
}}
timeout-minutes: 180
- if: ${{ steps.test2.outcome == 'failure' }}
name: Re-run test failures (2nd)
run: pytest --import-mode=importlib --ci --cov-append ${{ matrix.test-flags2
}} --last-failed --last-failed-no-failures=all --second-attempt
timeout-minutes: 180
- continue-on-error: true
id: test2_script
if: ${{ matrix.test-flags2 != '' && contains(matrix.test-flags2, '--mpi-script')
}}
name: Run generated test script (2nd)
run: ./run_mpi.sh
timeout-minutes: 180
- if: ${{ steps.test2_script.outcome == 'failure' }}
name: Re-run test script failures (2nd)
run: ./run_mpi.sh --last-failed --last-failed-no-failures=all --second-attempt
timeout-minutes: 180
- continue-on-error: true
name: Combine coverage reports
run: '# ls .*
coverage combine --append
'
- if: matrix.install-method == 'conda' || matrix.install-method == 'mamba'
name: (CONDA) Generate XML version of coverage report
run: '# ls .*
coverage xml -i
'
- name: Upload coverage report
uses: codecov/codecov-action@v3
with:
name: ${{ env.YGG_GHA_JOB_ID }}
token: ${{ secrets.CODECOV_TOKEN }}
- continue-on-error: true
if: ${{ always() }}
name: Download the last successful workflow environment log
uses: dawidd6/action-download-artifact@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
name: environment-log-${{ env.YGG_GHA_JOB_ID }}
path: .
workflow: test-install.yml
- if: ${{ always() }}
name: Create a log of Python package versions
run: python utils/setup_test_env.py log
- if: ${{ success() }}
uses: actions/upload-artifact@v3
with:
name: environment-log-${{ env.YGG_GHA_JOB_ID }}
path: new_environment_log.txt
strategy:
fail-fast: false
matrix:
include:
- install-c: true
install-method: conda
install-mpi: false
install-sbml: false
os-base: ubuntu
python-version: 3.6
test-flags1: --long-running
test-flags2: ''
- install-c: true
install-method: conda
install-mpi: false
install-sbml: false
os-base: ubuntu
python-version: 3.8
test-flags1: --long-running
test-flags2: ''
- install-c: true
install-method: conda
install-mpi: false
install-sbml: true
os-base: ubuntu
python-version: 3.9
test-flags1: --long-running --remote-service
test-flags2: --suites examples --parametrize-language=sbml
- install-c: true
install-method: conda
install-mpi: false
install-sbml: false
os-base: macos
python-version: 3.8
test-flags1: --suites examples top --parametrize-example-name=rpc_lesson3
test-flags2: tests/test_tools.py
install-c:
- true
install-method:
- conda
install-mpi:
- true
install-sbml:
- false
os-base:
- ubuntu
- macos
- windows
python-version:
- 3.7
test-flags1:
- --long-running --mpi-script=run_mpi.sh
test-flags2:
- --suite=examples --parametrize-example-name=backwards
max-parallel: 20
test_pip:
name: Test (${{ matrix.python-version }}, ${{ matrix.os-base }}, ${{ matrix.install-method
}}, ${{ matrix.test-flags1 }}, ${{ matrix.test-flags2 }}), Install C = ${{ matrix.install-c
}}
needs: params
runs-on: ${{ matrix.os-base }}-${{ fromJSON(needs.params.outputs.os-versions)[matrix.os-base]
}}
steps:
- uses: actions/checkout@v3
with:
submodules: true
- if: matrix.install-c != true && matrix.install-method != 'conda' && matrix.install-method
!= 'mamba'
name: Set C installation based on matrix value
run: echo "INSTALLC=0" >> $GITHUB_ENV
shell: bash -l {0}
- if: matrix.install-mpi != true
name: Set MPI installation based on matrix value
run: echo "INSTALLMPI=0" >> $GITHUB_ENV
shell: bash -l {0}
- if: matrix.install-sbml == true
name: Set SBML installation based on matrix value
run: echo "INSTALLSBML=1" >> $GITHUB_ENV
shell: bash -l {0}
- name: Store an ID string for the job
run: echo "YGG_GHA_JOB_ID=${{ runner.os }}-${{ matrix.install-method }}-py${{
matrix.python-version }}-C${{ env.INSTALLC }}-RMQ${{ env.INSTALLRMQ }}${{
env.YGG_GHA_JOB_ID_SUFFIX }}" >> $GITHUB_ENV
shell: bash -l {0}
- if: runner.os == 'Windows'
name: (WINDOWS) Patch TEMP/TMPDIR on Windows
run: 'echo "TMPDIR=$USERPROFILE\\AppData\\Local\\Temp" >> $GITHUB_ENV
echo "TEMP=$USERPROFILE\\AppData\\Local\\Temp" >> $GITHUB_ENV
'
shell: bash -l {0}
- if: runner.os == 'Windows' && startsWith(matrix.test-flags1, '--suite=examples')
name: (WINDOWS) Disable interpreted language example on Windows for speed
run: 'echo "TEST_FLAGS1_SUFFIX=--skip-languages python R julia" >> $GITHUB_ENV
'
shell: bash -l {0}
- if: runner.os == 'Windows' && matrix.install-method == 'pip' && env.INSTALLC
== 1
name: (WINDOWS,PIP) Set up MSVC Compiler
uses: ilammy/msvc-dev-cmd@v1
with:
toolset: 14.0
- if: runner.os == 'Windows' && matrix.install-method == 'pip' && env.INSTALLMPI
== 1
name: (WINDOWS,PIP) Set up MSMPI
uses: mpi4py/setup-mpi@v1
- if: runner.os == 'Windows' && matrix.install-method == 'pip' && env.INSTALLR
== 1
name: Install R
uses: r-lib/actions/setup-r@v2
with:
r-version: 4.2.3
- if: startsWith(runner.os, 'Linux') && matrix.install-method == 'pip'
name: (LINUX,PIP) Cache pip
uses: actions/cache@v3
with:
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
path: ~/.cache/pip
restore-keys: '${{ runner.os }}-pip-
'
- if: startsWith(runner.os, 'macOS') && matrix.install-method == 'pip'
name: (MACOS,PIP) Cache pip
uses: actions/cache@v3
with:
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
path: ~/Library/Caches/pip
restore-keys: '${{ runner.os }}-pip-
'
- if: startsWith(runner.os, 'Windows') && matrix.install-method == 'pip'
name: (WINDOWS,PIP) Cache pip
uses: actions/cache@v3
with:
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
path: ~\AppData\Local\pip\Cache
restore-keys: '${{ runner.os }}-pip-
'
- if: matrix.install-method == 'pip' && (matrix.python-version != 3.7 || runner.os
!= 'macOS')
name: (PIP) Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- if: matrix.install-method == 'pip' && matrix.python-version == 3.7 && runner.os
== 'macOS'
name: (PIP) Set up Python 3.7
uses: actions/setup-python@v4
with:
python-version: 3.7.16
- if: matrix.install-method == 'pip' && env.INSTALLJULIA == 1
name: (PIP) Set up Julia
uses: julia-actions/setup-julia@v1
- if: env.INSTALLMATLAB == 1 && runner.os != 'Windows'
name: Set up Matlab
uses: matlab-actions/setup-matlab@v1
- if: env.USEVIRTUALENV == 1 && matrix.install-method == 'pip'
name: (PIP) Set up Virtual Env
run: 'python utils/setup_test_env.py env virtualenv ${{ matrix.python-version
}} --env-name=test
echo "source activate ygg" > ~/.bashrc
source test/bin/activate
echo "$VIRTUAL_ENV"
echo "VIRTUAL_ENV=$VIRTUAL_ENV" >> $GITHUB_ENV
echo "PATH=$VIRTUAL_ENV/bin:$PATH" >> $GITHUB_ENV
'
- if: matrix.install-method == 'pip'
name: (PIP) Install dependencies & package
run: python utils/setup_test_env.py install ${{ matrix.install-method }}
- if: runner.os == 'Windows' && matrix.install-method == 'pip' && env.INSTALLC
== 1
name: (WINDOWS,PIP) Set the vcpkg root config value
run: yggconfig --vcpkg-dir=C:\\vcpkg
- if: runner.os == 'Windows' && matrix.install-method == 'pip' && env.INSTALLR
== 1
name: (WINDOWS,PIP) Update R requirements
run: ygginstall R --update-r-requirements
- if: matrix.install-method == 'pip' && runner.os == 'macOS'
name: (MACOS,PIP) Set C compiler to llvm clang
run: yggconfig --c-compiler=/usr/local/opt/llvm/bin/clang --c++-compiler=/usr/local/opt/llvm/bin/clang++
- if: (matrix.install-method == 'conda' || matrix.install-method == 'mamba')
name: (CONDA) Set up miniconda base environment
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
channel-priority: strict
channels: conda-forge
miniforge-variant: Mambaforge
python-version: ${{ matrix.python-version }}
use-mamba: true
use-only-tar-bz2: true
- if: (matrix.install-method == 'conda' || matrix.install-method == 'mamba') &&
runner.os == 'Windows' && env.INSTALLC == 1
name: (WINDOWS,CONDA) Set up MSVC Compiler
uses: ilammy/msvc-dev-cmd@v1
with:
toolset: 14.0
- continue-on-error: true
id: conda_build
if: matrix.install-method == 'conda' || matrix.install-method == 'mamba'
name: (CONDA) Build package in base environment
run: 'conda activate base
python utils/setup_test_env.py build ${{ matrix.install-method }} --python
${{ matrix.python-version }} --use-mamba
'
- if: ${{ steps.conda_build.outcome == 'failure' && (matrix.install-method ==
'conda' || matrix.install-method == 'mamba')}}
name: (CONDA) Build package in base environment (re-attempt)
run: 'conda activate base
python utils/setup_test_env.py build ${{ matrix.install-method }} --python
${{ matrix.python-version }} --use-mamba
'
- if: runner.os == 'macOS' && (matrix.install-method == 'conda' || matrix.install-method
== 'mamba')
name: (MACOS,CONDA) Install old MacOSX SDK for compatibility with the conda
llvm (7)
run: ./utils/setup_old_mac_sdk.sh
- if: runner.os == 'Linux' && matrix.install-sbml == true
name: (LINUX) Install ncurses 5 for SBML runs with libroadrunner
run: sudo apt-get install libncurses5 libncurses5-dev libncursesw5-dev
- continue-on-error: true
id: conda_install
if: matrix.install-method == 'conda' || matrix.install-method == 'mamba'
name: (CONDA) Install dependencies & package from existing build
run: python utils/setup_test_env.py install ${{ matrix.install-method }} --without-build
--use-mamba
- if: ${{ steps.conda_install.outcome == 'failure' && (matrix.install-method ==
'conda' || matrix.install-method == 'mamba')}}
name: (CONDA) Install dependencies & package from existing build (re-attempt)
run: python utils/setup_test_env.py install ${{ matrix.install-method }} --without-build
--use-mamba
- if: (matrix.install-method == 'conda' || matrix.install-method == 'mamba') &&
runner.os == 'macOS'
name: (MACOS,CONDA) Set allow_multiple_omp config
run: '[[ -d $CONDA_PREFIX/lib/clang/9.0.1 ]] && install_name_tool -change "@rpath/libc++abi.1.dylib"
"/usr/lib/libc++abi.1.dylib" $CONDA_PREFIX/lib/clang/9.0.1/lib/darwin/libclang_rt.asan_osx_dynamic.dylib
yggconfig --allow-multiple-omp
'
- name: Verify installation
run: python utils/setup_test_env.py verify
- name: Compile libraries
run: yggcompile
- if: runner.os == 'Windows'
name: Run cmake test in command prompt
run: 'cmake -h
pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py
'
shell: cmd /C CALL {0}
timeout-minutes: 180
- continue-on-error: true
id: test1
name: Run tests (1st)
run: pytest --import-mode=importlib --ci --cov-append ${{ matrix.test-flags1
}} ${{ env.TEST_FLAGS1_SUFFIX }}
timeout-minutes: 180
- if: ${{ steps.test1.outcome == 'failure' }}
name: Re-run test failures (1st)
run: pytest --import-mode=importlib --ci --cov-append ${{ matrix.test-flags1
}} ${{ env.TEST_FLAGS1_SUFFIX }} --last-failed --last-failed-no-failures=all
--second-attempt
timeout-minutes: 180
- continue-on-error: true
id: test1_script
if: ${{ contains(matrix.test-flags1, '--mpi-script') }}
name: Run generated test script (1st)
run: ./run_mpi.sh
timeout-minutes: 180
- if: ${{ steps.test1_script.outcome == 'failure' }}
name: Re-run test script failures (1st)
run: ./run_mpi.sh --last-failed --last-failed-no-failures=all --second-attempt
timeout-minutes: 180
- continue-on-error: true
id: test2
if: ${{ matrix.test-flags2 != '' }}
name: Run tests (2nd)
run: pytest --import-mode=importlib --ci --cov-append ${{ matrix.test-flags2
}}
timeout-minutes: 180
- if: ${{ steps.test2.outcome == 'failure' }}
name: Re-run test failures (2nd)
run: pytest --import-mode=importlib --ci --cov-append ${{ matrix.test-flags2
}} --last-failed --last-failed-no-failures=all --second-attempt
timeout-minutes: 180
- continue-on-error: true
id: test2_script
if: ${{ matrix.test-flags2 != '' && contains(matrix.test-flags2, '--mpi-script')
}}
name: Run generated test script (2nd)
run: ./run_mpi.sh
timeout-minutes: 180
- if: ${{ steps.test2_script.outcome == 'failure' }}
name: Re-run test script failures (2nd)
run: ./run_mpi.sh --last-failed --last-failed-no-failures=all --second-attempt
timeout-minutes: 180
- continue-on-error: true
name: Combine coverage reports
run: '# ls .*
coverage combine --append
'
- if: matrix.install-method == 'conda' || matrix.install-method == 'mamba'
name: (CONDA) Generate XML version of coverage report
run: '# ls .*
coverage xml -i
'
- name: Upload coverage report
uses: codecov/codecov-action@v3
with:
name: ${{ env.YGG_GHA_JOB_ID }}
token: ${{ secrets.CODECOV_TOKEN }}
- continue-on-error: true
if: ${{ always() }}
name: Download the last successful workflow environment log
uses: dawidd6/action-download-artifact@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
name: environment-log-${{ env.YGG_GHA_JOB_ID }}
path: .
workflow: test-install.yml
- if: ${{ always() }}
name: Create a log of Python package versions
run: python utils/setup_test_env.py log
- if: ${{ success() }}
uses: actions/upload-artifact@v3
with:
name: environment-log-${{ env.YGG_GHA_JOB_ID }}
path: new_environment_log.txt
strategy:
fail-fast: false
matrix:
include:
- install-c: false
install-method: pip
install-mpi: false
install-sbml: false
os-base: windows
python-version: 3.7
test-flags1: --long-running
test-flags2: ''
install-c:
- true
install-method:
- pip
install-mpi:
- true
install-sbml:
- false
os-base:
- ubuntu
- macos
- windows
python-version:
- 3.7
test-flags1:
- --long-running --suites timing demos top
- --suite=examples --extra-examples --mpi-script=run_mpi.sh --mpi-nproc=3
- --suite=types --skip-languages c cpp
- --suite=types --languages c cpp
test-flags2:
- ''
max-parallel: 20
test_rmq_conda:
defaults:
run:
shell: bash -l {0}
env:
INSTALLAPY: 1
INSTALLRMQ: 1
USEVIRTUALENV: 1
name: Test RMQ (${{ matrix.python-version }}, ${{ matrix.os-base }}, ${{ matrix.install-method
}})
needs: params
runs-on: ${{ matrix.os-base }}-${{ fromJSON(needs.params.outputs.os-versions)[matrix.os-base]
}}
services:
rabbitmq:
image: rabbitmq:latest
options: --health-cmd "rabbitmqctl node_health_check" --health-interval 10s
--health-timeout 5s --health-retries 5
ports:
- 5672:5672
steps:
- uses: actions/checkout@v3
with:
submodules: true
- if: matrix.install-c != true && matrix.install-method != 'conda' && matrix.install-method
!= 'mamba'
name: Set C installation based on matrix value
run: echo "INSTALLC=0" >> $GITHUB_ENV
shell: bash -l {0}
- if: matrix.install-mpi != true
name: Set MPI installation based on matrix value
run: echo "INSTALLMPI=0" >> $GITHUB_ENV
shell: bash -l {0}
- if: matrix.install-sbml == true
name: Set SBML installation based on matrix value
run: echo "INSTALLSBML=1" >> $GITHUB_ENV
shell: bash -l {0}
- name: Store an ID string for the job
run: echo "YGG_GHA_JOB_ID=${{ runner.os }}-${{ matrix.install-method }}-py${{
matrix.python-version }}-C${{ env.INSTALLC }}-RMQ${{ env.INSTALLRMQ }}${{
env.YGG_GHA_JOB_ID_SUFFIX }}" >> $GITHUB_ENV
shell: bash -l {0}
- if: runner.os == 'Windows'
name: (WINDOWS) Patch TEMP/TMPDIR on Windows
run: 'echo "TMPDIR=$USERPROFILE\\AppData\\Local\\Temp" >> $GITHUB_ENV
echo "TEMP=$USERPROFILE\\AppData\\Local\\Temp" >> $GITHUB_ENV
'
shell: bash -l {0}
- if: runner.os == 'Windows' && startsWith(matrix.test-flags1, '--suite=examples')
name: (WINDOWS) Disable interpreted language example on Windows for speed
run: 'echo "TEST_FLAGS1_SUFFIX=--skip-languages python R julia" >> $GITHUB_ENV
'
shell: bash -l {0}
- if: runner.os == 'Windows' && matrix.install-method == 'pip' && env.INSTALLC
== 1
name: (WINDOWS,PIP) Set up MSVC Compiler
uses: ilammy/msvc-dev-cmd@v1
with:
toolset: 14.0
- if: runner.os == 'Windows' && matrix.install-method == 'pip' && env.INSTALLMPI
== 1
name: (WINDOWS,PIP) Set up MSMPI
uses: mpi4py/setup-mpi@v1
- if: runner.os == 'Windows' && matrix.install-method == 'pip' && env.INSTALLR
== 1
name: Install R
uses: r-lib/actions/setup-r@v2
with:
r-version: 4.2.3
- if: startsWith(runner.os, 'Linux') && matrix.install-method == 'pip'
name: (LINUX,PIP) Cache pip
uses: actions/cache@v3
with:
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
path: ~/.cache/pip
restore-keys: '${{ runner.os }}-pip-
'
- if: startsWith(runner.os, 'macOS') && matrix.install-method == 'pip'
name: (MACOS,PIP) Cache pip
uses: actions/cache@v3
with:
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
path: ~/Library/Caches/pip
restore-keys: '${{ runner.os }}-pip-
'
- if: startsWith(runner.os, 'Windows') && matrix.install-method == 'pip'
name: (WINDOWS,PIP) Cache pip
uses: actions/cache@v3
with:
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}