-
Notifications
You must be signed in to change notification settings - Fork 322
1073 lines (912 loc) · 43.7 KB
/
continuous_integration.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
name: continuous-integration
# syntax https://help.github.com/en/articles/workflow-syntax-for-github-actions
on:
# Run at 2am every night.
schedule:
- cron: '0 2 * * *'
pull_request:
branches:
- '*'
push:
branches:
- main
tags:
- '*'
jobs:
windows:
name: Windows
runs-on: windows-2019
steps:
- uses: actions/checkout@v4
- name: Install Doxygen
# choco install doxygen.portable # <-- too unreliable.
run: |
(New-Object System.Net.WebClient).DownloadFile("https://github.com/doxygen/doxygen/releases/download/Release_1_12_0/doxygen-1.12.0.windows.x64.bin.zip", "doxygen.zip")
7z x $env:GITHUB_WORKSPACE/doxygen.zip -odoxygen
echo "$env:GITHUB_WORKSPACE\\doxygen" >> $GITHUB_PATH
- name: Install Python packages
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install numpy
#Need numpy to use SWIG numpy typemaps.
run: python3 -m pip install numpy==1.25
- name: Install SWIG
run: |
choco install swig --version 4.1.1 --yes --limit-output --allow-downgrade
swig -swiglib
- name: Cache dependencies
id: cache-dependencies
uses: actions/cache@v3
with:
path: ~/opensim_dependencies_install
# Every time a cache is created, it's stored with this key.
# In subsequent runs, if the key matches the key of an existing cache,
# then the cache is used. We chose for this key to depend on the
# operating system and a hash of the hashes of all files in the
# dependencies directory (non-recursive).
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/caching-dependencies-to-speed-up-workflows#matching-a-cache-key
key: ${{ runner.os }}-dependencies-${{ hashFiles('dependencies/*') }}
- name: Build dependencies
if: steps.cache-dependencies.outputs.cache-hit != 'true'
run: |
echo $env:GITHUB_WORKSPACE\\build_deps
mkdir $env:GITHUB_WORKSPACE\\build_deps
chdir $env:GITHUB_WORKSPACE\\build_deps
# /W0 disables warnings.
# https://msdn.microsoft.com/en-us/library/19z1t1wy.aspx
# TODO: CMake provides /W3, which overrides our /W0
cmake -E env CXXFLAGS="/W0" cmake $env:GITHUB_WORKSPACE/dependencies -LAH -G"Visual Studio 16 2019" -A x64 -DCMAKE_INSTALL_PREFIX=~/opensim_dependencies_install -DSUPERBUILD_ezc3d=ON -DOPENSIM_WITH_TROPTER=ON -DOPENSIM_WITH_CASADI=ON
cmake --build . --config Release -- /maxcpucount:4
- name: Configure opensim-core
id: configure
run: |
mkdir $env:GITHUB_WORKSPACE\\build
chdir $env:GITHUB_WORKSPACE\\build
# TODO: Can remove /WX when we use that in CMakeLists.txt.
# Set the CXXFLAGS environment variable to turn warnings into errors.
# Skip timing test section included by default.
cmake -E env CXXFLAGS="/WX -DSKIP_TIMING" cmake $env:GITHUB_WORKSPACE -LAH -G"Visual Studio 16 2019" -A x64 -DCMAKE_INSTALL_PREFIX=~/opensim-core-install -DOPENSIM_DEPENDENCIES_DIR=~/opensim_dependencies_install -DOPENSIM_C3D_PARSER=ezc3d -DBUILD_PYTHON_WRAPPING=on -DBUILD_JAVA_WRAPPING=on -DOPENSIM_WITH_TROPTER=on -DPython3_ROOT_DIR=C:\hostedtoolcache\windows\Python\3.10.11\x64
$env:match = cmake -L . | Select-String -Pattern OPENSIM_QUALIFIED_VERSION
$version = $env:match.split('=')[1]
echo $version
echo "VERSION=$version" >> $GITHUB_ENV
echo "version=$version" >> $env:GITHUB_OUTPUT
- name: Build opensim-core
# Install now to avoid building bindings twice (issue when using Visual Studio 2019).
run: |
chdir $env:GITHUB_WORKSPACE\\build
cmake --build . --config Release --target doxygen -- /maxcpucount:4
cmake --build . --config Release --target install -- /maxcpucount:4
- name: Test opensim-core
run: |
chdir $env:GITHUB_WORKSPACE\\build
ctest --parallel 4 --output-on-failure --build-config Release
- name: Install opensim-core
# TODO: This is where we wish to do the installing, but it's done above for now.
run: |
chdir $env:GITHUB_WORKSPACE\\build
chdir $env:GITHUB_WORKSPACE
Copy-Item -Path "~/opensim-core-install" -Destination "opensim-core-${{ steps.configure.outputs.version }}" -Recurse
7z a "opensim-core-${{ steps.configure.outputs.version }}.zip" "opensim-core-${{ steps.configure.outputs.version }}"
- name: Test Python bindings
run: |
echo "PYTHONPATH= $env:USERPROFILE/opensim-core-install/bin">> $GITHUB_ENV
# Move to the installed location of the python package.
cd ~/opensim-core-install/sdk/python
# Run python tests.
python -m unittest discover --start-directory opensim/tests --verbose
- name: Upload opensim-core
uses: actions/upload-artifact@v4
with:
name: opensim-core-${{ steps.configure.outputs.version }}-win-2019
path: opensim-core-${{ steps.configure.outputs.version }}.zip
# TODO: Must be relative to the workspace?
# - name: Upload opensim-moco dependencies
# uses: actions/[email protected]
# with:
# name: opensim-core-dependencies
# path: opensim_dependencies_install.zip
# - name: Create release
# id: create-release
# uses: actions/[email protected]
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# tag_name: ${{ github.ref }}
# release_name: OpenSim Core ${{ github.ref }}
# draft: true
# prerelease: false
# - name: Zip opensim-core
# run: |
# 7z a opensim-core-$VERSION.zip opensim-core-${VERSION}
# - name: Upload release asset
# id: upload-release-asset
# uses: actions/[email protected]
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create-release.outputs.upload_url }}
# asset_path: ./opensim-core-${{ github.ref }}.zip
# asset_name: opensim-core-${{ github.ref }}.zip
# asset_content_type: application/zip
windows2022_target:
name: Windows2022 [target]
if: ${{ contains(github.event.pull_request.title, '[perf-win]') || contains(github.event.pull_request.body, '[perf-win]') }}
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.base.ref }}
- name: Install Doxygen
# choco install doxygen.portable # <-- too unreliable.
run: |
(New-Object System.Net.WebClient).DownloadFile("https://github.com/doxygen/doxygen/releases/download/Release_1_12_0/doxygen-1.12.0.windows.x64.bin.zip", "doxygen.zip")
7z x $env:GITHUB_WORKSPACE/doxygen.zip -odoxygen
echo "$env:GITHUB_WORKSPACE\\doxygen" >> $GITHUB_PATH
- name: Install Python packages
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install numpy
#Need numpy to use SWIG numpy typemaps.
run: python3 -m pip install numpy==1.25
- name: Install SWIG
run: |
choco install swig --version 4.1.1 --yes --limit-output --allow-downgrade
swig -swiglib
- name: Cache dependencies
id: cache-dependencies
uses: actions/cache@v3
with:
path: ~/opensim_dependencies_install
# Every time a cache is created, it's stored with this key.
# In subsequent runs, if the key matches the key of an existing cache,
# then the cache is used. We chose for this key to depend on the
# operating system and a hash of the hashes of all files in the
# dependencies directory (non-recursive).
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/caching-dependencies-to-speed-up-workflows#matching-a-cache-key
key: ${{ runner.os }}-dependencies-${{ hashFiles('dependencies/*') }}
- name: Build dependencies
if: steps.cache-dependencies.outputs.cache-hit != 'true'
run: |
echo $env:GITHUB_WORKSPACE\\build_deps
mkdir $env:GITHUB_WORKSPACE\\build_deps
chdir $env:GITHUB_WORKSPACE\\build_deps
# /W0 disables warnings.
# https://msdn.microsoft.com/en-us/library/19z1t1wy.aspx
# TODO: CMake provides /W3, which overrides our /W0
cmake -E env CXXFLAGS="/W0" cmake $env:GITHUB_WORKSPACE/dependencies -LAH -G"Visual Studio 17 2022" -A x64 -DCMAKE_INSTALL_PREFIX=~/opensim_dependencies_install -DSUPERBUILD_ezc3d=ON -DOPENSIM_WITH_TROPTER=ON -DOPENSIM_WITH_CASADI=ON
cmake --build . --config Release -- /maxcpucount:4
- name: Configure opensim-core
id: configure
run: |
mkdir $env:GITHUB_WORKSPACE\\build
chdir $env:GITHUB_WORKSPACE\\build
# TODO: Can remove /WX when we use that in CMakeLists.txt.
# Set the CXXFLAGS environment variable to turn warnings into errors.
# Skip timing test section included by default.
cmake -E env CXXFLAGS="/WX -DSKIP_TIMING" cmake $env:GITHUB_WORKSPACE -LAH -G"Visual Studio 17 2022" -A x64 -DCMAKE_INSTALL_PREFIX=~/opensim-core-install -DOPENSIM_DEPENDENCIES_DIR=~/opensim_dependencies_install -DOPENSIM_C3D_PARSER=ezc3d -DBUILD_PYTHON_WRAPPING=on -DBUILD_JAVA_WRAPPING=on -DPython3_ROOT_DIR=C:\hostedtoolcache\windows\Python\3.10.11\x64
$env:match = cmake -L . | Select-String -Pattern OPENSIM_QUALIFIED_VERSION
$version = $env:match.split('=')[1]
echo $version
echo "VERSION=$version" >> $GITHUB_ENV
echo "version=$version" >> $env:GITHUB_OUTPUT
- name: Build opensim-core
# Install now to avoid building bindings twice (TODO: issue when using Visual Studio 2019, is this an issue too in Visual Studio 2022?).
run: |
chdir $env:GITHUB_WORKSPACE\\build
cmake --build . --config Release --target doxygen -- /maxcpucount:4
cmake --build . --config Release --target install -- /maxcpucount:4
- name: Test opensim-core
run: |
chdir $env:GITHUB_WORKSPACE\\build
ctest --parallel 4 --output-on-failure --build-config Release -E Java_*
- name: Install opensim-core
# TODO: This is where we wish to do the installing, but it's done above for now.
run: |
chdir $env:GITHUB_WORKSPACE\\build
chdir $env:GITHUB_WORKSPACE
Copy-Item -Path "~/opensim-core-install" -Destination "opensim-core-${{ github.event.pull_request.base.ref }}" -Recurse
7z a "opensim-core-${{ github.event.pull_request.base.ref }}.zip" "opensim-core-${{ github.event.pull_request.base.ref }}"
- name: Test Python bindings
run: |
echo "PYTHONPATH= $env:USERPROFILE/opensim-core-install/bin">> $GITHUB_ENV
# Move to the installed location of the python package.
cd ~/opensim-core-install/sdk/python
# Run python tests.
python -m unittest discover --start-directory opensim/tests --verbose
- name: Upload opensim-core
uses: actions/upload-artifact@v4
with:
name: opensim-core-${{ github.event.pull_request.base.ref }}-win
path: opensim-core-${{ github.event.pull_request.base.ref }}.zip
windows2022_source:
runs-on: windows-2022
name: ${{ (contains(github.event.pull_request.title, '[perf-win]') || contains(github.event.pull_request.body, '[perf-win]')) && 'Windows2022 [source]' || 'Windows2022' }}
outputs:
version: ${{ steps.configure.outputs.version }}
steps:
- uses: actions/checkout@v4
- name: Install Doxygen
# choco install doxygen.portable # <-- too unreliable.
run: |
(New-Object System.Net.WebClient).DownloadFile("https://github.com/doxygen/doxygen/releases/download/Release_1_12_0/doxygen-1.12.0.windows.x64.bin.zip", "doxygen.zip")
7z x $env:GITHUB_WORKSPACE/doxygen.zip -odoxygen
echo "$env:GITHUB_WORKSPACE\\doxygen" >> $GITHUB_PATH
- name: Install Python packages
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install numpy
#Need numpy to use SWIG numpy typemaps.
run: python3 -m pip install numpy==1.25
- name: Install SWIG
run: |
choco install swig --version 4.1.1 --yes --limit-output --allow-downgrade
swig -swiglib
- name: Cache dependencies
id: cache-dependencies
uses: actions/cache@v3
with:
path: ~/opensim_dependencies_install
# Every time a cache is created, it's stored with this key.
# In subsequent runs, if the key matches the key of an existing cache,
# then the cache is used. We chose for this key to depend on the
# operating system and a hash of the hashes of all files in the
# dependencies directory (non-recursive).
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/caching-dependencies-to-speed-up-workflows#matching-a-cache-key
key: ${{ runner.os }}-dependencies-${{ hashFiles('dependencies/*') }}
- name: Build dependencies
if: steps.cache-dependencies.outputs.cache-hit != 'true'
run: |
echo $env:GITHUB_WORKSPACE\\build_deps
mkdir $env:GITHUB_WORKSPACE\\build_deps
chdir $env:GITHUB_WORKSPACE\\build_deps
# /W0 disables warnings.
# https://msdn.microsoft.com/en-us/library/19z1t1wy.aspx
# TODO: CMake provides /W3, which overrides our /W0
cmake -E env CXXFLAGS="/W0" cmake $env:GITHUB_WORKSPACE/dependencies -LAH -G"Visual Studio 17 2022" -A x64 -DCMAKE_INSTALL_PREFIX=~/opensim_dependencies_install -DSUPERBUILD_ezc3d=ON -DOPENSIM_WITH_TROPTER=ON -DOPENSIM_WITH_CASADI=ON
cmake --build . --config Release -- /maxcpucount:4
- name: Configure opensim-core
id: configure
run: |
mkdir $env:GITHUB_WORKSPACE\\build
chdir $env:GITHUB_WORKSPACE\\build
# TODO: Can remove /WX when we use that in CMakeLists.txt.
# Set the CXXFLAGS environment variable to turn warnings into errors.
# Skip timing test section included by default.
cmake -E env CXXFLAGS="/WX -DSKIP_TIMING" cmake $env:GITHUB_WORKSPACE -LAH -G"Visual Studio 17 2022" -A x64 -DCMAKE_INSTALL_PREFIX=~/opensim-core-install -DOPENSIM_DEPENDENCIES_DIR=~/opensim_dependencies_install -DOPENSIM_C3D_PARSER=ezc3d -DOPENSIM_WITH_TROPTER=on -DOPENSIM_WITH_CASADI=on -DBUILD_PYTHON_WRAPPING=on -DBUILD_JAVA_WRAPPING=on -DPython3_ROOT_DIR=C:\hostedtoolcache\windows\Python\3.10.11\x64
$env:match = cmake -L . | Select-String -Pattern OPENSIM_QUALIFIED_VERSION
$version = $env:match.split('=')[1]
echo $version
echo "VERSION=$version" >> $GITHUB_ENV
echo "version=$version" >> $env:GITHUB_OUTPUT
- name: Build opensim-core
# Install now to avoid building bindings twice (TODO: issue when using Visual Studio 2019, is this an issue too in Visual Studio 2022?).
run: |
chdir $env:GITHUB_WORKSPACE\\build
cmake --build . --config Release --target doxygen -- /maxcpucount:4
cmake --build . --config Release --target install -- /maxcpucount:4
- name: Test opensim-core
run: |
chdir $env:GITHUB_WORKSPACE\\build
ctest --parallel 4 --output-on-failure --build-config Release -E Java_*
- name: Install opensim-core
# TODO: This is where we wish to do the installing, but it's done above for now.
run: |
chdir $env:GITHUB_WORKSPACE\\build
chdir $env:GITHUB_WORKSPACE
Copy-Item -Path "~/opensim-core-install" -Destination "opensim-core-${{ steps.configure.outputs.version }}" -Recurse
7z a "opensim-core-${{ steps.configure.outputs.version }}.zip" "opensim-core-${{ steps.configure.outputs.version }}"
- name: Test Python bindings
run: |
echo "PYTHONPATH= $env:USERPROFILE/opensim-core-install/bin">> $GITHUB_ENV
# Move to the installed location of the python package.
cd ~/opensim-core-install/sdk/python
# Run python tests.
python -m unittest discover --start-directory opensim/tests --verbose
- name: Upload opensim-core
uses: actions/upload-artifact@v4
with:
name: opensim-core-${{ steps.configure.outputs.version }}-win
path: opensim-core-${{ steps.configure.outputs.version }}.zip
mac_target:
name: Mac [target]
runs-on: macos-14
if: ${{ contains(github.event.pull_request.title, '[perf-mac]') || contains(github.event.pull_request.body, '[perf-mac]') }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.base.ref }}
- name: Install Python packages
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Homebrew packages
# Save the gfortran version to a file so we can use it in the cache key.
run: |
brew install cmake pkgconfig autoconf libtool automake wget pcre doxygen llvm
brew reinstall gcc
pip3 install numpy==1.25
gfortran -v
mkdir gfortran_version
gfortran -v &> gfortran_version/gfortran_version.txt
- name: Cache SWIG
id: cache-swig
uses: actions/cache@v3
with:
path: ~/swig
key: ${{ runner.os }}-swig
- name: Install SWIG
# if: steps.cache-swig.outputs.cache-hit != 'true'
run: |
mkdir ~/swig-source && cd ~/swig-source
wget https://github.com/swig/swig/archive/refs/tags/v4.1.1.tar.gz
tar xzf v4.1.1.tar.gz && cd swig-4.1.1
sh autogen.sh && ./configure --prefix=$HOME/swig --disable-ccache
make && make -j4 install
- name: Cache dependencies
id: cache-dependencies
uses: actions/cache@v3
with:
path: ~/opensim_dependencies_install
# If Homebrew updates the gcc package, then our cache of IPOPT is invalid.
# Specifically, the pkgcfg_lib_IPOPT_gfortran CMake variable becomes
# undefined.
key: ${{ runner.os }}-dependencies-${{ hashFiles('dependencies/*') }}-${{ hashFiles('gfortran_version/*') }}
- name: Build dependencies
if: steps.cache-dependencies.outputs.cache-hit != 'true'
run: |
mkdir $GITHUB_WORKSPACE/../build_deps
cd $GITHUB_WORKSPACE/../build_deps
DEP_CMAKE_ARGS=($GITHUB_WORKSPACE/dependencies -LAH)
DEP_CMAKE_ARGS+=(-DCMAKE_INSTALL_PREFIX=~/opensim_dependencies_install)
DEP_CMAKE_ARGS+=(-DCMAKE_BUILD_TYPE=Release)
DEP_CMAKE_ARGS+=(-DSUPERBUILD_ezc3d=ON)
DEP_CMAKE_ARGS+=(-DOPENSIM_WITH_TROPTER=ON)
DEP_CMAKE_ARGS+=(-DOPENSIM_WITH_CASADI=ON)
DEP_CMAKE_ARGS+=(-DOPENSIM_DISABLE_LOG_FILE=ON)
DEP_CMAKE_ARGS+=(-DCMAKE_OSX_DEPLOYMENT_TARGET=11)
printf '%s\n' "${DEP_CMAKE_ARGS[@]}"
cmake "${DEP_CMAKE_ARGS[@]}"
make --jobs 4
- name: Configure opensim-core
id: configure
run: |
mkdir $GITHUB_WORKSPACE/../build
cd $GITHUB_WORKSPACE/../build
OSIM_CMAKE_ARGS=($GITHUB_WORKSPACE -LAH)
OSIM_CMAKE_ARGS+=(-DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/../opensim-core-install)
OSIM_CMAKE_ARGS+=(-DCMAKE_BUILD_TYPE=Release)
OSIM_CMAKE_ARGS+=(-DOPENSIM_DEPENDENCIES_DIR=~/opensim_dependencies_install)
OSIM_CMAKE_ARGS+=(-DCMAKE_OSX_DEPLOYMENT_TARGET=11)
OSIM_CMAKE_ARGS+=(-DOPENSIM_C3D_PARSER=ezc3d)
OSIM_CMAKE_ARGS+=(-DBUILD_PYTHON_WRAPPING=on -DBUILD_JAVA_WRAPPING=on)
OSIM_CMAKE_ARGS+=(-DSWIG_EXECUTABLE=$HOME/swig/bin/swig)
OSIM_CMAKE_ARGS+=(-DOPENSIM_INSTALL_UNIX_FHS=OFF)
OSIM_CMAKE_ARGS+=(-DOPENSIM_DOXYGEN_USE_MATHJAX=off)
# TODO: Update to simbody.github.io/latest
OSIM_CMAKE_ARGS+=(-DOPENSIM_SIMBODY_DOXYGEN_LOCATION="https://simbody.github.io/simtk.org/api_docs/simbody/latest/")
OSIM_CMAKE_ARGS+=(-DCMAKE_CXX_FLAGS="-Werror, -Wdeprecated-copy")
printf '%s\n' "${OSIM_CMAKE_ARGS[@]}"
cmake "${OSIM_CMAKE_ARGS[@]}"
VERSION=`cmake -L . | grep OPENSIM_QUALIFIED_VERSION | cut -d "=" -f2`
echo $VERSION
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Build opensim-core
run: |
cd $GITHUB_WORKSPACE/../build
make --jobs 4
- name: Test opensim-core
run: |
cd $GITHUB_WORKSPACE/../build
ctest --parallel 4 --output-on-failure
- name: Install opensim-core
run: |
cd $GITHUB_WORKSPACE/../build
make doxygen
make install
cd $GITHUB_WORKSPACE
mv $GITHUB_WORKSPACE/../opensim-core-install opensim-core-${{ github.event.pull_request.base.ref }}
zip --symlinks --recurse-paths --quiet opensim-core-${{ github.event.pull_request.base.ref }}.zip opensim-core-${{ github.event.pull_request.base.ref }}
mv opensim-core-${{ github.event.pull_request.base.ref }} $GITHUB_WORKSPACE/../opensim-core-install
- name: Test Python bindings
run: |
cd $GITHUB_WORKSPACE/../opensim-core-install/sdk/Python
# Run the python tests, verbosely.
python3 -m unittest discover --start-directory opensim/tests --verbose
- name: Upload opensim-core
uses: actions/upload-artifact@v4
with:
# The upload-artifact zipping does not preserve symlinks or executable
# bits. So we zip ourselves, even though this causes a double-zip.
name: opensim-core-${{ github.event.pull_request.base.ref }}-mac
path: opensim-core-${{ github.event.pull_request.base.ref }}.zip
mac_source:
runs-on: macos-14
name: ${{ (contains(github.event.pull_request.title, '[perf-mac]') || contains(github.event.pull_request.body, '[perf-mac]')) && 'Mac [source]' || 'Mac' }}
outputs:
version: ${{ steps.configure.outputs.version }}
steps:
- uses: actions/checkout@v4
- name: Install Python packages
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Homebrew packages
# Save the gfortran version to a file so we can use it in the cache key.
run: |
brew install cmake pkgconfig autoconf libtool automake wget pcre doxygen llvm
brew reinstall gcc
pip3 install numpy==1.25
gfortran -v
mkdir gfortran_version
gfortran -v &> gfortran_version/gfortran_version.txt
- name: Cache SWIG
id: cache-swig
uses: actions/cache@v3
with:
path: ~/swig
key: ${{ runner.os }}-swig
- name: Install SWIG
# if: steps.cache-swig.outputs.cache-hit != 'true'
run: |
mkdir ~/swig-source && cd ~/swig-source
wget https://github.com/swig/swig/archive/refs/tags/v4.1.1.tar.gz
tar xzf v4.1.1.tar.gz && cd swig-4.1.1
sh autogen.sh && ./configure --prefix=$HOME/swig --disable-ccache
make && make -j4 install
- name: Cache dependencies
id: cache-dependencies
uses: actions/cache@v3
with:
path: ~/opensim_dependencies_install
# If Homebrew updates the gcc package, then our cache of IPOPT is invalid.
# Specifically, the pkgcfg_lib_IPOPT_gfortran CMake variable becomes
# undefined.
key: ${{ runner.os }}-dependencies-${{ hashFiles('dependencies/*') }}-${{ hashFiles('gfortran_version/*') }}
- name: Build dependencies
if: steps.cache-dependencies.outputs.cache-hit != 'true'
run: |
mkdir $GITHUB_WORKSPACE/../build_deps
cd $GITHUB_WORKSPACE/../build_deps
DEP_CMAKE_ARGS=($GITHUB_WORKSPACE/dependencies -LAH)
DEP_CMAKE_ARGS+=(-DCMAKE_INSTALL_PREFIX=~/opensim_dependencies_install)
DEP_CMAKE_ARGS+=(-DCMAKE_BUILD_TYPE=Release)
DEP_CMAKE_ARGS+=(-DSUPERBUILD_ezc3d=ON)
DEP_CMAKE_ARGS+=(-DOPENSIM_WITH_TROPTER=ON)
DEP_CMAKE_ARGS+=(-DOPENSIM_WITH_CASADI=ON)
DEP_CMAKE_ARGS+=(-DOPENSIM_DISABLE_LOG_FILE=ON)
DEP_CMAKE_ARGS+=(-DCMAKE_OSX_DEPLOYMENT_TARGET=11)
printf '%s\n' "${DEP_CMAKE_ARGS[@]}"
cmake "${DEP_CMAKE_ARGS[@]}"
make --jobs 4
- name: Configure opensim-core
id: configure
run: |
mkdir $GITHUB_WORKSPACE/../build
cd $GITHUB_WORKSPACE/../build
OSIM_CMAKE_ARGS=($GITHUB_WORKSPACE -LAH)
OSIM_CMAKE_ARGS+=(-DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/../opensim-core-install)
OSIM_CMAKE_ARGS+=(-DCMAKE_BUILD_TYPE=Release)
OSIM_CMAKE_ARGS+=(-DOPENSIM_DEPENDENCIES_DIR=~/opensim_dependencies_install)
OSIM_CMAKE_ARGS+=(-DCMAKE_OSX_DEPLOYMENT_TARGET=11)
OSIM_CMAKE_ARGS+=(-DOPENSIM_C3D_PARSER=ezc3d)
OSIM_CMAKE_ARGS+=(-DBUILD_PYTHON_WRAPPING=on -DBUILD_JAVA_WRAPPING=on)
OSIM_CMAKE_ARGS+=(-DSWIG_EXECUTABLE=$HOME/swig/bin/swig)
OSIM_CMAKE_ARGS+=(-DOPENSIM_INSTALL_UNIX_FHS=OFF)
OSIM_CMAKE_ARGS+=(-DOPENSIM_DOXYGEN_USE_MATHJAX=off)
# TODO: Update to simbody.github.io/latest
OSIM_CMAKE_ARGS+=(-DOPENSIM_SIMBODY_DOXYGEN_LOCATION="https://simbody.github.io/simtk.org/api_docs/simbody/latest/")
OSIM_CMAKE_ARGS+=(-DCMAKE_CXX_FLAGS="-Werror, -Wdeprecated-copy")
printf '%s\n' "${OSIM_CMAKE_ARGS[@]}"
cmake "${OSIM_CMAKE_ARGS[@]}"
VERSION=`cmake -L . | grep OPENSIM_QUALIFIED_VERSION | cut -d "=" -f2`
echo $VERSION
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Build opensim-core
run: |
cd $GITHUB_WORKSPACE/../build
make --jobs 4
- name: Test opensim-core
run: |
cd $GITHUB_WORKSPACE/../build
ctest --parallel 4 --output-on-failure
- name: Install opensim-core
run: |
cd $GITHUB_WORKSPACE/../build
make doxygen
make install
cd $GITHUB_WORKSPACE
mv $GITHUB_WORKSPACE/../opensim-core-install opensim-core-${{ steps.configure.outputs.version }}
zip --symlinks --recurse-paths --quiet opensim-core-${{ steps.configure.outputs.version }}.zip opensim-core-${{ steps.configure.outputs.version }}
mv opensim-core-${{ steps.configure.outputs.version }} $GITHUB_WORKSPACE/../opensim-core-install
- name: Test Python bindings
run: |
cd $GITHUB_WORKSPACE/../opensim-core-install/sdk/Python
# Run the python tests, verbosely.
python3 -m unittest discover --start-directory opensim/tests --verbose
- name: Upload opensim-core
uses: actions/upload-artifact@v4
with:
# The upload-artifact zipping does not preserve symlinks or executable
# bits. So we zip ourselves, even though this causes a double-zip.
name: opensim-core-${{ steps.configure.outputs.version }}-mac
path: opensim-core-${{ steps.configure.outputs.version }}.zip
performance_analysis_win:
name: Performance Analysis (Windows)
env:
GH_TOKEN: ${{ github.token }}
needs:
- windows2022_target
- windows2022_source
runs-on: ubuntu-latest
if: ${{ contains(github.event.pull_request.title, '[perf-win]') || contains(github.event.pull_request.body, '[perf-win]') }}
steps:
- name: Trigger opensim-perf workflow
uses: Codex-/[email protected]
id: return_dispatch
with:
token: ${{ secrets.PERF_DISPATCH_PAT }}
repo: opensim-perf
owner: opensim-org
ref: main
workflow: performance_analysis_win.yml
workflow_inputs: '{"commit_sha": "${{ github.event.pull_request.head.sha }}", "target_artifact_name": "opensim-core-${{ github.event.pull_request.base.ref }}-win", "source_artifact_name": "opensim-core-${{ needs.windows2022_source.outputs.version }}-win", "target_artifact_zip": "opensim-core-${{ github.event.pull_request.base.ref }}.zip", "source_artifact_zip": "opensim-core-${{ needs.windows2022_source.outputs.version }}.zip"}'
- name: Await opensim-perf workflow
uses: Codex-/[email protected]
with:
token: ${{ secrets.PERF_DISPATCH_PAT }}
repo: opensim-perf
owner: opensim-org
run_id: ${{ steps.return_dispatch.outputs.run_id }}
run_timeout_seconds: 10000
- name: Download performance analysis results
id: download-artifact
uses: dawidd6/[email protected]
with:
github_token: ${{ secrets.PERF_DISPATCH_PAT }}
run_id: ${{ steps.return_dispatch.outputs.run_id }}
workflow: performance_analysis_win.yml
name: performance-results
path: results
repo: opensim-org/opensim-perf
- name: Post results to pull request description
run: |
PR_NUMBER=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH")
EXISTING_COMMENT_CONTENT=$(gh api /repos/opensim-org/opensim-core/pulls/${PR_NUMBER} | jq -r '.body')
CUSTOM_HEADER="### Performance analysis"
REVIEWABLE_TAG="<!-- Reviewable:start -->"
REVIEWABLE_CONTENT=""
if [[ $EXISTING_COMMENT_CONTENT == *"$REVIEWABLE_TAG"* ]]; then
REVIEWABLE_CONTENT=$(echo "$EXISTING_COMMENT_CONTENT" | awk "/$REVIEWABLE_TAG/,0")
fi
if [[ $EXISTING_COMMENT_CONTENT == *"$CUSTOM_HEADER"* ]]; then
CONTENT_TO_REPLACE=$(echo "$EXISTING_COMMENT_CONTENT" | awk "/$CUSTOM_HEADER/,0")
else
CONTENT_TO_REPLACE=${REVIEWABLE_CONTENT}
fi
NEW_CONTENT="${CUSTOM_HEADER}
Platform: Windows, self-hosted runner
$(cat results/performance_results.md)
${REVIEWABLE_CONTENT}
"
NEW_COMMENT_BODY="${EXISTING_COMMENT_CONTENT/"${CONTENT_TO_REPLACE}"/${NEW_CONTENT}}"
# Update the existing description
gh api \
--method PATCH \
-H "Content-Type: application/json" \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
repos/opensim-org/opensim-core/pulls/${PR_NUMBER} \
-f "body=${NEW_COMMENT_BODY}"
performance_analysis_mac:
name: Performance Analysis (Mac)
env:
GH_TOKEN: ${{ github.token }}
needs:
- mac_target
- mac_source
runs-on: ubuntu-latest
if: ${{ contains(github.event.pull_request.title, '[perf-mac]') || contains(github.event.pull_request.body, '[perf-mac]') }}
steps:
- name: Trigger opensim-perf workflow
uses: Codex-/[email protected]
id: return_dispatch
with:
token: ${{ secrets.PERF_DISPATCH_PAT }}
repo: opensim-perf
owner: opensim-org
ref: main
workflow: performance_analysis_mac.yml
workflow_inputs: '{"commit_sha": "${{ github.event.pull_request.head.sha }}", "target_artifact_name": "opensim-core-${{ github.event.pull_request.base.ref }}-mac", "source_artifact_name": "opensim-core-${{ needs.mac_source.outputs.version }}-mac", "target_artifact_zip": "opensim-core-${{ github.event.pull_request.base.ref }}.zip", "source_artifact_zip": "opensim-core-${{ needs.mac_source.outputs.version }}.zip"}'
- name: Await opensim-perf workflow
uses: Codex-/[email protected]
with:
token: ${{ secrets.PERF_DISPATCH_PAT }}
repo: opensim-perf
owner: opensim-org
run_id: ${{ steps.return_dispatch.outputs.run_id }}
run_timeout_seconds: 10000
- name: Download performance analysis results
id: download-artifact
uses: dawidd6/[email protected]
with:
github_token: ${{ secrets.PERF_DISPATCH_PAT }}
run_id: ${{ steps.return_dispatch.outputs.run_id }}
workflow: performance_analysis_mac.yml
name: performance-results
path: results
repo: opensim-org/opensim-perf
- name: Post results to pull request description
run: |
PR_NUMBER=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH")
EXISTING_COMMENT_CONTENT=$(gh api /repos/opensim-org/opensim-core/pulls/${PR_NUMBER} | jq -r '.body')
CUSTOM_HEADER="### Performance analysis"
REVIEWABLE_TAG="<!-- Reviewable:start -->"
REVIEWABLE_CONTENT=""
if [[ $EXISTING_COMMENT_CONTENT == *"$REVIEWABLE_TAG"* ]]; then
REVIEWABLE_CONTENT=$(echo "$EXISTING_COMMENT_CONTENT" | awk "/$REVIEWABLE_TAG/,0")
fi
if [[ $EXISTING_COMMENT_CONTENT == *"$CUSTOM_HEADER"* ]]; then
CONTENT_TO_REPLACE=$(echo "$EXISTING_COMMENT_CONTENT" | awk "/$CUSTOM_HEADER/,0")
else
CONTENT_TO_REPLACE=${REVIEWABLE_CONTENT}
fi
NEW_CONTENT="${CUSTOM_HEADER}
Platform: Mac, GitHub Actions runner
$(cat results/performance_results.md)
${REVIEWABLE_CONTENT}
"
NEW_COMMENT_BODY="${EXISTING_COMMENT_CONTENT/"${CONTENT_TO_REPLACE}"/${NEW_CONTENT}}"
# Update the existing description
gh api \
--method PATCH \
-H "Content-Type: application/json" \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
repos/opensim-org/opensim-core/pulls/${PR_NUMBER} \
-f "body=${NEW_COMMENT_BODY}"
ubuntu20:
name: Ubuntu2004
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Install Python packages
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Numpy
run: |
pip install pip --upgrade
pip install numpy==1.25
- name: Install packages
run: sudo apt-get update && sudo apt-get install --yes build-essential libtool autoconf pkg-config gfortran libopenblas-dev liblapack-dev freeglut3-dev libxi-dev libxmu-dev doxygen patchelf
- name: Install SWIG
# if: steps.cache-swig.outputs.cache-hit != 'true'
run: |
mkdir ~/swig-source && cd ~/swig-source
wget https://github.com/swig/swig/archive/refs/tags/v4.1.1.tar.gz
tar xzf v4.1.1.tar.gz && cd swig-4.1.1
sh autogen.sh && ./configure --prefix=$HOME/swig --disable-ccache
make && make -j4 install
- name: Cache dependencies
id: cache-dependencies
uses: actions/cache@v3
with:
path: ~/opensim_dependencies_install
key: ${{ runner.os }}-dependencies-${{ hashFiles('dependencies/*') }}
- name: Build dependencies
# if: steps.cache-dependencies.outputs.cache-hit != 'true'
run: |
mkdir $GITHUB_WORKSPACE/../build_deps
cd $GITHUB_WORKSPACE/../build_deps
DEP_CMAKE_ARGS=($GITHUB_WORKSPACE/dependencies -LAH)
DEP_CMAKE_ARGS+=(-DCMAKE_INSTALL_PREFIX=~/opensim_dependencies_install)
DEP_CMAKE_ARGS+=(-DCMAKE_BUILD_TYPE=Release)
DEP_CMAKE_ARGS+=(-DSUPERBUILD_ezc3d=ON)
DEP_CMAKE_ARGS+=(-DOPENSIM_WITH_TROPTER=ON)
DEP_CMAKE_ARGS+=(-DOPENSIM_WITH_CASADI=ON)
printf '%s\n' "${DEP_CMAKE_ARGS[@]}"
cmake "${DEP_CMAKE_ARGS[@]}"
make --jobs 4
- name: Configure opensim-core
id: configure
run: |
mkdir $GITHUB_WORKSPACE/../build
cd $GITHUB_WORKSPACE/../build
OSIM_CMAKE_ARGS=($GITHUB_WORKSPACE -LAH)
OSIM_CMAKE_ARGS+=(-DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/../opensim-core-install)
OSIM_CMAKE_ARGS+=(-DCMAKE_BUILD_TYPE=Release)
OSIM_CMAKE_ARGS+=(-DOPENSIM_DEPENDENCIES_DIR=~/opensim_dependencies_install)
OSIM_CMAKE_ARGS+=(-DOPENSIM_C3D_PARSER=ezc3d)
OSIM_CMAKE_ARGS+=(-DBUILD_PYTHON_WRAPPING=on -DBUILD_JAVA_WRAPPING=on)
OSIM_CMAKE_ARGS+=(-DSWIG_DIR=~/swig/share/swig)
OSIM_CMAKE_ARGS+=(-DSWIG_EXECUTABLE=~/swig/bin/swig)
OSIM_CMAKE_ARGS+=(-DOPENSIM_INSTALL_UNIX_FHS=OFF)
OSIM_CMAKE_ARGS+=(-DOPENSIM_DOXYGEN_USE_MATHJAX=off)
# TODO: Update to simbody.github.io/latest
OSIM_CMAKE_ARGS+=(-DOPENSIM_SIMBODY_DOXYGEN_LOCATION="https://simbody.github.io/simtk.org/api_docs/simbody/latest/")
OSIM_CMAKE_ARGS+=(-DCMAKE_CXX_FLAGS="-Werror")
printf '%s\n' "${OSIM_CMAKE_ARGS[@]}"
cmake "${OSIM_CMAKE_ARGS[@]}"
VERSION=`cmake -L . | grep OPENSIM_QUALIFIED_VERSION | cut -d "=" -f2`
echo $VERSION
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Build opensim-core
run: |
cd $GITHUB_WORKSPACE/../build
make --jobs 4
- name: Test opensim-core
run: |
cd $GITHUB_WORKSPACE/../build
# TODO: Temporary for python to find Simbody libraries.
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/opensim_dependencies_install/simbody/lib
ctest --parallel 4 --output-on-failure
- name: Install opensim-core
run: |
cd $GITHUB_WORKSPACE/../build
make doxygen
make --jobs 4 install
cd $GITHUB_WORKSPACE
mv $GITHUB_WORKSPACE/../opensim-core-install opensim-core-${{ steps.configure.outputs.version }}
zip --symlinks --recurse-paths --quiet opensim-core-${{ steps.configure.outputs.version }}-ub20.zip opensim-core-${{ steps.configure.outputs.version }}
mv opensim-core-${{ steps.configure.outputs.version }} $GITHUB_WORKSPACE/../opensim-core-install
# - name: Test Python bindings
# run: |
# echo "TODO: Skipping Python tests."
# # cd $GITHUB_WORKSPACE/../opensim-core-install/sdk/Python
# # Run the python tests, verbosely.
# # python3 -m unittest discover --start-directory opensim/tests --verbose
- name: Upload opensim-core
uses: actions/upload-artifact@v4
with:
# The upload-artifact zipping does not preserve symlinks or executable
# bits. So we zip ourselves, even though this causes a double-zip.
name: opensim-core-${{ steps.configure.outputs.version }}-ub20-linux
path: opensim-core-${{ steps.configure.outputs.version }}-ub20.zip
ubuntu20-nomoco:
name: Ubuntu2004-nomoco
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Install Python packages
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Numpy
run: |
pip install pip --upgrade
pip install numpy==1.25
- name: Install packages
run: sudo apt-get update && sudo apt-get install --yes build-essential libtool autoconf pkg-config gfortran libopenblas-dev liblapack-dev freeglut3-dev libxi-dev libxmu-dev doxygen patchelf
- name: Install SWIG
# if: steps.cache-swig.outputs.cache-hit != 'true'
run: |
mkdir ~/swig-source && cd ~/swig-source
wget https://github.com/swig/swig/archive/refs/tags/v4.1.1.tar.gz
tar xzf v4.1.1.tar.gz && cd swig-4.1.1
sh autogen.sh && ./configure --prefix=$HOME/swig --disable-ccache
make && make -j4 install
- name: Cache dependencies
id: cache-dependencies
uses: actions/cache@v3
with:
path: ~/opensim_dependencies_install
key: ${{ runner.os }}-dependencies-${{ hashFiles('dependencies/*') }}
- name: Build dependencies
if: steps.cache-dependencies.outputs.cache-hit != 'true'
run: |
mkdir $GITHUB_WORKSPACE/../build_deps
cd $GITHUB_WORKSPACE/../build_deps
DEP_CMAKE_ARGS=($GITHUB_WORKSPACE/dependencies -LAH)
DEP_CMAKE_ARGS+=(-DCMAKE_INSTALL_PREFIX=~/opensim_dependencies_install)
DEP_CMAKE_ARGS+=(-DCMAKE_BUILD_TYPE=Release)
DEP_CMAKE_ARGS+=(-DSUPERBUILD_ezc3d=ON)
DEP_CMAKE_ARGS+=(-DOPENSIM_WITH_TROPTER=OFF)
DEP_CMAKE_ARGS+=(-DOPENSIM_WITH_CASADI=OFF)
printf '%s\n' "${DEP_CMAKE_ARGS[@]}"
cmake "${DEP_CMAKE_ARGS[@]}"
make --jobs 4
- name: Configure opensim-core
id: configure
run: |
mkdir $GITHUB_WORKSPACE/../build
cd $GITHUB_WORKSPACE/../build
OSIM_CMAKE_ARGS=($GITHUB_WORKSPACE -LAH)
OSIM_CMAKE_ARGS+=(-DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/../opensim-core-install)
OSIM_CMAKE_ARGS+=(-DCMAKE_BUILD_TYPE=Release)
OSIM_CMAKE_ARGS+=(-DOPENSIM_DEPENDENCIES_DIR=~/opensim_dependencies_install)
OSIM_CMAKE_ARGS+=(-DOPENSIM_C3D_PARSER=ezc3d)
OSIM_CMAKE_ARGS+=(-DBUILD_PYTHON_WRAPPING=on -DBUILD_JAVA_WRAPPING=on)
OSIM_CMAKE_ARGS+=(-DSWIG_DIR=~/swig/share/swig)
OSIM_CMAKE_ARGS+=(-DSWIG_EXECUTABLE=~/swig/bin/swig)
OSIM_CMAKE_ARGS+=(-DOPENSIM_INSTALL_UNIX_FHS=OFF)
OSIM_CMAKE_ARGS+=(-DOPENSIM_DOXYGEN_USE_MATHJAX=off)
OSIM_CMAKE_ARGS+=(-DOPENSIM_WITH_TROPTER=off)
OSIM_CMAKE_ARGS+=(-DOPENSIM_WITH_CASADI=off)
# TODO: Update to simbody.github.io/latest
OSIM_CMAKE_ARGS+=(-DOPENSIM_SIMBODY_DOXYGEN_LOCATION="https://simbody.github.io/simtk.org/api_docs/simbody/latest/")
OSIM_CMAKE_ARGS+=(-DCMAKE_CXX_FLAGS="-Werror")
printf '%s\n' "${OSIM_CMAKE_ARGS[@]}"
cmake "${OSIM_CMAKE_ARGS[@]}"
VERSION=`cmake -L . | grep OPENSIM_QUALIFIED_VERSION | cut -d "=" -f2`
echo $VERSION
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Build opensim-core
run: |
cd $GITHUB_WORKSPACE/../build
make --jobs 4
- name: Test opensim-core
run: |
cd $GITHUB_WORKSPACE/../build
# TODO: Temporary for python to find Simbody libraries.
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/opensim_dependencies_install/simbody/lib
# ctest --parallel 4 --output-on-failure
- name: Install opensim-core
run: |