Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
odow committed Mar 12, 2024
1 parent 2f4a159 commit cff6836
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 31 deletions.
22 changes: 9 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,34 @@ on:
branches: [master]
pull_request:
types: [opened, synchronize, reopened]
# needed to allow julia-actions/cache to delete old caches that it has created
permissions:
actions: write
contents: read
jobs:
test:
name: 'KNITRO'
runs-on: 'ubuntu-latest'
runs-on: '${{ matrix.os }}'
strategy:
fail-fast: false
matrix:
version: ['1.6', '1']
os: ['ubuntu-latest', 'macOS-latest', 'windows-latest']
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
arch: 'x64'
- uses: actions/cache@v1
env:
cache-name: cache-artifacts
with:
path: ~/.julia/artifacts
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- uses: julia-actions/cache@v1
- shell: bash
env:
ARTELYS_LIC_JUMP_DEV: ${{ secrets.ARTELYS_LIC_8326_JUMP_DEV_2023_11_02 }}
run: |
echo "$ARTELYS_LIC_JUMP_DEV" > ~/artelys_lic.txt
- uses: julia-actions/julia-buildpkg@v1
env:
SECRET_KNITRO_TAR_BZ2: ${{ secrets.SECRET_KNITRO_TAR_BZ2 }}
SECRET_KNITRO_ZIP: ${{ secrets.SECRET_KNITRO_ZIP }}
- uses: julia-actions/julia-runtest@v1
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
Expand Down
19 changes: 7 additions & 12 deletions .github/workflows/minlptests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,29 @@ on:
branches: [master]
pull_request:
types: [opened, synchronize, reopened]
# needed to allow julia-actions/cache to delete old caches that it has created
permissions:
actions: write
contents: read
jobs:
test:
name: KNITRO
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
with:
version: '1'
arch: 'x64'
- uses: actions/cache@v1
env:
cache-name: cache-artifacts
with:
path: ~/.julia/artifacts
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- uses: julia-actions/cache@v1
- shell: bash
env:
ARTELYS_LIC_JUMP_DEV: ${{ secrets.ARTELYS_LIC_8326_JUMP_DEV_2023_11_02 }}
run: |
echo "$ARTELYS_LIC_JUMP_DEV" > ~/artelys_lic.txt
- name: "run_minlptests"
env:
SECRET_KNITRO_TAR_BZ2: ${{ secrets.SECRET_KNITRO_TAR_BZ2 }}
SECRET_KNITRO_ZIP: ${{ secrets.SECRET_KNITRO_ZIP }}
shell: julia --color=yes {0}
run: |
path = joinpath(ENV["GITHUB_WORKSPACE"], "test", "MINLPTests")
Expand Down
17 changes: 11 additions & 6 deletions deps/build.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,20 @@ function try_local_installation()
end

function try_ci_installation()
local_filename = joinpath(@__DIR__, "libknitro.tar.bz2")
download(ENV["SECRET_KNITRO_TAR_BZ2"], local_filename)
run(`tar -xjf libknitro.tar.bz2`)
# CI runs on linux only
write_depsfile("", joinpath(@__DIR__, "libknitro", "libknitro1310.so"))
local_filename = joinpath(@__DIR__, "knitro14.zip")
download(ENV["SECRET_KNITRO_ZIP"], local_filename)
run(`tar -xf knitro14.zip`)
if Sys.islinux()
write_depsfile("", joinpath(@__DIR__, "libknitro1400.so"))
elseif Sys.isapple()
write_depsfile("", joinpath(@__DIR__, "libknitro1400.dylib"))
elseif Sys.iswindows()
write_depsfile("", joinpath(@__DIR__, "knitro1400.dll"))
end
return
end

if get(ENV, "SECRET_KNITRO_TAR_BZ2", "") != ""
if get(ENV, "SECRET_KNITRO_ZIP", "") != ""
try_ci_installation()
else
try_local_installation()
Expand Down

0 comments on commit cff6836

Please sign in to comment.