Skip to content

Commit

Permalink
refactor: move the benchmark action into this repo
Browse files Browse the repository at this point in the history
  • Loading branch information
maxemiliang committed Oct 18, 2023
1 parent 751fbdd commit ad91fdb
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 8 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/benchmarker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Benchmark

on:
workflow_call:
inputs:
shot_executable:
description: 'The SHOT executable to run'
default: "shot"
required: false
type: string
benchmark_folder:
description: 'The benchmark to run (folder name from: https://github.com/andreaslundell/SHOT_benchmark_problems)'
default: "MINLP-convex-small"
required: false
type: string
benchmark_type:
description: 'The benchmark type to run, can be gms, nl or osil'
default: "nl"
required: false
type: string
benchmarks:
description: 'The benchmarks to run, can be a list of benchmarks or a single benchmark, defaults to all benchmarks'
default: ""
required: false
type: string

jobs:
benchmark:
name: Benchmark SHOT
runs-on: [ self-hosted, linux, cmake ]

steps:
- shell: bash
run: git clone https://github.com/maxemiliang/shot-benchmarker.git


- uses: actions/setup-python@v4
with:
python-version: 3.11
cache: 'pip'
working-directory: ${{ github.workspace }}/shot-benchmarker

- shell: bash
run: pip install -r requirements.txt
working-directory: ${{ github.workspace }}/shot-benchmarker

- shell: bash
env:
INPUT_BENCHMARK_FOLDER: ${{ inputs.benchmark_folder }}
INPUT_BENCHMARK_TYPE: ${{ inputs.benchmark_type }}
INPUT_BENCHMARKS: ${{ inputs.benchmarks }}
INPUT_SHOT_EXECUTABLE: ${{ inputs.shot_executable }}
run: python main.py
working-directory: ${{ github.workspace }}/shot-benchmarker
13 changes: 5 additions & 8 deletions .github/workflows/build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,11 @@ jobs:
benchmark:
name: Benchmark
needs: [ build-test ]
runs-on: [ self-hosted, docker ]
steps:
- name: Run Benchmark
uses: maxemiliang/[email protected]
with:
benchmark_folder: "MINLP-convex-small"
benchmark_type: "nl"
shot_executable: ${{github.workspace}}/build/SHOT
uses: ./.github/workflows/benchmarker.yml§
with:
benchmark_folder: "MINLP-convex-small"
benchmark_type: "nl"
shot_executable: ${{github.workspace}}/build/SHOT

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

0 comments on commit ad91fdb

Please sign in to comment.