Skip to content

Commit 6eb211d

Browse files
committed
Update
1 parent e7f4f53 commit 6eb211d

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ permissions:
1111
jobs:
1212
test:
1313
name: 'KNITRO'
14-
runs-on: ['ubuntu-latest', 'windows-latest']
14+
runs-on: ${{ matrix.os }}
1515
strategy:
1616
fail-fast: false
1717
matrix:
18+
os: ['ubuntu-latest', 'windows-latest']
1819
version: ['1.10', '1']
20+
KNITRO_JL_WHL: ['false', 'true']
1921
steps:
2022
- uses: actions/checkout@v4
2123
- uses: julia-actions/setup-julia@v2
@@ -29,6 +31,10 @@ jobs:
2931
run: |
3032
echo "$SECRET_KNITRO_LICENSE" > ~/artelys_lic.txt
3133
- uses: julia-actions/julia-buildpkg@v1
34+
env:
35+
KNITRO_JL_WHL: ${{ matrix.KNITRO_JL_WHL }}
36+
SECRET_KNITRO_URL: ${{ secrets.KNITRO_URL }}
37+
SECRET_KNITRO_LIBIOMP5: ${{ secrets.KNITRO_LIBIOMP5 }}
3238
- uses: julia-actions/julia-runtest@v1
3339
- uses: julia-actions/julia-processcoverage@v1
3440
- uses: codecov/codecov-action@v4

deps/build.jl

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const WHEELS = Dict(
5151
"windows" => "https://files.pythonhosted.org/packages/13/3f/54953373ee3b631640b33b5d4bdb0217bdb1f8514b9374b08348e098ea2a/knitro-15.0.0-py3-none-win_amd64.whl",
5252
)
5353

54-
function try_ci_installation()
54+
function try_wheel_installation()
5555
ext, url = if Sys.islinux()
5656
".so", WHEELS["linux"]
5757
elseif Sys.iswindows()
@@ -66,8 +66,18 @@ function try_ci_installation()
6666
return
6767
end
6868

69-
if get(ENV, "CI", "false") == "true"
70-
try_ci_installation()
69+
function try_secret_installation()
70+
local_filename = joinpath(@__DIR__, "libknitro.so")
71+
download(ENV["SECRET_KNITRO_URL"], local_filename)
72+
download(ENV["SECRET_KNITRO_LIBIOMP5"], joinpath(@__DIR__, "libiomp5.so"))
73+
write_depsfile("", local_filename)
74+
return
75+
end
76+
77+
if get(ENV, "KNITRO_JL_WHL", "false") == "true"
78+
try_wheel_installation()
79+
elseif get(ENV, "SECRET_KNITRO_URL", "") != ""
80+
try_secret_installation()
7181
else
7282
try_local_installation()
7383
end

0 commit comments

Comments
 (0)