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
149 lines (121 loc) · 4.38 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
147
148
149
name: Build
on: [pull_request, push]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
build-cpp:
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- artifact-name: Native - Windows (CasADi)
# FIXME: Tests give "Exit code 0xc0000135" for missing DLLs
cmake-flags: "-G \"MinGW Makefiles\" -DBUILD_TESTING=OFF"
optimizer_backend: casadi
os: windows-2022
- artifact-name: Native - macOS x86_64 (CasADi)
cmake-flags:
optimizer_backend: casadi
os: macOS-13
- artifact-name: Native - macOS arm64 (CasADi)
cmake-flags:
optimizer_backend: casadi
os: macOS-14
- artifact-name: Native - Linux (CasADi)
cmake-flags:
optimizer_backend: casadi
os: ubuntu-latest
- artifact-name: Native - Windows (Sleipnir)
# FIXME: Tests give "Exit code 0xc0000135" for missing DLLs
cmake-flags: "-DBUILD_TESTING=OFF"
optimizer_backend: sleipnir
os: windows-2022
- artifact-name: Native - macOS x86_64 (Sleipnir)
cmake-flags:
optimizer_backend: sleipnir
os: macOS-13
- artifact-name: Native - macOS arm64 (Sleipnir)
cmake-flags:
optimizer_backend: sleipnir
os: macOS-14
- artifact-name: Native - Linux (Sleipnir)
cmake-flags:
optimizer_backend: 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_backend == 'casadi'
run: |
choco upgrade mingw --version=11.2.0 -y --no-progress --allow-downgrade
echo C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin >> $env:GITHUB_PATH
- name: configure
run: cmake -B build -S . ${{ matrix.cmake-flags }} -DOPTIMIZER_BACKEND=${{ matrix.optimizer_backend }} -DWITH_JAVA=ON -DJAVA_INSTALL_JAR=OFF
- name: build
run: cmake --build build --config RelWithDebInfo --parallel $(nproc)
- name: test
working-directory: build
run: ctest -C RelWithDebInfo --output-on-failure
- name: install
run: cmake --install build --config RelWithDebInfo --prefix pkg
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact-name }}
path: pkg
- uses: actions/upload-artifact@v4
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/upload-artifact@v4
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@v4
with:
name: Native - Windows (CasADi)-java-libraries
path: java/src/main/resources
- uses: actions/download-artifact@v4
with:
name: Native - macOS x86_64 (CasADi)-java-libraries
path: java/src/main/resources
- uses: actions/download-artifact@v4
with:
name: Native - macOS arm64 (CasADi)-java-libraries
path: java/src/main/resources
- uses: actions/download-artifact@v4
with:
name: Native - Linux (CasADi)-java-libraries
path: java/src/main/resources
- run: cd java/src/main/resources/osx;ls
- uses: actions/upload-artifact@v4
with:
name: all-java-libraries
path: java/src/main/resources