Skip to content

Bump gurobipy from 11.0.3 to 12.0.0 #615

Bump gurobipy from 11.0.3 to 12.0.0

Bump gurobipy from 11.0.3 to 12.0.0 #615

Workflow file for this run

# This workflow uses `pull_request_target` which has access to a WLS license. For security reasons, this workflow
# will only be run for PRs from a fork after it has been assessed by a repository owner and has the "safe to test"
# label added. Any changes to the PR in need of a retriggering of the workflow require the removal and re-adding of the
# "safe to test" label.
#
# Since a subset of tests was already run in the nolicense workflow, this workflow runs skips the following tests:
# - Lint with flake8.
name: build and test PR, license required
on:
pull_request_target:
types: [labeled]
permissions:
contents: read
jobs:
build_pr_license:
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'safe to test')
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
gurobi-version: ["gurobi10", "gurobi11","gurobi12"]
exclude:
- python-version: "3.12"
gurobi-version: "gurobi10"
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest tox tox-gh-actions
- shell: bash
id: write-license
env:
LICENSE: ${{ secrets.LICENSE }}
run: |
echo "$LICENSE" > $PWD/gurobi.lic
echo "grb_license_file=$PWD/gurobi.lic" >> $GITHUB_OUTPUT
- name: Test with tox
run: |
tox
env:
GRB_LICENSE_FILE: ${{ steps.write-license.outputs.grb_license_file }}
GUROBI_VERSION: ${{ matrix.gurobi-version }}
- name: Run examples with Gurobi 11
if: ${{ (matrix.gurobi-version == 'gurobi11') && (matrix.python-version == '3.12') }}
env:
GRB_LICENSE_FILE: ${{ steps.write-license.outputs.grb_license_file }}
GUROBI_VERSION: ${{ matrix.gurobi-version }}
run: |
python_version_no_dot=$(echo "${{ matrix.python-version }}" | tr -d '.')
tox -e py${python_version_no_dot}-examples-${{matrix.gurobi-version}}