-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
381 lines (343 loc) · 13.4 KB
/
action.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
name: commercial_solvers
description: Set up commercial solvers in CI for testing purposes
inputs:
token:
description: GitHub token with access to the private repo
required: true
runs:
using: "composite"
steps:
- run: echo "$RUNNER_OS-$RUNNER_ARCH"
shell: bash
- uses: kanga333/variable-mapper@v0.3.0
with:
key: "${{runner.os}}-${{runner.arch}}"
map: |
{
"Linux-X64": {"knitro": "knitro-13.2.0-Linux-64", "knitro_suffix": ".tar.gz", "cplex": "cos_installer_preview-22.1.1.0.R0-M08SWML-linux-x86-64", "cplex_suffix": ".bin", "gurobi": "gurobi10.0.1_linux64.tar.gz", "hsl": "hsl-manylinux2014-x64", "bqpd": "bqpd-manylinux2014-x64", "worhp": "worhp_1.15_ubuntu2004", "snopt": "libsnopt7c_linux"},
"Windows-X64": {"knitro": "knitro-13.2.0-Win64", "knitro_suffix": ".zip", "cplex": "cplex2211_win64", "cplex_suffix": ".zip", "gurobi": "Gurobi-10.0.1-win64.msi", "hsl": "hsl-windows-shared-x64-posix", "bqpd": "bqpd-windows-shared-x64-posix", "worhp": "worhp_1.15-0_win64", "snopt": "libsnopt7_win"},
"macOS-X64": {"knitro": "knitro-13.2.0-MacOS-64", "knitro_suffix": ".tar.gz", "cplex": "cos_installer_preview-22.1.1.0.R0-M08SXML-osx", "cplex_suffix": ".zip", "gurobi": "gurobi10.0.1_macos_universal2.pkg", "hsl": "hsl-macos-11", "bqpd": "bqpd-macos-11", "snopt": "libsnopt7c_mac"},
"macOS-ARM64": {"knitro": "knitro-13.2.0-MacOS-ARM", "knitro_suffix": ".tar.gz", "cplex": "cos_installer_preview-22.1.1.0.R0-M08WYML-osx-arm64", "cplex_suffix": ".zip", "gurobi": "gurobi10.0.1_macos_universal2.pkg", "hsl": "hsl-macos-m1", "bqpd": "bqpd-macos-m1", "snopt": "libsnopt7c_mac"}
}
export_to: env
# Download protected release asset
- uses: dsaltares/fetch-gh-release-asset@1.1.0
with:
repo: 'jgillis/restricted'
file: ${{env.knitro}}${{env.knitro_suffix}}
token: ${{ inputs.token }}
- uses: dsaltares/fetch-gh-release-asset@1.1.0
with:
repo: 'jgillis/restricted'
file: 'artelys_lic_8325_casadi_2023-11-02.txt'
token: ${{ inputs.token }}
- run: tar -xzf ${{env.knitro}}.tar.gz -C $RUNNER_TEMP
shell: bash
if: runner.os != 'Windows'
- run: unzip -q ${{env.knitro}}.zip -d $RUNNER_TEMP
shell: bash
if: runner.os == 'Windows'
- run: cp artelys_lic_8325_casadi_2023-11-02.txt $RUNNER_TEMP
shell: bash
# Add to PATH
- run: |
echo "LD_LIBRARY_PATH=$RUNNER_TEMP/${{env.knitro}}/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
# 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.`
# But needed for
echo "LD_PRELOAD=$RUNNER_TEMP/${{env.knitro}}/lib/libiomp5.so" >> $GITHUB_ENV
if: runner.os == 'Linux'
shell: bash
- run: |
if [ ! -d "/usr/local/lib" ]; then
sudo mkdir -p /usr/local/lib
sudo chown -R $(whoami) /usr/local/lib
fi
if: runner.os == 'macOS'
shell: bash
# cfr. https://github.com/pypa/cibuildwheel/issues/816
- run: |
sudo cp $RUNNER_TEMP/${{env.knitro}}/lib/* /usr/local/lib
if: runner.os == 'macOS'
shell: bash
- run: ls $RUNNER_TEMP/${{env.knitro}} && ls $RUNNER_TEMP/${{env.knitro}}/lib
shell: bash
- run: echo "$PATH"
shell: bash
- run: echo "PATH=$env:RUNNER_TEMP\${{env.knitro}}\lib;$env:PATH" >> $env:GITHUB_ENV
if: runner.os == 'Windows'
shell: powershell
- run: echo "LD_PRELOAD=$RUNNER_TEMP/${{env.knitro}}/lib/libiomp5.so"
if: runner.os != 'Windows'
shell: bash
- run: echo "ARTELYS_LICENSE=$RUNNER_TEMP/artelys_lic_8325_casadi_2023-11-02.txt" >> $GITHUB_ENV
shell: bash
# SNOPT
- uses: dsaltares/fetch-gh-release-asset@1.1.0
with:
repo: 'jgillis/restricted'
file: ${{env.snopt}}.zip
token: ${{ inputs.token }}
- run: unzip -q ${{env.snopt}}.zip -d $RUNNER_TEMP/snopt
shell: bash
- uses: dsaltares/fetch-gh-release-asset@1.1.0
with:
repo: 'jgillis/restricted'
file: 'snopt7.lic'
token: ${{ inputs.token }}
- run: cp snopt7.lic $RUNNER_TEMP/snopt
shell: bash
- run: |
echo "PATH=$env:RUNNER_TEMP\snopt;$env:PATH" >> $env:GITHUB_ENV
echo "SNOPT_LICENSE=$env:RUNNER_TEMP\snopt\snopt7.lic" >> $env:GITHUB_ENV
if: runner.os == 'Windows'
shell: powershell
- run: |
echo "LD_LIBRARY_PATH=$RUNNER_TEMP/snopt:$LD_LIBRARY_PATH" >> $GITHUB_ENV
if: runner.os == 'Linux'
shell: bash
- uses: dsaltares/fetch-gh-release-asset@1.1.0
with:
repo: casadi/commercial_solvers
file: libgfortran.5.dylib
if: runner.os == 'macOS'
- uses: dsaltares/fetch-gh-release-asset@1.1.0
with:
repo: casadi/commercial_solvers
file: libquadmath.0.dylib
if: runner.os == 'macOS'
- run: |
sudo cp $RUNNER_TEMP/snopt/* /usr/local/lib
sudo mkdir -p /opt/local/lib/libgcc/
cp libgfortran.5.dylib $RUNNER_TEMP/snopt
cp libquadmath.0.dylib $RUNNER_TEMP/snopt
sudo ln -s $RUNNER_TEMP/snopt/libgfortran.5.dylib /opt/local/lib/libgcc/libgfortran.5.dylib
sudo ln -s $RUNNER_TEMP/snopt/libquadmath.0.dylib /opt/local/lib/libgcc/libquadmath.0.dylib
if: runner.os == 'macOS'
shell: bash
- run: |
echo "SNOPT_LICENSE=$RUNNER_TEMP/snopt/snopt7.lic" >> $GITHUB_ENV
if: runner.os != 'Windows'
shell: bash
- run: ls "$RUNNER_TEMP"
shell: bash
- uses: dsaltares/fetch-gh-release-asset@1.1.0
with:
repo: casadi/commercial_solvers
file: libgfortran.so.4
if: runner.os == 'linux'
- run: cp libgfortran.so.4 $RUNNER_TEMP/snopt/libgfortran.so.4
shell: bash
if: runner.os == 'linux'
# CPLEX
- uses: dsaltares/fetch-gh-release-asset@1.1.0
with:
repo: 'jgillis/restricted'
file: ${{env.cplex}}${{env.cplex_suffix}}
token: ${{ inputs.token }}
- run: echo "CPLEX_VERSION=2211" >> $GITHUB_ENV
shell: bash
- run: |
cat <<EOF > github_actions.properties
INSTALLER_UI=silent
LICENSE_ACCEPTED=TRUE
USER_INSTALL_DIR=$RUNNER_TEMP/CPLEX
INSTALLER_LOCALE=en
CPLEX_STUDIO_FILE_ASSOCIATION=0
CPLEX_STUDIO_PATH_UPDATE=0
CPLEX_STUDIO_README=0
CPLEX_STUDIO_IDE=0
EOF
shell: bash
- run: |
# Escape backslash in property file
sed -i 's/\\/\//g' github_actions.properties
echo "${{env.cplex}}${{env.cplex_suffix}} -f github_actions.properties" > install_cplex.bat
cat install_cplex.bat
if: runner.os == 'Windows'
shell: bash
- run: cat github_actions.properties
shell: bash
- run: |
chmod +x ${{env.cplex}}${{env.cplex_suffix}}
./${{env.cplex}}${{env.cplex_suffix}} -f github_actions.properties
if: runner.os == 'Linux'
shell: bash
- run: unzip -q ${{env.cplex}}.zip -d $RUNNER_TEMP/CPLEX
shell: bash
if: runner.os == 'Windows'
- run: echo "PATH=$env:RUNNER_TEMP\CPLEX\cplex\bin\x64_win64;$env:PATH" >> $env:GITHUB_ENV
if: runner.os == 'Windows'
shell: powershell
- run: ls $RUNNER_TEMP/CPLEX
if: runner.os == 'Windows'
shell: bash
- run: ls $RUNNER_TEMP/CPLEX/cplex
if: runner.os == 'Windows'
shell: bash
- run: ls $RUNNER_TEMP/CPLEX/cplex/bin
if: runner.os == 'Windows'
shell: bash
- run: ls $RUNNER_TEMP/CPLEX/cplex/bin/x64_win64
if: runner.os == 'Windows'
shell: bash
- run: ls $RUNNER_TEMP
if: runner.os == 'Windows'
shell: bash
# Add to PATH
- run: |
ls $RUNNER_TEMP/CPLEX
ls $RUNNER_TEMP/CPLEX/cplex/bin/x86-64_linux
echo "LD_LIBRARY_PATH=$RUNNER_TEMP/CPLEX/cplex/bin/x86-64_linux:$LD_LIBRARY_PATH" >> $GITHUB_ENV
if: runner.os == 'Linux'
shell: bash
- run: |
unzip ${{env.cplex}}.zip -d $RUNNER_TEMP
pwd
ls
echo ${{ github.workspace }}
$RUNNER_TEMP/cplex_studio${CPLEX_VERSION}-osx.app/contents/MacOS/cplex_studio${CPLEX_VERSION}-osx -f ${{ github.workspace }}/github_actions.properties
ls $RUNNER_TEMP/CPLEX/cplex/bin/x86-64_osx/*
sudo cp $RUNNER_TEMP/CPLEX/cplex/bin/x86-64_osx/* /usr/local/lib
shell: bash
if: runner.os == 'macOS' && runner.arch == 'X64'
- run: |
unzip ${{env.cplex}}.zip -d $RUNNER_TEMP
pwd
ls
echo ${{ github.workspace }}
$RUNNER_TEMP/cplex_studio${CPLEX_VERSION}-osx-arm64.app/contents/MacOS/cplex_studio${CPLEX_VERSION}-osx-arm64 -f ${{ github.workspace }}/github_actions.properties
ls $RUNNER_TEMP/CPLEX/cplex/bin/arm64_osx/*
sudo cp $RUNNER_TEMP/CPLEX/cplex/bin/arm64_osx/* /usr/local/lib
shell: bash
if: runner.os == 'macOS' && runner.arch == 'ARM64'
- run: ls $RUNNER_TEMP/CPLEX
shell: bash
# Gurobi
- uses: dsaltares/fetch-gh-release-asset@1.1.0
with:
repo: 'jgillis/restricted'
file: ${{env.gurobi}}
token: ${{ inputs.token }}
- uses: dsaltares/fetch-gh-release-asset@1.1.0
with:
repo: 'jgillis/restricted'
file: gurobi.lic
token: ${{ inputs.token }}
- run: |
echo "GUROBI_VERSION=100" >> $GITHUB_ENV
mv gurobi.lic $RUNNER_TEMP/gurobi.lic
echo "GRB_LICENSE_FILE=$RUNNER_TEMP/gurobi.lic" >> $GITHUB_ENV
shell: bash
- run: |
tar -xzf ${{env.gurobi}} -C $RUNNER_TEMP
echo "LD_LIBRARY_PATH=$RUNNER_TEMP/gurobi1001/linux64/lib/:$LD_LIBRARY_PATH" >> $GITHUB_ENV
echo "GUROBI_VERSION=100" >> $GITHUB_ENV
echo ""
ls $RUNNER_TEMP
ls $RUNNER_TEMP/gurobi1001/linux64/lib
shell: bash
if: runner.os == 'Linux'
- run: |
sudo installer -pkg ${{env.gurobi}} -target /
ls /
ls /Library/gurobi1001/macos_universal2/
shell: bash
if: runner.os == 'macOS'
- run: |
Start-Process "${{env.gurobi}}" -ArgumentList '/quiet /qn /norestart /log install.log' -Wait
shell: pwsh
if: runner.os == 'Windows'
- run: echo "PATH=C:\gurobi1001\win64\bin;$env:PATH" >> $env:GITHUB_ENV
if: runner.os == 'Windows'
shell: powershell
# HSL
- uses: dsaltares/fetch-gh-release-asset@1.1.0
with:
repo: 'jgillis/restricted'
file: ${{env.hsl}}.zip
token: ${{ inputs.token }}
- run: unzip -q ${{env.hsl}}.zip -d $RUNNER_TEMP/hsl
shell: bash
# Add to PATH
- run: |
echo "LD_LIBRARY_PATH=$RUNNER_TEMP/hsl:$LD_LIBRARY_PATH" >> $GITHUB_ENV
if: runner.os == 'Linux'
shell: bash
# cfr. https://github.com/pypa/cibuildwheel/issues/816
- run: |
sudo cp $RUNNER_TEMP/hsl/* /usr/local/lib
if: runner.os == 'macOS'
shell: bash
- run: echo "PATH=$env:RUNNER_TEMP\hsl;$env:PATH" >> $env:GITHUB_ENV
if: runner.os == 'Windows'
shell: powershell
# BQPD
- uses: dsaltares/fetch-gh-release-asset@1.1.0
with:
repo: 'jgillis/restricted'
file: ${{env.bqpd}}.zip
token: ${{ inputs.token }}
- run: unzip -q ${{env.bqpd}}.zip -d $RUNNER_TEMP/bqpd
shell: bash
# Add to PATH
- run: |
echo "LD_LIBRARY_PATH=$RUNNER_TEMP/bqpd:$LD_LIBRARY_PATH" >> $GITHUB_ENV
if: runner.os == 'Linux'
shell: bash
# cfr. https://github.com/pypa/cibuildwheel/issues/816
- run: |
sudo cp $RUNNER_TEMP/bqpd/* /usr/local/lib
if: runner.os == 'macOS'
shell: bash
- run: echo "PATH=$env:RUNNER_TEMP\bqpd;$env:PATH" >> $env:GITHUB_ENV
if: runner.os == 'Windows'
shell: powershell
# Worhp
- uses: dsaltares/fetch-gh-release-asset@1.1.0
with:
repo: 'jgillis/restricted'
file: ${{env.worhp}}.zip
token: ${{ inputs.token }}
if: runner.os != 'macOS'
- run: unzip -q ${{env.worhp}}.zip -d $RUNNER_TEMP/worhp
if: runner.os != 'macOS'
shell: bash
- run: ls $RUNNER_TEMP/worhp
if: runner.os != 'macOS'
shell: bash
- run: sudo apt install libsuperlu5 libopenblas0 -y
if: runner.os == 'linux'
shell: bash
# Worhp license is mac-adress based, so we skip it on ci
- run: |
echo "SKIP_WORHP_TESTS=ON" >> $GITHUB_ENV
shell: bash
# Disable temporarily
- run: |
echo "SKIP_SNOPT_TESTS=ON" >> $GITHUB_ENV
shell: bash
# Disable temporarily
- run: |
echo "SKIP_GUROBI_TESTS=ON" >> $GITHUB_ENV
shell: bash
# Disable temporarily
- run: |
echo "SKIP_MADNLP_TESTS=ON" >> $GITHUB_ENV
shell: bash
- uses: dsaltares/fetch-gh-release-asset@1.1.0
with:
repo: casadi/commercial_solvers
file: libgfortran.so.3
target: $RUNNER_TEMP/worhp/lib/libgfortran.so.3
if: contains(matrix.arch, 'linux')
# Add to PATH
- run: |
echo "LD_LIBRARY_PATH=$RUNNER_TEMP/worhp/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
if: runner.os == 'Linux'
shell: bash
- run: echo "PATH=$env:RUNNER_TEMP\worhp\bin;$env:PATH" >> $env:GITHUB_ENV
if: runner.os == 'Windows'
shell: powershell
- run: echo "$LD_LIBRARY_PATH"
if: runner.os == 'Linux'
shell: bash