name: Slycot from source

on: [push, pull_request]

jobs:
  build-linux:
    runs-on: ubuntu-latest

    steps:
    - name: Checkout python-control
      uses: actions/checkout@v3
      with:
        path: python-control
    - name: Set up Python
      uses: actions/setup-python@v2
    - name: Install Python dependencies
      run: |
        # Set up conda
        echo $CONDA/bin >> $GITHUB_PATH

        # Set up (virtual) X11
        sudo apt install -y xvfb

        # Install test tools
        conda install pip pytest pytest-timeout

        # Install python-control dependencies
        conda install numpy matplotlib scipy

    - name: Checkout Slycot
      uses: actions/checkout@v3
      with:
        repository: python-control/Slycot
        submodules: recursive
        fetch-depth: 0
        path: slycot
    - name: Install slycot from source
      env:
        BLA_VENDOR: Generic
        CMAKE_GENERATOR: Unix Makefiles
      working-directory: slycot
      run: |
        # Install compilers, libraries, and development environment
        sudo apt-get -y install gfortran cmake --fix-missing
        sudo apt-get -y install libblas-dev liblapack-dev
        conda install -c conda-forge scikit-build setuptools-scm

        # Compile and install slycot
        pip install -v --no-build-isolation --no-deps .

    - name: Test with pytest
      working-directory: python-control
      run: xvfb-run --auto-servernum pytest control/tests

name: Slycot from source

on: [push, pull_request]

jobs:
  build-linux:
    runs-on: ubuntu-latest

    steps:
    - name: Checkout python-control
      uses: actions/checkout@v3
      with:
        path: python-control
    - name: Set up Python
      uses: actions/setup-python@v2
    - name: Install Python dependencies
      run: |
        # Set up (virtual) X11
        sudo apt install -y xvfb

        # Install test tools
        pip install pytest pytest-timeout

        # Install python-control dependencies
        pip install numpy matplotlib scipy

    - name: Checkout Slycot
      uses: actions/checkout@v3
      with:
        repository: python-control/Slycot
        submodules: recursive
        fetch-depth: 0
        path: slycot
    - name: Install slycot from source
      env:
        BLA_VENDOR: Generic
        CMAKE_GENERATOR: Unix Makefiles
      working-directory: slycot
      run: |
        # Install compilers, libraries, and development environment
        sudo apt-get -y install gfortran cmake --fix-missing
        sudo apt-get -y install libblas-dev liblapack-dev

        # Compile and install slycot
        pip install -v .

    - name: Test with pytest
      working-directory: python-control
      run: xvfb-run --auto-servernum pytest control/tests

Build Slycot from source using PyPI wheels
Build Slycot from source using PyPI wheels
