Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: CI
on:
push:
branches: [master]
pull_request:
types: [opened, synchronize, reopened]
concurrency:
# Skip intermediate builds: always.
# Cancel intermediate builds: only if it is a pull request build.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
# needed to allow julia-actions/cache to delete old caches that it has created
permissions:
actions: write
contents: read
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
version: ['1.10']
os: [ubuntu-latest]
arch: [x64]
steps:
- uses: actions/checkout@v4
- uses: matlab-actions/setup-matlab@v2
with:
release: R2024a
# - shell: bash
# run: |
# sudo apt-get install csh
# wget https://github.com/sqlp/sedumi/releases/download/v1.3.8/sedumi.tgz
# tar -xf sedumi.tgz
# ls -l
# - uses: matlab-actions/run-command@v2
# with:
# command: cd("sedumi"), install_sedumi
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
# - uses: julia-actions/cache@v2
- name: Set MATLAB environment variables
run: |
echo "MATLAB_ROOT=/opt/hostedtoolcache/MATLAB/2024.1.999/x64" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=$MATLAB_ROOT/bin/glnxa64:$LD_LIBRARY_PATH" >> $GITHUB_ENV
- shell: julia --color=yes {0}
run: |
import Libdl
const libeng = Ref{Ptr{Cvoid}}()
const eng_open = Ref{Ptr{Cvoid}}()
libeng_path = joinpath(ENV["MATLAB_ROOT"], "bin", "glnxa64", "libeng")
@show libeng_path
libeng[] = Libdl.dlopen(libeng_path, Libdl.RTLD_GLOBAL)
@show libeng[]
eng_open[] = Libdl.dlsym(libeng[], :engOpen)
@show eng_open[]
@ccall libeng_path.engOpen("-nodisplay -nosplash -nodesktop"::Ptr{UInt8})::Ptr{Cvoid}
ep = ccall(
eng_open[],
Ptr{Cvoid},
(Ptr{UInt8},),
"-nodisplay -nosplash -nodesktop",
)
@show ep
# - uses: julia-actions/julia-buildpkg@v1
# - uses: julia-actions/julia-runtest@v1
# - uses: julia-actions/julia-processcoverage@v1
# - uses: codecov/codecov-action@v4
# with:
# file: lcov.info
# token: ${{ secrets.CODECOV_TOKEN }}
2 changes: 1 addition & 1 deletion test/MOI_wrapper.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function test_runtests()
model.optimizer,
MathOptInterface.Bridges.Variable.ZerosBridge{Float64},
)
MOI.set(model, MOI.Silent(), true)
# MOI.set(model, MOI.Silent(), true)
MOI.Test.runtests(
model,
MOI.Test.Config(
Expand Down
2 changes: 1 addition & 1 deletion test/lp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ using SeDuMi
1.0 0.5 0.0 1.0
]
b = [5.0, 3.0]
sol, dual, status = sedumi(A, b, c, fid = 0)
sol, dual, status = sedumi(A, b, c)
@test sol ≈ sparse([1, 2], [1, 1], [47 / 24, 25 // 12], 4, 1)
@test dual ≈ [1 / 8, -1 / 4]
@test iszero(status["pinf"])
Expand Down
8 changes: 6 additions & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
# Use of this source code is governed by an MIT-style license that can be found
# in the LICENSE.md file or at https://opensource.org/licenses/MIT.

using MATLAB
@show mat"ver"

include("lp.jl")
include("sdp.jl")
include("MOI_wrapper.jl")

# include("sdp.jl")
# include("MOI_wrapper.jl")
6 changes: 2 additions & 4 deletions test/sdp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ using SeDuMi
]
b = [1.0, 0.0]
c = [0.0, 1.0, 0.0, 0.0, 1.0]
primal, dual, info =
sedumi(A, b, c, SeDuMi.Cone(0, 1, [], [], [2]), fid = 0)
primal, dual, info = sedumi(A, b, c, SeDuMi.Cone(0, 1, [], [], [2]))
@test primal ≈ [1, 1, -1, -1, 1]
@test dual ≈ [2.0, 0.0]
@test info["pinf"] == 0.0
Expand All @@ -43,8 +42,7 @@ using SeDuMi
]
b = [1.0, 0.0]
c = [1.0, 0.0, 0.0, 1.0]
primal, dual, info =
sedumi(A, b, c, SeDuMi.Cone(0, 0, [], [], [2]), fid = 0)
primal, dual, info = sedumi(A, b, c, SeDuMi.Cone(0, 0, [], [], [2]))
@test isempty(primal)
@test dual == [1.0, -1.0]
@test info["pinf"] == 1.0
Expand Down
Loading