Skip to content

Commit

Permalink
Merge pull request #1649 from ERGO-Code/testpi
Browse files Browse the repository at this point in the history
Testpi
  • Loading branch information
galabovaa authored Mar 5, 2024
2 parents 8f477fc + ee3ef6c commit 2b56562
Show file tree
Hide file tree
Showing 12 changed files with 472 additions and 206 deletions.
216 changes: 216 additions & 0 deletions .github/workflows/build-python-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,216 @@
name: build-python-package
on: [push, pull_request]
# on: []

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build_sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Build sdist
run: |
python3 -m pip install setuptools
python3 setup.py sdist
- name: Install sdist
run: |
ls dist
python3 -m pip install dist/*.tar.gz
- name: Test highspy
run: |
python3 -m pip install pytest
python3 -m pytest $GITHUB_WORKSPACE/highspy/tests/test_highspy.py
build_sdist_mac:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4

- name: Build sdist
run: |
python3 -m pip install setuptools
python3 setup.py sdist
- name: Install sdist
run: |
ls dist
python3 -m pip install dist/*.tar.gz
- name: Test highspy
run: |
python3 -m pip install pytest
python3 -m pytest $GITHUB_WORKSPACE/highspy/tests/test_highspy.py
build_sdist_win:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4

- name: Install correct python version
uses: actions/setup-python@v5
with:
python-version: 3.9

- name: Build sdist
run: |
python -m pip install setuptools
python setup.py sdist
- name: Install sdist
run: |
$item = Get-ChildItem dist
python -m pip install "$item"
python -c "import highspy; print(dir(highspy))"
- name: Test highspy
run: |
python -m pip install pytest
python -m pytest ./highspy/tests/test_highspy.py
build_wheel_linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Build wheel
run: |
python3 --version
python3 -m pip install cibuildwheel
python3 -m cibuildwheel --only cp310-manylinux_x86_64 $GITHUB_WORKSPACE
- name: Install wheel
run: |
ls wheelhouse
python3 -m pip install wheelhouse/*.whl
- name: Test highspy
run: |
python3 -m pip install pytest
python3 -m pytest $GITHUB_WORKSPACE/highspy/tests/test_highspy.py
# macos 12 is Intel
build_wheel_macos_12:
runs-on: macos-12
strategy:
matrix:
python: [3.11]
steps:
- uses: actions/checkout@v4

- name: Install correct python version
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}

- name: Build wheel
run: |
python3 -m pip install cibuildwheel
python3 -m cibuildwheel --only cp311-macosx_x86_64 $GITHUB_WORKSPACE
- name: Install wheel
run: |
ls wheelhouse
python3 --version
python3 -m pip install wheelhouse/*.whl
python3 -c "import highspy; print(dir(highspy))"
- name: Test highspy
run: |
python3 -m pip install pytest
python3 -m pytest $GITHUB_WORKSPACE/highspy/tests/test_highspy.py
# macos 13 is Intel
build_wheel_macos_13:
runs-on: macos-13
strategy:
matrix:
python: [3.11]
steps:
- uses: actions/checkout@v4

- name: Install correct python version
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}

- name: Build wheel
run: |
python3 -m pip install cibuildwheel
python3 -m cibuildwheel --only cp311-macosx_x86_64 $GITHUB_WORKSPACE
- name: Install wheel
run: |
ls wheelhouse
python3 --version
python3 -m pip install wheelhouse/*.whl
python3 -c "import highspy; print(dir(highspy))"
- name: Test highspy
run: |
python3 -m pip install pytest
python3 -m pytest $GITHUB_WORKSPACE/highspy/tests/test_highspy.py
# macos 14 is M1 (beta)
build_wheel_macos_14:
runs-on: macos-14
strategy:
matrix:
python: [3.11]
steps:
- uses: actions/checkout@v4

- name: Install correct python version
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}

- name: Build wheel
run: |
python3 -m pip install cibuildwheel
python3 -m cibuildwheel --only cp311-macosx_arm64 $GITHUB_WORKSPACE
- name: Install wheel
run: |
ls wheelhouse
python3 --version
python3 -m pip install wheelhouse/*.whl
python3 -c "import highspy; print(dir(highspy))"
- name: Test highspy
run: |
python3 -m pip install pytest
python3 -m pytest $GITHUB_WORKSPACE/highspy/tests/test_highspy.py
build_wheel_windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4

- name: Install correct python version
uses: actions/setup-python@v5
with:
python-version: 3.9

- name: Build wheel
run: |
python -m pip install cibuildwheel
python -m cibuildwheel --only cp39-win_amd64 $GITHUB_WORKSPACE
- name: Install wheel
run: |
ls wheelhouse
$item = Get-ChildItem wheelhouse
python -m pip install "$item"
python -c "import highspy; print(dir(highspy))"
- name: Test highspy
run: |
python -m pip install pytest
python -m pytest highspy/tests/test_highspy.py
12 changes: 7 additions & 5 deletions .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# Python release WIP
name: Build wheels
on: []
# release:
# types:
# - published
# on: [push]

on:
release:
types:
- published

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -32,7 +34,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Build wheels
uses: pypa/cibuildwheel@v2.12.3
uses: pypa/cibuildwheel@v2.16.5
env:
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }}
- uses: actions/upload-artifact@v3
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/test-python-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,9 @@ jobs:
run: |
python3 -m pip install .
pytest -v ./highspy/tests/
- name: Test Python Examples
run: |
python3 ./examples/call_highs_from_python_highspy.py
python3 ./examples/call_highs_from_python_mps.py
python3 ./examples/call_highs_from_python.py
6 changes: 6 additions & 0 deletions .github/workflows/test-python-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,9 @@ jobs:
run: |
python3 -m pip install .
pytest -v ./highspy/tests/
- name: Test Python Examples
run: |
python3 ./examples/call_highs_from_python_highspy.py
python3 ./examples/call_highs_from_python_mps.py
python3 ./examples/call_highs_from_python.py
5 changes: 5 additions & 0 deletions .github/workflows/test-python-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,8 @@ jobs:
python -m pip install .
pytest -v ./highspy/tests/
- name: Test Python Examples
run: |
python ./examples/call_highs_from_python_highspy.py
python ./examples/call_highs_from_python_mps.py
python ./examples/call_highs_from_python.py
File renamed without changes.
Loading

0 comments on commit 2b56562

Please sign in to comment.