Skip to content

Commit

Permalink
refactor(ci): refactored the benchmarker to add GAMS/Gurobi license i…
Browse files Browse the repository at this point in the history
…f it is needed
  • Loading branch information
maxemiliang committed Oct 22, 2023
1 parent f9d844b commit fcd1591
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/benchmarker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,35 @@ on:
default: "all"
required: false
type: string
enable_gurobi:
description: 'Is this a Gurobi build (this will install Gurobi)'
default: false
required: false
type: boolean
enable_gams:
description: 'Is this a GAMS build (this will install GAMS)'
default: false
required: false
type: boolean

secrets:
gurobi_license:
description: 'Gurobi license file secret'
required: false
gams_license:
description: 'GAMS license file secret'
required: false

outputs:
benchmarks:
description: 'The benchmarks that were run'
value: ${{ jobs.benchmark.outputs.benchmarks }}


env:
GRB_LICENSE_FILE: ${{ github.workspace }}/gurobi.lic
GAMS_LICENSE_FILE: ${{ github.workspace }}/ThirdParty/gams42.3_linux_x64_64_sfx/gamslice.txt

jobs:
benchmark:
outputs:
Expand All @@ -53,6 +76,19 @@ jobs:
- shell: bash
run: echo ${{ inputs.shot_executable }}

# Add the license file to the GAMS installation directory
- name: Setup GAMS License file
if: ${{ inputs.enable_gams }}
shell: bash
working-directory: ${{github.workspace}}
run: echo ${{ secrets.gams_license }} | base64 -d > $GAMS_LICENSE_FILE

- name: Setup Gurobi License file
if: ${{ inputs.enable_gurobi }}
shell: bash
working-directory: ${{github.workspace}}
run: echo ${{ secrets.gurobi_license }} | base64 -d > $GRB_LICENSE_FILE

- shell: bash
id: benchmark
env:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ jobs:
with:
benchmark_folder: "MINLP-convex-small"
benchmark_type: "nl"
enable_gurobi: true
enable_gams: true
secrets:
gurobi_license: ${{ secrets.GUROBI_LICENSE_FILE }}
gams_license: ${{ secrets.GAMS_LICENSE_FILE }}

# Publish the test results as an output
publish-test:
Expand Down

0 comments on commit fcd1591

Please sign in to comment.