Merge pull request #274 from chrhansk/feature-deriv-documentation #318
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
name: tests | |
on: [push, pull_request] | |
# cancels prior builds for this workflow when new commit is pushed | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: Build and run tests | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
python-version: ['3.9', '3.10', '3.11', '3.12'] | |
ipopt-version: ['3.12', '3.13', '3.14'] | |
exclude: | |
- os: windows-latest | |
ipopt-version: '3.12' | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- name: Checkout CyIpopt | |
uses: actions/checkout@v3 | |
- uses: conda-incubator/setup-miniconda@v2 | |
with: | |
auto-update-conda: true | |
activate-environment: test-environment | |
python-version: ${{ matrix.python-version }} | |
channels: conda-forge | |
miniforge-variant: Mambaforge | |
- name: Install basic dependencies against generic blas/lapack | |
run: | | |
mamba install -q -y "ipopt=${{ matrix.ipopt-version }}" "numpy>=1.25" "pkg-config>=0.29.2" "setuptools>=44.1.1" "cython>=0.29.28" "pytest>=6.2.5" | |
- run: echo "IPOPTWINDIR=USECONDAFORGEIPOPT" >> $GITHUB_ENV | |
- name: Install cyipopt | |
run: | | |
rm pyproject.toml | |
python -m pip install --no-deps --no-build-isolation . | |
mamba list | |
- name: Test with pytest and run examples | |
run: | | |
python -c "import cyipopt" | |
mamba list | |
pytest | |
python examples/hs071.py | |
python examples/exception_handling.py | |
- name: Test with pytest and scipy, new ipopt | |
# cyipopt can build with these dependencies, but it seems impossible to | |
# also install scipy into these environments likely due to SciPy and | |
# Ipopt needed different libfortrans. | |
if: (matrix.ipopt-version != '3.12' && matrix.python-version != '3.11') || (matrix.ipopt-version != '3.12' && matrix.python-version != '3.10' && matrix.os != 'macos-latest') | |
run: | | |
mamba install -q -y -c conda-forge "ipopt=${{ matrix.ipopt-version }}" "numpy>=1.25" "pkg-config>=0.29.2" "setuptools>=44.1.1" "scipy>1.8.0" "pytest>=6.2.5" "cython=0.29.*" | |
mamba list | |
pytest |