INDI v2.1.3 release #3
This file contains hidden or 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: PyIndi | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - 'master' | |
| pull_request: | |
| branches: | |
| - 'master' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| container: ["ubuntu"] | |
| container: | |
| image: ghcr.io/indilib/${{ matrix.container }} | |
| steps: | |
| - name: Get INDI Sources | |
| uses: actions/checkout@v3 | |
| with: | |
| path: 'indi' | |
| - name: Build INDI Core | |
| run: | | |
| indi/scripts/indi-core-build.sh | |
| indi/scripts/indi-core-package-build.sh | |
| - name: Install INDI Core | |
| run: indi/scripts/indi-core-install.sh | |
| - name: Install Python3 Pre-requisites | |
| run: | | |
| $(command -v sudo) apt-get update && $(command -v sudo) apt-get install -y \ | |
| python3 \ | |
| python3-dev \ | |
| python3-setuptools \ | |
| python3-venv \ | |
| swig \ | |
| python3-pip \ | |
| libdbus-1-dev \ | |
| dbus \ | |
| python3-dbus \ | |
| pkg-config \ | |
| libglib2.0-dev \ | |
| libgirepository1.0-dev \ | |
| gir1.2-glib-2.0 | |
| - name: Get PyIndi Sources | |
| uses: actions/checkout@v2 | |
| with: | |
| repository: indilib/pyindi-client | |
| path: ./pyindi-client | |
| - name: Create and activate venv | |
| run: | | |
| python3 -m venv venv | |
| echo "VIRTUAL_ENV=$GITHUB_WORKSPACE/venv" >> $GITHUB_ENV | |
| echo "$GITHUB_WORKSPACE/venv/bin" >> $GITHUB_PATH | |
| - name: Install build dependencies | |
| run: | | |
| $GITHUB_WORKSPACE/venv/bin/pip install setuptools wheel build | |
| - name: Build PyIndi | |
| run: | | |
| cd pyindi-client | |
| # Create a temporary setup.py to handle SWIG generation | |
| cat > setup.py << 'EOL' | |
| from setuptools import setup, Extension | |
| setup( | |
| name="pyindi-client", | |
| ext_modules=[ | |
| Extension( | |
| "_PyIndi", | |
| sources=["indiclientpython.i"], | |
| include_dirs=["/usr/include", "/usr/include/libindi", "/usr/local/include/libindi"], | |
| libraries=["z", "cfitsio", "nova", "indiclient"], | |
| language="c++", | |
| swig_opts=["-c++", "-threads", "-I/usr/include", "-I/usr/include/libindi", "-I/usr/local/include/libindi"] | |
| ) | |
| ] | |
| ) | |
| EOL | |
| # Build with temporary setup.py | |
| $GITHUB_WORKSPACE/venv/bin/python setup.py build_ext --inplace | |
| # Build wheel | |
| $GITHUB_WORKSPACE/venv/bin/python -m build --wheel | |
| # Install wheel | |
| $GITHUB_WORKSPACE/venv/bin/pip install dist/*.whl | |
| - name: Install test deps | |
| run: | | |
| cd pyindi-client | |
| $GITHUB_WORKSPACE/venv/bin/pip install -r requirements-test.txt | |
| - name: Format Python code | |
| run: | | |
| cd pyindi-client | |
| $GITHUB_WORKSPACE/venv/bin/black tests examples | |
| - name: Test PyIndi | |
| run: | | |
| cd pyindi-client && /bin/bash -c "INDI_SKIP_GSC=1 indiserver indi_simulator_ccd indi_simulator_focus indi_simulator_gps indi_simulator_guide indi_simulator_wheel indi_simulator_telescope & $GITHUB_WORKSPACE/venv/bin/tox" |