name: Benchmark
on:
workflow_dispatch:
inputs:
time_limit:
description: "Per-(instance, solver) budget in seconds"
required: false
default: "300"
mip_gap:
description: "Relative MIP gap all solvers stop at (0 = exact; 0.0001 = 0.01%)"
required: false
default: "0.0001"
concurrency:
group: benchmark
cancel-in-progress: false
jobs:
benchmark:
name: Run benchmark
runs-on: ubuntu-latest
timeout-minutes: 350
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install prerequisites
run: sudo apt-get update && sudo apt-get install -y cmake build-essential libclang-dev libgfortran5
- name: Cache Rust
uses: actions/cache@v4
with:
key: ${{ runner.os }}-benchmark-${{ hashFiles('Cargo.lock', 'Cargo.toml', 'benchmark/Cargo.toml') }}
restore-keys: ${{ runner.os }}-benchmark-
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
- name: Build
run: cargo build --locked -p microlp-benchmark --release
- name: Run benchmark
run: |
set -o pipefail
cargo run --locked -p microlp-benchmark --release -- \
--time-limit "${{ inputs.time_limit }}" \
--mip-gap "${{ inputs.mip_gap }}" \
--out BENCHMARK.md 2>&1 | tee benchmark-progress.log
- name: Publish report to the job summary
run: cat BENCHMARK.md >> "$GITHUB_STEP_SUMMARY"
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: benchmark-report
path: |
BENCHMARK.md
benchmark-progress.log
if-no-files-found: error