v1.14.1 #152
Workflow file for this run
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: "Test Python Lib" | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - devel | |
| - deploy | |
| pull_request: | |
| release: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| jobs: | |
| test: | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| python: ['3.11', '3.12', '3.13', '3.14'] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.python }} | |
| - name: Install build dependencies | |
| run: | | |
| pip install setuptools | |
| pip install 'Cython>=0.29' | |
| pip install 'numpy>=2,<3' | |
| - name: Install lib | |
| run: | | |
| python -m pip install --editable . | |
| - name: Install test dependencies | |
| run: | | |
| pip install matplotlib pytest | |
| - name: pytest | |
| run: | | |
| pytest GPy/testing | |
| build: | |
| if: github.event_name == 'release' | |
| strategy: | |
| matrix: | |
| os: [windows-latest, macos-latest] | |
| python: ['3.11', '3.12', '3.13', '3.14'] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.python }} | |
| - name: Build lib | |
| run: | | |
| pip install setuptools | |
| pip install wheel | |
| pip install 'Cython>=0.29' | |
| pip install 'numpy>=2,<3' | |
| python -m pip install --editable . | |
| python setup.py bdist_wheel | |
| - name: Build sdist (Windows only) | |
| if: runner.os == 'Windows' | |
| run: python setup.py sdist | |
| - name: List contents of dist | |
| run: ls -R dist | |
| - name: Archive build artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: dist-artifacts-${{ matrix.os }}-${{ matrix.python }} | |
| path: dist | |
| build-linux: | |
| if: github.event_name == 'release' | |
| strategy: | |
| matrix: | |
| python: ['cp311-cp311', 'cp312-cp312', 'cp313-cp313', 'cp314-cp314'] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| # Run the build inside manylinux via docker so host-side actions | |
| # (checkout/upload-artifact) are not constrained by the old container. | |
| - name: Build and repair wheel in manylinux container | |
| run: | | |
| docker run --rm \ | |
| -v "$PWD":/io \ | |
| -w /io \ | |
| quay.io/pypa/manylinux2014_x86_64 \ | |
| bash -euo pipefail -c " | |
| /opt/python/${{ matrix.python }}/bin/python -m pip install 'Cython>=0.29' 'numpy>=2,<3' | |
| /opt/python/${{ matrix.python }}/bin/python -m pip install --editable . | |
| /opt/python/${{ matrix.python }}/bin/python setup.py bdist_wheel | |
| /opt/python/${{ matrix.python }}/bin/python -m pip install auditwheel | |
| /opt/python/${{ matrix.python }}/bin/python -m auditwheel repair dist/*${{ matrix.python }}-linux_x86_64.whl | |
| rm -f dist/* | |
| mv wheelhouse/* dist/ | |
| rmdir wheelhouse | |
| " | |
| sudo chown -R "$USER:$USER" dist | |
| - name: List contents of dist | |
| run: ls -R dist | |
| - name: Archive build artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: dist-artifacts-manylinux-${{ matrix.python }} | |
| path: dist | |
| deploy: | |
| runs-on: ubuntu-latest | |
| needs: [test, build-linux, build] | |
| if: github.event_name == 'release' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.11' | |
| - name: Install twine | |
| run: | | |
| pip install --upgrade pip | |
| pip install twine | |
| - name: Download all artifacts to a specific directory | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: dist | |
| merge-multiple: true | |
| - name: Inspect wheel files | |
| run: | | |
| ls -R dist | |
| - name: Upload to PyPI using twine | |
| run: twine upload --skip-existing dist/* | |
| env: | |
| TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | |
| TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} |