From 0b70b7f35e27a6ca4a96401ab145fb5525fd7b79 Mon Sep 17 00:00:00 2001 From: odow Date: Sat, 27 Apr 2024 10:47:37 +1200 Subject: [PATCH] Add CI for julia-nightly --- .github/workflows/ci.yml | 7 +++++-- src/C_API.jl | 22 ++++++++++------------ 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 49f0ed1..5b896f2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,9 +22,12 @@ jobs: - version: '1' os: macos-14 arch: aarch64 + - version: 'nightly' + os: ubuntu-latest + arch: x64 steps: - uses: actions/checkout@v4 - - uses: julia-actions/setup-julia@v1 + - uses: julia-actions/setup-julia@v2 with: version: ${{ matrix.version }} arch: ${{ matrix.arch }} @@ -32,6 +35,6 @@ jobs: - uses: julia-actions/julia-buildpkg@v1 - uses: julia-actions/julia-runtest@v1 - uses: julia-actions/julia-processcoverage@v1 - - uses: codecov/codecov-action@v1 + - uses: codecov/codecov-action@v3 with: file: lcov.info diff --git a/src/C_API.jl b/src/C_API.jl index e9da455..bea6b79 100644 --- a/src/C_API.jl +++ b/src/C_API.jl @@ -754,22 +754,20 @@ function solve_mcp( jacobian_linear_elements::Vector{Int} = Int[], kwargs..., ) - if c_api_Path_CheckLicense(length(z), nnz) == 0 + @assert length(z) == length(lb) == length(ub) + n = length(z) + if c_api_Path_CheckLicense(n, nnz) == 0 return MCP_LicenseError, nothing, nothing + elseif nnz > typemax(Cint) + return MCP_Error, nothing, nothing + elseif n == 0 + return MCP_Solved, nothing, nothing end - @assert length(z) == length(lb) == length(ub) out_io = silent ? IOBuffer() : stdout output_data = OutputData(out_io) - GC.@preserve output_data begin - c_api_Output_SetInterface(OutputInterface(output_data)) - - n = length(z) - if n == 0 - return MCP_Solved, nothing, nothing - end - if nnz > typemax(Cint) - return MCP_Error, nothing, nothing - end + output_interface = OutputInterface(output_data) + GC.@preserve output_data output_interface begin + c_api_Output_SetInterface(output_interface) o = c_api_Options_Create() c_api_Path_AddOptions(o) c_api_Options_Default(o)