Skip to content

Commit

Permalink
WIP: prep for continuous integration
Browse files Browse the repository at this point in the history
  • Loading branch information
odow committed Nov 4, 2021
1 parent 419c872 commit 29a5394
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 3 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: CI
on:
push:
branches: [master]
pull_request:
types: [opened, synchronize, reopened]
jobs:
test:
name: 'Gurobi'
runs-on: 'ubuntu-latest'
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v2
- 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/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
with:
file: lcov.info
6 changes: 6 additions & 0 deletions Artifacts.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[gurobi912linux64]
git-tree-sha1 = "6b65d6a3f5bd9057ae37e58d0a23562f5b05304a"

[[gurobi912linux64.download]]
url = "https://packages.gurobi.com/9.1/gurobi9.1.2_linux64.tar.gz"
sha256 = "7f60bd675f79476bb2b32cd632aa1d470f8246f2b033b7652d8de86f6e7e429b"
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ MathOptInterface = "b8f27783-ece8-5eb3-8dc8-9495eed66fee"
[compat]
CEnum = "0.3, 0.4"
MathOptInterface = "~0.10"
julia = "1"
julia = "1.3"

[extras]
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Expand Down
3 changes: 2 additions & 1 deletion deps/build.jl
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ if haskey(ENV, "GUROBI_JL_SKIP_LIB_CHECK")
# Skip!
elseif get(ENV, "JULIA_REGISTRYCI_AUTOMERGE", "false") == "true"
write_depsfile("julia_registryci_automerge")
elseif !found
elseif !found && !Sys.islinux()
# Use Artifacts on Linux.
diagnose_gurobi_install()
error("""
Unable to locate Gurobi installation. If the advice above did not help,
Expand Down
10 changes: 9 additions & 1 deletion src/Gurobi.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
module Gurobi

import Pkg.Artifacts

const _DEPS_FILE = joinpath(dirname(@__FILE__), "..", "deps", "deps.jl")
if isfile(_DEPS_FILE)

if Sys.islinux()
const libgurobi = joinpath(
Pkg.Artifacts.artifact"gurobi912linux64",
"gurobi912/linux64/lib/libgurobi.91.so",
)
elseif isfile(_DEPS_FILE)
include(_DEPS_FILE)
else
error("""
Expand Down

0 comments on commit 29a5394

Please sign in to comment.