name: Build

on: [push, pull_request]

jobs:
  build:
    strategy:
      matrix:
        os: [ubuntu-22.04, macos-15, macos-15-intel, windows-2022]
        python-version: ['3.14']

    runs-on: ${{ matrix.os }}

    steps:
    - name: Checkout source
      uses: actions/checkout@v4
      with:
        fetch-depth: 0

    - 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 setuptools setuptools_scm build wheel pytest pytest-cov coveralls

    - name: Build/install SMCP
      run: |
        python -m build --wheel
        pip install cvxopt chompack
        pip install --no-index --find-links=${{github.workspace}}/dist smcp

    - name: Test with pytest
      run: |
        pytest --cov=smcp tests
