diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..0080713 --- /dev/null +++ b/.github/workflows/ci.yml @@ -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 }} diff --git a/test/MOI_wrapper.jl b/test/MOI_wrapper.jl index 4def97a..a65d69f 100644 --- a/test/MOI_wrapper.jl +++ b/test/MOI_wrapper.jl @@ -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( diff --git a/test/lp.jl b/test/lp.jl index 91c4012..e2f26a6 100644 --- a/test/lp.jl +++ b/test/lp.jl @@ -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"]) diff --git a/test/runtests.jl b/test/runtests.jl index be48bd2..71b3507 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -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") diff --git a/test/sdp.jl b/test/sdp.jl index adb7a51..15d3ae8 100644 --- a/test/sdp.jl +++ b/test/sdp.jl @@ -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 @@ -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