This repository has been archived by the owner on Jul 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
146 lines (119 loc) · 4.39 KB
/
build.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
name: Build
on: [pull_request, push]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
build-cpp:
strategy:
fail-fast: false
matrix:
include:
- artifact-name: Native - Windows (CasADi)
cmake-config-env-vars:
cmake-flags: "-G \"MinGW Makefiles\" -DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++"
optimizer: casadi
os: windows-2022
- artifact-name: Native - macOS x86_64 (CasADi)
cmake-config-env-vars: CFLAGS="$CFLAGS -arch x86_64" CXXFLAGS="$CXXFLAGS -arch x86_64"
cmake-flags: "-DCMAKE_APPLE_SILICON_PROCESSOR=x86_64"
optimizer: casadi
os: macOS-12
- artifact-name: Native - macOS arm64 (CasADi)
cmake-config-env-vars: CFLAGS="$CFLAGS -arch arm64" CXXFLAGS="$CXXFLAGS -arch arm64"
cmake-flags: "-DCMAKE_APPLE_SILICON_PROCESSOR=arm64"
optimizer: casadi
os: macOS-12
- artifact-name: Native - Linux (CasADi)
cmake-config-env-vars:
cmake-flags:
optimizer: casadi
os: ubuntu-latest
- artifact-name: Native - Windows (Sleipnir)
cmake-config-env-vars:
cmake-flags:
optimizer: sleipnir
os: windows-2022
- artifact-name: Native - macOS universal (Sleipnir)
cmake-config-env-vars: CFLAGS="$CFLAGS -arch x86_64 -arch arm64" CXXFLAGS="$CXXFLAGS -arch x86_64 -arch arm64"
cmake-flags:
optimizer: sleipnir
os: macOS-12
- artifact-name: Native - Linux (Sleipnir)
cmake-config-env-vars:
cmake-flags:
optimizer: sleipnir
os: ubuntu-latest
name: "${{ matrix.artifact-name }}"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up MinGW
if: matrix.os == 'windows-2022' && matrix.optimizer == 'casadi'
uses: egor-tensin/setup-mingw@v2
with:
platform: x64
version: 12.2.0
- name: configure
run: ${{ matrix.cmake-config-env-vars }} cmake -B build -S . ${{ matrix.cmake-flags }} -DOPTIMIZER_BACKEND=${{ matrix.optimizer }} -DWITH_JAVA=ON -DJAVA_INSTALL_JAR=OFF
- name: build
run: cmake --build build --config RelWithDebInfo --parallel $(nproc)
- name: install
run: cmake --install build --config RelWithDebInfo --prefix pkg
- uses: actions/[email protected]
with:
name: ${{ matrix.artifact-name }}
path: pkg
- uses: actions/[email protected]
with:
name: ${{ matrix.artifact-name }}-java-libraries
path: java/src/main/resources
build-wasm:
name: "Wasm"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Setup emscripten
uses: numworks/setup-emscripten@latest
- name: configure
run: emcmake cmake -B build -S . -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DOPTIMIZER_BACKEND=sleipnir
- name: build
run: cmake --build build --config Release --parallel $(nproc)
- name: install
run: cmake --install build --config Release --prefix pkg
- uses: actions/[email protected]
with:
name: Wasm
path: pkg
collect-java-native-libs:
strategy:
fail-fast: false
needs: build-cpp
name: Collect Java Native Libs
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
with:
name: Native - Windows (CasADi)-java-libraries
path: java/src/main/resources
- uses: actions/download-artifact@v3
with:
name: Native - macOS x86_64 (CasADi)-java-libraries
path: java/src/main/resources
- uses: actions/download-artifact@v3
with:
name: Native - macOS arm64 (CasADi)-java-libraries
path: java/src/main/resources
- uses: actions/download-artifact@v3
with:
name: Native - Linux (CasADi)-java-libraries
path: java/src/main/resources
- run: cd java/src/main/resources/osx;ls
- uses: actions/[email protected]
with:
name: all-java-libraries
path: java/src/main/resources