Test wheels #18
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run the unit tests against several pythons and platforms | |
# using a built wheel to install the package. | |
name: Test wheels | |
on: | |
workflow_call: | |
workflow_dispatch: | |
permissions: | |
contents: read | |
jobs: | |
wheel-tests: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
python: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
exclude: | |
- os: macos-latest | |
python: "3.8" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Install build tools | |
run: | | |
python -m pip install --upgrade pip build | |
- name: Build wheel | |
run: | | |
python -m build | |
- name: Fetch dependencies for offline install | |
run: | | |
pip wheel --wheel-dir=dist gurobipy pandas "numpy<2" scipy gurobipy-pandas | |
pip wheel --wheel-dir=dist "numpy>=2" | |
- name: Install from built wheel | |
run: | | |
python -m pip install --find-links dist --no-index --only-binary=:all: gurobi-optimods | |
- name: Run unit tests | |
run: | | |
python -m unittest discover -b | |
- name: Fetch dependencies for offline install | |
run: | | |
pip wheel --wheel-dir=dist matplotlib networkx plotly scikit-learn | |
- name: Install example dependencies | |
run: | | |
python -m pip install --find-links dist --no-index --only-binary=:all: gurobi-optimods[examples] | |
- name: Run additional tests | |
run: | | |
python -m unittest discover -b |