forked from casadi/casadi
-
Notifications
You must be signed in to change notification settings - Fork 0
1124 lines (1083 loc) · 47.8 KB
/
binaries.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: binaries
on: [push, pull_request]
env:
cache-suffix: v6
build_flags: "-DWITH_COMMON=OFF -DWITH_BUILD_REQUIRED=ON -DWITH_BUILD_BONMIN=ON -DWITH_BONMIN=ON -DWITH_IPOPT=ON -DWITH_BUILD_IPOPT=ON -DWITH_BUILD_LAPACK=ON -DWITH_LAPACK=ON -DWITH_MUMPS=ON -DWITH_CLP=ON -DWITH_BUILD_CLP=ON -DWITH_CBC=ON -DWITH_BUILD_CBC=ON -DWITH_THREAD=ON -DWITH_QPOASES=ON -DWITH_HPIPM=ON -DWITH_BLASFEO=ON -DWITH_BUILD_HPIPM=ON -DWITH_BUILD_BLASFEO=ON -DWITH_HIGHS=ON -DWITH_BUILD_HIGHS=ON -DWITH_BUILD_SPRAL=ON -DWITH_SPRAL=ON -DWITH_PROXQP=ON -DWITH_OSQP=ON -DWITH_SUPERSCS=ON -DWITH_KNITRO=ON -DWITH_MOCKUP_KNITRO=ON -DWITH_CPLEX=ON -DWITH_MOCKUP_CPLEX=ON -DWITH_GUROBI=ON -DWITH_MOCKUP_GUROBI=ON -DWITH_HSL=ON -DWITH_MOCKUP_HSL=ON -DWITH_WORHP=ON -DWITH_MOCKUP_WORHP=ON -DWITH_SUNDIALS=ON -DWITH_BUILD_SUNDIALS=ON -DWITH_BUILD_CSPARSE=ON -DWITH_BUILD_METIS=ON -DWITH_BUILD_BLASFEO=ON -DWITH_BUILD_SUPERSCS=ON -DWITH_BUILD_OSQP=ON -DWITH_BUILD_EIGEN3=ON -DWITH_BUILD_SIMDE=ON -DWITH_BUILD_PROXQP=ON -DWITH_SNOPT=ON -DWITH_MOCKUP_SNOPT=ON -DWITH_AMPL=ON -DWITH_BLOCKSQP=ON -DWITH_SLEQP=ON -DWITH_SLEQP_BUILD=ON -DWITH_ALPAQA=ON -DWITH_BUILD_ALPAQA=ON"
build_flags_32bit: "-DWITH_HPIPM=OFF -DWITH_BLASFEO=OFF -DWITH_BUILD_HPIPM=OFF -DWITH_BUILD_BLASFEO=OFF -DWITH_CPLEX=OFF"
build_flags_manylinux1: "-DWITH_HIGHS=OFF -DWITH_BUILD_HIGHS=OFF -DWITH_BUILD_SPRAL=OFF -DWITH_SPRAL=OFF -DWITH_PROXQP=OFF -DWITH_BUILD_PROXQP=OFF -DWITH_BUILD_EIGEN3=OFF -DWITH_BUILD_SIMDE=OFF -DWITH_SLEQP=OFF -DWITH_BUILD_SLEQP=OFF -DWITH_BUILD_ALPAQA=OFF -DWITH_ALPAQA=OFF -DWITH_BQPD=OFF -DWITH_UNO=OFF"
build_flags_windows: ""
build_flags_mac: "-DWITH_SPRAL=OFF -DWITH_BUILD_SPRAL=OFF -DWITH_BUILD_LAPACK=OFF -DWITH_WORHP=OFF -DWITH_MOCKUP_WORHP=OFF -DWITH_BQPD=OFF -DWITH_UNO=OFF"
build_flags_mac_intel: "-DWITH_PROXQP=OFF -DWITH_BUILD_PROXQP=OFF -DWITH_BUILD_EIGEN3=OFF -DWITH_BUILD_SIMDE=OFF -DWITH_BUILD_ALPAQA=OFF -DWITH_ALPAQA=OFF"
build_flags_mac_m1: "-DALLOW_DOCKER=ON -DWITH_HPIPM=OFF -DWITH_BUILD_HPIPM=OFF"
build_flags_aarch64: "-DWITH_BONMIN=OFF DWITH_BUILD_BONMIN=OFF -DWITH_CLP=OFF -DWITH_BUILD_CLP=OFF -DWITH_CBC=OFF -DWITH_BUILD_CBC=OFF -DWITH_SPRAL=OFF -DWITH_BUILD_SPRAL=OFF -DWITH_HIGHS=OFF -DWITH_BUILD_HIGHS=OFF -DWITH_SLEQP=OFF -DWITH_BUILD_SLEQP=OFF"
jobs:
version:
runs-on: ubuntu-20.04
steps:
- uses: actions/[email protected]
- name: Inject slug/short variables
uses: rlespinasse/[email protected]
- run: |
echo "CMAKE_VERSION=$(python misc/get_version.py)" >> $GITHUB_ENV
- run: |
echo "CASADI_VERSION=${{ env.GITHUB_REF_SLUG }}" >> $GITHUB_ENV
echo "WHEEL_VERSION=${{ env.CMAKE_VERSION}}.dev+${{ env.GITHUB_REF_SLUG }}" >> $GITHUB_ENV
if: "!contains( env.GITHUB_REF_NAME , 'release-' )"
- run: |
python -c "print('CASADI_VERSION='+'${{ env.GITHUB_REF_SLUG }}'.split('-')[1])" >> $GITHUB_ENV
python -c "print('WHEEL_VERSION='+'${{ env.GITHUB_REF_SLUG }}'.split('-')[1])" >> $GITHUB_ENV
if: contains( env.GITHUB_REF_NAME , 'release-' )
- run: echo "CMAKE_VERSION=${{ env.CMAKE_VERSION }}, CASADI_VERSION=${{ env.CASADI_VERSION }}, WHEEL_VERSION=${{ env.WHEEL_VERSION }}"
outputs:
casadi: ${{ env.CASADI_VERSION }}
wheel: ${{ env.WHEEL_VERSION }}
swig:
runs-on: ubuntu-20.04
needs: [version]
steps:
- uses: actions/[email protected]
with:
fetch-depth: 0 # for git-restore-mtime
- uses: chetan/[email protected]
- name: generate Python 2
run: >
docker run --rm -v`pwd`:/local ghcr.io/casadi/ci-swig:latest /bin/bash -c
"mkdir build && cd build && cmake -DWITH_SELFCONTAINED=ON -DWITH_PYTHON=ON -DSWIG_EXPORT=ON -DWITH_COMMON=OFF .. && make python_source && cd .. && rm -rf build"
- name: generate Python 3
run: >
docker run --rm -v`pwd`:/local ghcr.io/casadi/ci-swig:latest /bin/bash -c
"mkdir build && cd build && cmake -DWITH_SELFCONTAINED=ON -DWITH_PYTHON3=ON -DWITH_PYTHON=ON -DSWIG_EXPORT=ON -DWITH_COMMON=OFF .. && make python_source && cd .. && rm -rf build"
- name: generate Matlab
run: >
docker run --rm -v`pwd`:/local ghcr.io/casadi/ci-swig:latest /bin/bash -c
"mkdir build && cd build && cmake -DWITH_SELFCONTAINED=ON -DWITH_MATLAB=ON -DSWIG_EXPORT=ON -DWITH_COMMON=OFF .. && make matlab_source && cd .. && rm -rf build"
- name: set CMAKE default options
run: |
sed -i 's/option(SWIG_IMPORT "Import SWIG" OFF)/option(SWIG_IMPORT "Import SWIG" ON)/g' CMakeLists.txt
- name: build archives
run: |
zip -rq ../casadi_source.zip . --exclude '.*' --exclude '*/.*' --exclude 'appveyor.yml'
mv ../casadi_source.zip casadi_source.zip
- name: Inject slug/short variables
uses: rlespinasse/[email protected]
- name: Upload files to a GitHub release
uses: svenstaro/[email protected]
with:
overwrite: true
tag: nightly-${{ env.GITHUB_REF_SLUG }}
file: casadi_source.zip
asset_name: casadi-source-v${{ needs.version.outputs.casadi }}.zip
prerelease: true
if: github.event_name != 'pull_request'
- run: python setup.py sdist && ls && ls dist
- name: Delete old release assets
uses: jgillis/delete-release-assets@main
with:
token: ${{ github.token }}
tag: nightly-${{ env.GITHUB_REF_SLUG }}
assets: "*.tar.gz"
fail-if-no-release: false
fail-if-no-assets: false
if: github.event_name != 'pull_request'
- name: Upload files to a GitHub release
uses: svenstaro/[email protected]
with:
overwrite: true
tag: nightly-${{ env.GITHUB_REF_SLUG }}
file: dist/*.tar.gz
file_glob: true
prerelease: true
if: github.event_name != 'pull_request'
- uses: actions/[email protected]
with:
name: casadi_source_wrapper
path: casadi_source.zip
test-python-source-package:
runs-on: ${{matrix.image == 'macos-m1' && 'self-hosted' || matrix.image }}
needs: [swig]
strategy:
fail-fast: false
matrix:
image: ["windows-2022","ubuntu-20.04","macos-11","macos-m1"]
steps:
- uses: actions/[email protected]
- run: python --version
- name: Inject slug/short variables
uses: rlespinasse/[email protected]
- uses: dsaltares/[email protected]
with:
version: tags/nightly-${{ env.GITHUB_REF_SLUG }}
regex: true
target: "./"
file: "casadi-.*.tar.gz"
- uses: conda-incubator/[email protected]
with:
python-version: 3.8
activate-environment: 3.8
auto-update-conda: true
- run: pip install casadi-*.tar.gz
shell: bash -el {0}
- run: cd test/python && python implicitfunction.py
shell: bash -el {0}
matrix-arch-mac:
runs-on: ubuntu-20.04
steps:
- id: build-matrix
uses: jgillis/[email protected]
with:
config: |
matrix:
image: [macos-11]
operations:
- type: append
if: ${{ vars.BLESSED_REPO == 'yes' }}
matrix:
image: [macos-m1]
- run: echo ${{ steps.build-matrix.outputs.matrix }}
outputs:
matrix: ${{ steps.build-matrix.outputs.matrix }}
core-osx:
needs: [matrix-arch-mac]
runs-on: ${{matrix.image == 'macos-m1' && 'self-hosted' || matrix.image }}
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.matrix-arch-mac.outputs.matrix) }}
steps:
- run: echo "${{ vars.BLESSED_REPO }} ${{ vars.BLESSED_REPO }}"
- uses: casadi/action-setup-compiler@master
with:
cache-suffix: ''
target: ${{matrix.image == 'macos-m1' && 'arm64' || 'x86_64'}}
- run: brew install pkg-config
- uses: actions/[email protected]
with:
fetch-depth: 0 # for git-restore-mtime
submodules: recursive
- uses: chetan/[email protected]
- name: Cache build dir
uses: actions/[email protected]
with:
key: core-build-${{matrix.image}}-${{env.cache-suffix}}
path: build
- uses: casadi/mockups@master
with:
tag: ${{ matrix.image }}
- run: env
- name: Build
run: |
rm -f build/CMakeCache.txt
CC=${{ env.CC }} FC=${{ env.FC }} CXX=${{ env.CXX }} cmake -DCMAKE_OSX_SYSROOT=${{env.CONDA_BUILD_SYSROOT}} -Bbuild -DWITH_SELFCONTAINED=ON ${{env.build_flags}} ${{env.build_flags_mac}} ${{ contains(matrix.image,'m1') && env.build_flags_mac_m1 || ''}} ${{ contains(matrix.image,'macos-11') && env.build_flags_mac_intel || ''}} -DCMAKE_PREFIX_PATH=${{ github.workspace }}/mockups/cmake -H.
CC=${{ env.CC }} FC=${{ env.FC }} CXX=${{ env.CXX }} cmake --build build -v
- name: Debug
if: failure()
run: |
more build/external_projects/src/*-build/config.log | cat
- run: zip -rq ${{github.job}}-${{matrix.image}}.zip build
- uses: actions/[email protected]
with:
name: ${{ github.job }}-${{matrix.image}}
path: ${{ github.job }}-${{matrix.image}}.zip
retention-days: 5
core-dockcross:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
target: [manylinux1-x64,manylinux1-x86,manylinux2014-x64,manylinux2014-x86,manylinux2014-aarch64,windows-shared-x64-posix]
steps:
- uses: actions/[email protected]
with:
fetch-depth: 0 # for git-restore-mtime
submodules: recursive
- uses: chetan/[email protected]
- name: Setup dockcross
run: |
docker pull ghcr.io/jgillis/${{ matrix.target }}:production
docker image inspect ghcr.io/jgillis/${{ matrix.target }}:production
docker run --rm --env DEFAULT_DOCKCROSS_IMAGE=ghcr.io/jgillis/${{ matrix.target }}:production ghcr.io/jgillis/${{ matrix.target }}:production > dockcross
chmod +x dockcross
pwd
ls -al dockcross
- name: Cache build dir
uses: actions/[email protected]
with:
key: core-build-${{ matrix.target }}-${{env.cache-suffix}}
path: build
- uses: casadi/mockups@master
with:
tag: ${{ matrix.target }}
- name: Build
run: |
rm -f build/CMakeCache.txt
./dockcross cmake -Bbuild -DWITH_SELFCONTAINED=ON ${{env.build_flags}} ${{ contains(matrix.target,'86') && env.build_flags_32bit || ''}} ${{ contains(matrix.target,'manylinux1') && env.build_flags_manylinux1 || ''}} ${{ contains(matrix.target,'windows') && env.build_flags_windows || ''}} ${{ contains(matrix.target,'aarch64') && env.build_flags_aarch64 || ''}} -DCMAKE_PREFIX_PATH=/work/mockups/cmake -H.
# In MXE land, (cross).pkg-config does not listen to PKG_CONFIG_PATH straight see https://mxe.cc/#tutorial-4
# Needed to make CoinUtils work
./dockcross --args "--env PKG_CONFIG_PATH_x86_64_w64_mingw32_shared_posix=/work/build/external_projects/lib64/pkgconfig:/work/build/external_projects/lib/pkgconfig:/work/build/external_projects/share/pkgconfig" -- /work/.github/workflows/patch_toolchain cmake --build build -v
- run: zip -rq ${{github.job}}-${{matrix.target}}.zip build
- uses: actions/[email protected]
with:
name: ${{github.job}}-${{ matrix.target}}
path: ${{github.job}}-${{matrix.target}}.zip
retention-days: 5
matrix-arch-py2:
runs-on: ubuntu-20.04
steps:
- id: build-matrix
uses: jgillis/[email protected]
with:
config: |
matrix:
arch: [manylinux1-x64,manylinux1-x86]
py2: ["27","35"]
operations:
- type: append
matrix:
arch: [manylinux2014-x64,manylinux2014-x86]
py2: ["36","37","38","39","310","311","312"]
- type: append
matrix:
arch: [windows-shared-x64-posix]
py2: ["27","35","36","37","38","39","310","311","312"]
- type: append
matrix:
arch: [manylinux2014-aarch64]
py2: ["36","37","38","39","310","311"]
outputs:
matrix: ${{ steps.build-matrix.outputs.matrix }}
matrix-arch-py2-mac:
runs-on: ubuntu-20.04
steps:
- id: build-matrix
uses: jgillis/[email protected]
with:
config: |
matrix:
image: [macos-11]
py2: ["27","35","36","37","38","39","310","311","312"]
operations:
- type: append
if: ${{ vars.BLESSED_REPO == 'yes' }}
matrix:
image: [macos-m1]
py2: ["38","39","310","311","312"]
outputs:
matrix: ${{ steps.build-matrix.outputs.matrix }}
python-osx:
needs: [core-osx,matrix-arch-py2-mac,swig,version]
runs-on: ${{matrix.image == 'macos-m1' && 'self-hosted' || matrix.image }}
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.matrix-arch-py2-mac.outputs.matrix) }}
env:
DEVELOPMENT_CERTIFICATE_DATA_AVAILABLE: ${{ secrets.DEVELOPMENT_CERTIFICATE_DATA != '' }}
deploy_arch: ${{matrix.image == 'macos-m1' && 'osx_arm64' || 'osx64'}}
steps:
- uses: casadi/action-setup-compiler@master
with:
cache-suffix: ${{matrix.py2}}
target: ${{matrix.image == 'macos-m1' && 'arm64' || 'x86_64'}}
- id: get-id
uses: actions/[email protected]
env:
py2: "${{ matrix.py2 }}"
with:
result-encoding: string
script: |
const { py2 } = process.env;
const major = py2.substr(0,1);
const minor = py2.substr(1);
core.setOutput('pydot2', major+"."+minor)
core.setOutput('WITH_PYTHON3', major==="3" ? "ON" : "OFF")
- uses: conda-incubator/[email protected]
with:
python-version: ${{steps.get-id.outputs.pydot2}}
channels: conda-forge,defaults,ad-testing/label/py312
- uses: actions/[email protected]
with:
name: casadi_source_wrapper
- name: Unpack source
run: unzip casadi_source.zip
- uses: actions/[email protected]
with:
name: core-osx-${{ matrix.image }}
- run: unzip core-osx-${{ matrix.image }}.zip
- run: rm -rf install
- uses: casadi/mockups@master
with:
tag: ${{ matrix.image }}
- name: Build
run: |
cmake -Bbuild -DWITH_PYTHON=ON -DWITH_PYTHON3=${{steps.get-id.outputs.WITH_PYTHON3}} -USWIG_IMPORT -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install -DSKIP_CONFIG_H_GENERATION=ON
cmake --build build --target install -v
shell: bash -el {0}
- uses: jgillis/universal_grafter@master
with:
source_path: install/casadi
destination_path: install/casadi
search_paths: ${{env.COMPILER_LIB_SEARCH_PATH}}
- uses: jgillis/import-codesign-certs@master
with:
p12-file-base64: ${{ secrets.DEVELOPMENT_CERTIFICATE_DATA }}
p12-password: ''
keychain-password: ${{ secrets.KEYCHAIN_PASSWORD }}
if: env.DEVELOPMENT_CERTIFICATE_DATA_AVAILABLE=='yes'
- run: python misc/codesign.py "${{ secrets.CODESIGN_IDENTITY }}" install
shell: bash -el {0}
if: env.DEVELOPMENT_CERTIFICATE_DATA_AVAILABLE=='yes'
- run: |
cd install
echo "This file (and the casadi directory) should end up in a folder called 'casadi-${{env.os}}${{env.bitness}}-py${{matrix.py2}}'" > dummy.txt
zip -rq ../casadi-${{env.deploy_arch}}-py${{matrix.py2}}.zip .
- uses: actions/[email protected]
with:
name: casadi-${{env.deploy_arch}}-py${{matrix.py2}}
path: casadi-${{env.deploy_arch}}-py${{matrix.py2}}.zip
retention-days: 5
- name: Inject slug/short variables
uses: rlespinasse/[email protected]
- run: cp casadi-${{env.deploy_arch}}-py${{matrix.py2}}.zip casadi-${{ needs.version.outputs.casadi }}-${{env.deploy_arch}}-py${{matrix.py2}}.zip
- name: Delete old release assets
uses: jgillis/delete-release-assets@main
with:
token: ${{ github.token }}
tag: nightly-${{ env.GITHUB_REF_SLUG }}
assets: casadi-*-${{env.deploy_arch}}-py${{matrix.py2}}.zip
fail-if-no-release: false
fail-if-no-assets: false
if: github.event_name != 'pull_request'
- name: Upload files to a GitHub release
uses: svenstaro/[email protected]
with:
overwrite: true
tag: nightly-${{ env.GITHUB_REF_SLUG }}
file: casadi-${{ needs.version.outputs.casadi }}-${{env.deploy_arch}}-py${{matrix.py2}}.zip
prerelease: true
if: github.event_name != 'pull_request'
- run: |
wheel=$(python misc/create_wheel_local.py ${{ needs.version.outputs.wheel }} ${{matrix.py2}} osx 64 ${{matrix.image == 'macos-m1' && 'osx-m1' || 'osx'}} install/)
echo "<$wheel>"
echo "wheel=$wheel" >> $GITHUB_OUTPUT
wheel_wildcard=$(echo $wheel | sed -e 's/casadi-[^-]*-/casadi-\*-/')
echo "wheel=$wheel" >> $GITHUB_OUTPUT
echo "<$wheel_wildcard>"
echo "<$wheel_wildcard2>"
echo "wheel_wildcard=$wheel_wildcard" >> $GITHUB_OUTPUT
id: wheel
shell: bash -el {0}
- name: Delete old release assets
uses: jgillis/delete-release-assets@main
with:
token: ${{ github.token }}
tag: nightly-${{ env.GITHUB_REF_SLUG }}
assets: ${{ steps.wheel.outputs.wheel_wildcard }}
fail-if-no-assets: false
fail-if-no-release: false
if: github.event_name != 'pull_request'
- name: Upload files to a GitHub release
uses: svenstaro/[email protected]
with:
overwrite: true
tag: nightly-${{ env.GITHUB_REF_SLUG }}
file: ${{ steps.wheel.outputs.wheel }}
prerelease: true
if: github.event_name != 'pull_request'
matrix-arch-matlab-mac:
runs-on: ubuntu-20.04
steps:
- id: build-matrix
uses: jgillis/[email protected]
with:
config: |
matrix:
image: [macos-11]
host: ["matlab"]
version: ["2018b"]
operations:
- type: append
matrix:
image: [macos-11]
host: ["octave"]
version: ["7.3.0"]
- type: append
if: ${{ vars.BLESSED_REPO == 'yes' }}
matrix:
image: [macos-m1]
host: ["matlab"]
version: ["2018b"]
- type: append
if: ${{ vars.BLESSED_REPO == 'yes' }}
matrix:
image: [macos-m1]
host: ["octave"]
version: ["7.3.0"]
outputs:
matrix: ${{ steps.build-matrix.outputs.matrix }}
matlab-osx:
needs: [core-osx,matrix-arch-matlab-mac,swig,version]
runs-on: ${{matrix.image == 'macos-m1' && 'self-hosted' || matrix.image }}
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.matrix-arch-matlab-mac.outputs.matrix) }}
env:
DEVELOPMENT_CERTIFICATE_DATA_AVAILABLE: ${{ secrets.DEVELOPMENT_CERTIFICATE_DATA != '' }}
steps:
- uses: casadi/action-setup-compiler@master
with:
cache-suffix: ''
target: ${{matrix.image == 'macos-m1' && 'arm64' || 'x86_64'}}
- uses: actions/[email protected]
with:
name: casadi_source_wrapper
- name: Unpack source
run: unzip casadi_source.zip
- uses: actions/[email protected]
with:
name: core-osx-${{ matrix.image }}
- run: ls
- run: unzip core-osx-${{ matrix.image }}.zip
- uses: casadi/mockups@master
with:
tag: ${{ matrix.image }}
- run: |
ls mockups/cmake
- name: Build
run: |
CC=${{ env.CC }} FC=${{ env.FC }} CXX=${{ env.CXX }} cmake -DCMAKE_OSX_SYSROOT=${{env.CONDA_BUILD_SYSROOT}} -Bbuild -DWITH_${{matrix.host == 'matlab' && 'MATLAB' || 'OCTAVE' }}=ON -USWIG_IMPORT -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/install -DSKIP_CONFIG_H_GENERATION=ON -DWITH_OCTAVE_IMPORT=ON -DCMAKE_PREFIX_PATH=${{ github.workspace }}/mockups/cmake
cmake --build build --target install -v
- uses: kanga333/[email protected]
with:
key: "${{matrix.image}}"
map: |
{
"macos-11": {"os": "osx", "bitness": "64"},
"macos-m1": {"os": "osx_arm", "bitness": "64"}
}
export_to: env
- uses: jgillis/universal_grafter@master
with:
source_path: install/casadi
destination_path: install/casadi
search_paths: "${{env.COMPILER_LIB_SEARCH_PATH}}:${{ github.workspace }}/mockups/${{matrix.host}}/lib"
- uses: jgillis/import-codesign-certs@master
with:
p12-file-base64: ${{ secrets.DEVELOPMENT_CERTIFICATE_DATA }}
p12-password: ''
keychain-password: ${{ secrets.KEYCHAIN_PASSWORD }}
if: ${{ env.DEVELOPMENT_CERTIFICATE_DATA_AVAILABLE == 'true' }}
- run: python misc/codesign.py "${{ secrets.CODESIGN_IDENTITY }}" install
if: ${{ env.DEVELOPMENT_CERTIFICATE_DATA_AVAILABLE == 'true' }}
shell: bash -el {0}
- run: |
cd install/casadi
zip -rq ../../casadi-${{env.os}}${{env.bitness}}-${{matrix.host}}${{matrix.version}}.zip .
- name: Inject slug/short variables
uses: rlespinasse/[email protected]
- run: cp casadi-${{env.os}}${{env.bitness}}-${{matrix.host}}${{matrix.version}}.zip casadi-${{ needs.version.outputs.casadi }}-${{env.os}}${{env.bitness}}-${{matrix.host}}${{matrix.version}}.zip
- name: Delete old release assets
uses: jgillis/delete-release-assets@main
with:
token: ${{ github.token }}
tag: nightly-${{ env.GITHUB_REF_SLUG }}
assets: casadi-*-${{env.os}}${{env.bitness}}-${{matrix.host}}${{matrix.version}}.zip
fail-if-no-release: false
fail-if-no-assets: false
if: github.event_name != 'pull_request'
- name: Upload files to a GitHub release
uses: svenstaro/[email protected]
with:
overwrite: true
tag: nightly-${{ env.GITHUB_REF_SLUG }}
file: casadi-${{ needs.version.outputs.casadi }}-${{env.os}}${{env.bitness}}-${{matrix.host}}${{matrix.version}}.zip
prerelease: true
if: github.event_name != 'pull_request'
- uses: actions/[email protected]
with:
name: casadi-${{env.os}}${{env.bitness}}-${{matrix.host}}${{matrix.version}}
path: casadi-${{env.os}}${{env.bitness}}-${{matrix.host}}${{matrix.version}}.zip
retention-days: 5
matlab-dockcross:
needs: [core-dockcross,swig,version]
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
include:
- host: matlab
version: 2018b
arch: manylinux2014-x64
- host: octave
version: 7.3.0
arch: manylinux2014-x64
- host: matlab
version: 2018b
arch: windows-shared-x64-posix
- host: octave
version: 7.3.0
arch: windows-shared-x64-posix
steps:
- uses: actions/[email protected]
with:
name: casadi_source_wrapper
- name: Unpack source
run: unzip casadi_source.zip
- uses: actions/[email protected]
with:
name: core-dockcross-${{ matrix.arch }}
- run: ls
- run: unzip core-dockcross-${{ matrix.arch }}.zip
- name: Setup dockcross
run: |
docker pull ghcr.io/jgillis/${{ matrix.arch }}:production
docker run --rm --env DEFAULT_DOCKCROSS_IMAGE=ghcr.io/jgillis/${{ matrix.arch }}:production ghcr.io/jgillis/${{ matrix.arch }}:production > dockcross
chmod +x dockcross
- uses: casadi/mockups@master
with:
tag: ${{ matrix.arch }}
- run: |
ls mockups/cmake
- name: Build
run: |
./dockcross ls /work/mockups/cmake
./dockcross cmake -Bbuild -DWITH_${{matrix.host == 'matlab' && 'MATLAB' || 'OCTAVE' }}=ON -USWIG_IMPORT -DCMAKE_INSTALL_PREFIX=/work/install -DSKIP_CONFIG_H_GENERATION=ON -DWITH_OCTAVE_IMPORT=ON -DCMAKE_PREFIX_PATH=/work/mockups/cmake
./dockcross cmake --build build --target install -v
- uses: kanga333/[email protected]
with:
key: "${{matrix.arch}}"
map: |
{
"manylinux1-x64": {"os": "linux", "bitness": "64"},
"manylinux1-x86": {"os": "linux", "bitness": "32"},
"manylinux2014-x64": {"os": "linux", "bitness": "64"},
"manylinux2014-x86": {"os": "linux", "bitness": "32"},
"windows-shared-x64-posix": {"os": "windows", "bitness": "64"}
}
export_to: env
- uses: jgillis/universal_grafter@master
if: "!contains(matrix.arch, 'windows')"
with:
source_path: install/casadi
destination_path: install/casadi
dockcross: ${{ matrix.arch }}
bitness: ${{env.bitness}}
- run: |
cd install/casadi
zip -rq ../../casadi-${{env.os}}${{env.bitness}}-${{matrix.host}}${{matrix.version}}.zip .
- name: Inject slug/short variables
uses: rlespinasse/[email protected]
- run: cp casadi-${{env.os}}${{env.bitness}}-${{matrix.host}}${{matrix.version}}.zip casadi-${{ needs.version.outputs.casadi }}-${{env.os}}${{env.bitness}}-${{matrix.host}}${{matrix.version}}.zip
- name: Delete old release assets
uses: jgillis/delete-release-assets@main
with:
token: ${{ github.token }}
tag: nightly-${{ env.GITHUB_REF_SLUG }}
assets: casadi-*-${{env.os}}${{env.bitness}}-${{matrix.host}}${{matrix.version}}.zip
fail-if-no-release: false
fail-if-no-assets: false
if: github.event_name != 'pull_request'
- name: Upload files to a GitHub release
uses: svenstaro/[email protected]
with:
overwrite: true
tag: nightly-${{ env.GITHUB_REF_SLUG }}
file: casadi-${{ needs.version.outputs.casadi }}-${{env.os}}${{env.bitness}}-${{matrix.host}}${{matrix.version}}.zip
prerelease: true
if: github.event_name != 'pull_request'
- uses: actions/[email protected]
with:
name: casadi-${{env.os}}${{env.bitness}}-${{matrix.host}}${{matrix.version}}
path: casadi-${{env.os}}${{env.bitness}}-${{matrix.host}}${{matrix.version}}.zip
retention-days: 5
python-dockcross:
needs: [core-dockcross,matrix-arch-py2,swig,version]
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.matrix-arch-py2.outputs.matrix) }}
steps:
- uses: actions/[email protected]
with:
name: casadi_source_wrapper
- name: Unpack source
run: unzip casadi_source.zip
- run: cat CMakeLists.txt
- uses: actions/[email protected]
with:
name: core-dockcross-${{ matrix.arch }}
- run: ls
- run: unzip core-dockcross-${{ matrix.arch }}.zip
- name: Setup dockcross
run: |
docker pull ghcr.io/jgillis/${{ matrix.arch }}:production
docker run --rm --env DEFAULT_DOCKCROSS_IMAGE=ghcr.io/jgillis/${{ matrix.arch }}:production ghcr.io/jgillis/${{ matrix.arch }}:production > dockcross
chmod +x dockcross
- run: echo ${{env.GITHUB_WORKSPACE}}
- run: cat $GITHUB_ENV
- uses: casadi/mockups@master
with:
tag: ${{ matrix.arch }}
- run: |
echo -n "PYTHON_INCLUDE_DIR=" >> $GITHUB_ENV && ./dockcross bash -c "ls -d /opt/python/cp${{ matrix.py2 }}*/include/python* | head -n 1" >> $GITHUB_ENV && tail $GITHUB_ENV
- name: (windows target only) get Python
if: contains(matrix.arch, 'windows')
run: |
archx=$(python -c "print([e for e in '${{matrix.arch}}'.split('-') if e.startswith('x')][0])")
wget https://github.com/casadi/artifacts/releases/download/evergreen/windows_python${{ matrix.py2 }}_$archx.zip -O python.zip && unzip python.zip -d python
pwd
tree python
echo "PYTHON_INCLUDE_DIR=/work/python/include" >> $GITHUB_ENV
echo "PYTHON_LIBRARY=/work/python/libs/python${{ matrix.py2 }}.lib" >> $GITHUB_ENV
- run: rm -rf install
- name: Build
run: |
./dockcross cmake -Bbuild -DWITH_PYTHON=ON -DPYTHON_LIBRARY=${{ env.PYTHON_LIBRARY}} -DPYTHON_INCLUDE_DIR=${{ env.PYTHON_INCLUDE_DIR }} -USWIG_IMPORT -DCMAKE_INSTALL_PREFIX=/work/install -DSKIP_CONFIG_H_GENERATION=ON
./dockcross cmake --build build --target install -v
- uses: kanga333/[email protected]
with:
key: "${{matrix.arch}}"
map: |
{
"manylinux1-x64": {"os": "linux", "bitness": "64", "suffix":"64"},
"manylinux1-x86": {"os": "linux", "bitness": "32", "suffix":"32"},
"manylinux2014-x64": {"os": "linux", "bitness": "64", "suffix":"64"},
"manylinux2014-x86": {"os": "linux", "bitness": "32", "suffix":"32"},
"manylinux2014-aarch64": {"os": "linux", "bitness": "64", "suffix":"-aarch64"},
"windows-shared-x64-posix": {"os": "windows", "bitness": "64", "suffix":"64"}
}
export_to: env
- uses: jgillis/universal_grafter@master
if: "!contains(matrix.arch, 'windows')"
with:
source_path: install/casadi
destination_path: install/casadi
dockcross: ${{ matrix.arch }}
bitness: ${{env.bitness}}
- run: |
cd install
echo "This file (and the casadi directory) should end up in a folder called 'casadi-${{env.os}}${{env.suffix}}-py${{matrix.py2}}'" > dummy.txt
zip -rq ../casadi-${{env.os}}${{env.suffix}}-py${{matrix.py2}}.zip .
- name: Inject slug/short variables
uses: rlespinasse/[email protected]
- run: cp casadi-${{env.os}}${{env.suffix}}-py${{matrix.py2}}.zip casadi-${{ needs.version.outputs.casadi }}-${{env.os}}${{env.suffix}}-py${{matrix.py2}}.zip
- name: Delete old release assets
uses: jgillis/delete-release-assets@main
with:
token: ${{ github.token }}
tag: nightly-${{ env.GITHUB_REF_SLUG }}
assets: casadi-*-${{env.os}}${{env.suffix}}-py${{matrix.py2}}.zip
fail-if-no-release: false
fail-if-no-assets: false
if: github.event_name != 'pull_request'
- name: Upload files to a GitHub release
uses: svenstaro/[email protected]
with:
overwrite: true
tag: nightly-${{ env.GITHUB_REF_SLUG }}
file: casadi-${{ needs.version.outputs.casadi }}-${{env.os}}${{env.suffix}}-py${{matrix.py2}}.zip
prerelease: true
if: github.event_name != 'pull_request'
- uses: actions/[email protected]
with:
name: casadi-${{env.os}}${{env.suffix}}-py${{matrix.py2}}
path: casadi-${{env.os}}${{env.suffix}}-py${{matrix.py2}}.zip
retention-days: 5
- run: |
pip install wheel==0.31.1
wheel=$(python misc/create_wheel_local.py ${{ needs.version.outputs.wheel }} ${{matrix.py2}} ${{env.os}} ${{env.bitness}} ${{matrix.arch}} install/)
echo "<$wheel>"
echo "wheel=$wheel" >> $GITHUB_OUTPUT
wheel_wildcard=$(echo $wheel | sed -e 's/casadi-[^-]*-/casadi-\*-/')
echo "wheel=$wheel" >> $GITHUB_OUTPUT
echo "<$wheel_wildcard>"
echo "<$wheel_wildcard2>"
echo "wheel_wildcard=$wheel_wildcard" >> $GITHUB_OUTPUT
id: wheel
- name: Delete old release assets
uses: jgillis/delete-release-assets@main
with:
token: ${{ github.token }}
tag: nightly-${{ env.GITHUB_REF_SLUG }}
assets: ${{ steps.wheel.outputs.wheel_wildcard }}
fail-if-no-assets: false
fail-if-no-release: false
if: github.event_name != 'pull_request'
- name: Upload files to a GitHub release
uses: svenstaro/[email protected]
with:
overwrite: true
tag: nightly-${{ env.GITHUB_REF_SLUG }}
file: ${{ steps.wheel.outputs.wheel }}
prerelease: true
if: github.event_name != 'pull_request'
test-matlab:
runs-on: ${{matrix.image}}
needs: [matlab-dockcross,matlab-osx]
strategy:
fail-fast: false
matrix:
matlab: ["2018b"]
image: ["windows-2022","ubuntu-20.04","macos-11"]
bit: [64]
exclude:
# No Windows 32bit builds currently
- image: "windows-2022"
bit: 32
steps:
- uses: actions/[email protected]
# Make cl.exe available on Windows
- uses: ilammy/[email protected]
if: contains(matrix.image, 'windows')
- uses: kanga333/[email protected]
with:
key: "${{matrix.image}}"
map: |
{
"windows-2022": {"os": "windows"},
"ubuntu-20.04": {"os": "linux"},
"macos-11": {"os": "osx"}
}
export_to: env
- uses: actions/[email protected]
with:
name: casadi-${{env.os}}${{matrix.bit}}-matlab${{matrix.matlab}}
- run: ls
- name: Unpack source
run: unzip casadi-${{env.os}}${{matrix.bit}}-matlab${{matrix.matlab}}.zip -d casadi
- run: echo "MATLABPATH=${{ github.workspace }}/casadi" >> $GITHUB_ENV
if: "!contains(env.os, 'windows')"
- run: echo "MATLABPATH=${{ github.workspace }}\casadi" >> $env:GITHUB_ENV
if: "contains(env.os, 'windows')"
- name: Set up MATLAB
uses: matlab-actions/[email protected]
- run: cd test && python internal/test_matlab.py -skipfiles="callback.m solvers.m" matlab
if: "!contains(env.os, 'windows')"
- run: cd test && python internal/test_matlab.py -skipfiles="solvers.m" matlab
if: "contains(env.os, 'windows')"
- uses: casadi/commercial_solvers@master
with:
token: ${{ secrets.JGILLIS_RESTRICTED }}
env:
JGILLIS_RESTRICTED: ${{ secrets.JGILLIS_RESTRICTED != '' }}
if: ${{ env.JGILLIS_RESTRICTED == 'true' }}
# Leads to `MATLAB: detail/MvmLocalBoundMethods.cpp:112: static void mvm::detail::MvmLocalBoundMethods::initMethods(bool): Assertion `Failed to open local mvm library: /usr/local/MATLAB/R2023a/bin/glnxa64/libmwgraphblas.so.7: undefined symbol: GOMP_loop_nonmonotonic_dynamic_start, version VERSION' failed.`
- run: echo "LD_PRELOAD=" >> $GITHUB_ENV
if: "contains(env.os, 'linux')"
- name: Run script
uses: matlab-actions/[email protected]
with:
command: addpath('${{ github.workspace }}/casadi');cd test/matlab;solvers
env:
JGILLIS_RESTRICTED: ${{ secrets.JGILLIS_RESTRICTED != '' }}
if: ${{ env.JGILLIS_RESTRICTED == 'true' }}
test-octave:
runs-on: ${{matrix.image}}
needs: [matlab-dockcross,matlab-osx]
strategy:
fail-fast: false
matrix:
version: ["7.3.0"]
image: ["windows-2022","ubuntu-22.04","macos-12"]
bit: [64]
steps:
- uses: actions/[email protected]
- uses: kanga333/[email protected]
with:
key: "${{matrix.image}}"
map: |
{
"windows-2022": {"os": "windows"},
"ubuntu-22.04": {"os": "linux"},
"macos-12": {"os": "osx"}
}
export_to: env
- uses: actions/[email protected]
with:
name: casadi-${{env.os}}${{matrix.bit}}-octave${{matrix.version}}
- run: ls
- name: Unpack source
run: unzip casadi-${{env.os}}${{matrix.bit}}-octave${{matrix.version}}.zip -d casadi
- run: echo "/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH
if: "contains(env.os, 'linux')"
- run: brew install octave
if: "!contains(env.os, 'windows')"
- run: |
C:\msys64\usr\bin\wget.exe https://ftpmirror.gnu.org/octave/windows/octave-7.3.0-w64.zip
unzip octave-7.3.0-w64.zip
if: "contains(env.os, 'windows')"
- run: |
echo "PATH=${{ github.workspace }}\octave-7.3.0-w64\mingw64\bin;$env:PATH" >> $env:GITHUB_ENV
echo "MATLABPATH=${{ github.workspace }}\casadi" >> $env:GITHUB_ENV
if: "contains(env.os, 'windows')"
shell: pwsh
- run: echo "MATLABPATH=${{ github.workspace }}/casadi" >> $GITHUB_ENV
if: "!contains(env.os, 'windows')"
- run: cd test && python internal/test_octave.py octave && python internal/test_octave.py matlab -skipfiles="solvers.m callback.m nlp_callback.m"
- uses: casadi/commercial_solvers@master
with:
token: ${{ secrets.JGILLIS_RESTRICTED }}
env:
JGILLIS_RESTRICTED: ${{ secrets.JGILLIS_RESTRICTED != '' }}
if: ${{ env.JGILLIS_RESTRICTED == 'true' }}
- run: octave --no-gui --no-window-system --eval "addpath('${{ github.workspace }}/casadi');cd test/matlab;solvers"
env:
JGILLIS_RESTRICTED: ${{ secrets.JGILLIS_RESTRICTED != '' }}
if: ${{ env.JGILLIS_RESTRICTED == 'true' }}
docs:
runs-on: ubuntu-22.04
needs: [python-dockcross,matlab-dockcross,version]
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
name: casadi-linux64-py310
- name: Unpack source
run: unzip casadi-linux64-py310.zip -d casadi_python
- uses: actions/[email protected]
with:
name: casadi-linux64-octave7.3.0
- name: Unpack source
run: unzip casadi-linux64-octave7.3.0.zip -d casadi_octave
- run: chmod -R a+w . && docker run --rm -v`pwd`:/local -v${{ github.workspace }}/casadi_python:/casadi_python:ro -v${{ github.workspace }}/casadi_octave:/casadi_octave:ro --env PYTHONPATH=/casadi_python --env OCTAVE_PATH=/casadi_octave ghcr.io/casadi/ci-doc:latest /bin/bash -c "cd misc && python add_identifiers.py && cd .. && cd docs/users_guide && rm -rf build && rm -f snippets/* && make users_guide.pdf && cd ../../test && make user_guide_snippets_py user_guide_snippets_oct && cd .. && rm -rf docs/users_guide/build && cd docs/users_guide && make users_guide.pdf bare_toc bare_body && cd ../.. && cd docs/api && make full doxexport"
- name: Inject slug/short variables
uses: rlespinasse/[email protected]
- uses: svenstaro/[email protected]
with:
overwrite: true
tag: nightly-${{ env.GITHUB_REF_SLUG }}
file: docs/users_guide/users_guide.pdf
asset_name: casadi-users_guide-v${{ needs.version.outputs.casadi }}.pdf
prerelease: true
if: github.event_name != 'pull_request'
- uses: svenstaro/[email protected]
with:
overwrite: true
tag: nightly-${{ env.GITHUB_REF_SLUG }}
file: docs/example_pack/example_pack.zip
asset_name: casadi-example_pack-v${{ needs.version.outputs.casadi }}.zip
prerelease: true
if: github.event_name != 'pull_request'
- uses: svenstaro/[email protected]
with:
overwrite: true
tag: nightly-${{ env.GITHUB_REF_SLUG }}
file: docs/cheatsheet/python.pdf
asset_name: casadi-cheatsheet_python-v${{ needs.version.outputs.casadi }}.pdf
prerelease: true
if: github.event_name != 'pull_request'
- run: cd web && zip -rq ../website_assets.zip *
- uses: svenstaro/[email protected]
with:
overwrite: true
tag: nightly-${{ env.GITHUB_REF_SLUG }}
file: website_assets.zip
if: github.event_name != 'pull_request'
- run: git status
- run: |
git stash
git pull origin ${{ env.GITHUB_REF_SLUG }}
# If stash is nonempty, pop it
git stash list | grep -q . && git stash pop
git config --local user.email "[email protected]"
git config --local user.name "casadibot"
# If there are changes, commit them
git commit -a -m "automated commit by docs target [skip ci]" || true
- name: Push changes
uses: ad-m/[email protected]
with:
branch: ${{ env.GITHUB_REF_SLUG }}
github_token: ${{ secrets.GITHUB_TOKEN }}
if: contains(github.ref, 'release') || contains(github.ref, 'main')
test-python:
runs-on: ${{matrix.image == 'macos-m1' && 'self-hosted' || matrix.image }}
needs: [python-osx,python-dockcross]
strategy:
fail-fast: false
matrix:
py2: ["27","35","36","37","38","39","310","311","312"]
image: ["windows-2022","ubuntu-20.04","macos-11"]
bit: [64]
exclude:
# No Windows 32bit builds currently
- image: "windows-2022"
bit: 32
- image: "macos-m1"
py2: "27"
- image: "macos-m1"
py2: "35"
- image: "macos-m1"
py2: "36"
- image: "macos-m1"
py2: "37"
steps:
- uses: actions/[email protected]
# Make cl.exe available on Windows
- uses: ilammy/[email protected]
if: contains(matrix.image, 'windows')
- uses: kanga333/[email protected]
with:
key: "${{matrix.image}}"
map: |
{
"windows-2022": {"os": "windows"},
"ubuntu-20.04": {"os": "linux"},
"macos-11": {"os": "osx"},
"macos-m1": {"os": "osx_arm"}
}
export_to: env
- uses: actions/[email protected]
with:
name: casadi-${{env.os}}${{matrix.bit}}-py${{matrix.py2}}
- run: ls
- name: Unpack source
run: unzip casadi-${{env.os}}${{matrix.bit}}-py${{matrix.py2}}.zip -d casadi
- id: get-id
uses: actions/[email protected]
env:
py2: "${{ matrix.py2 }}"
with:
result-encoding: string
script: |
const { py2 } = process.env;
const major = py2.substr(0,1);
const minor = py2.substr(1);
core.setOutput('pydot2', major+"."+minor)
- uses: conda-incubator/[email protected]
with:
python-version: ${{steps.get-id.outputs.pydot2}}
activate-environment: py${{steps.get-id.outputs.pydot2}}
auto-update-conda: true
channels: conda-forge,defaults,ad-testing/label/py312
- run: |
pip install --pre numpy scipy pandas
shell: bash -el {0}
if: "!contains(matrix.image, 'windows')"
- run: |
pip install --pre numpy scipy pandas
shell: pwsh
if: contains(matrix.image, 'windows')
- env:
PYTHONPATH: ${{ github.workspace }}/casadi
run: |
cd test/python