Pin urllib3
version to avoid an issue with docker
in CI
#48
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: Test | |
on: | |
- push | |
- pull_request | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
name: Test (Python ${{ matrix.python-version }}, Paramiko ${{ matrix.paramiko-version }}) | |
strategy: | |
matrix: | |
paramiko-version: | |
- '2.0' | |
- '3.0' | |
python-version: | |
#- 2.7 | |
#- 3.5 | |
#- 3.6 | |
- '3.7' | |
- '3.8' | |
- '3.9' | |
- '3.10' | |
- '3.11' | |
#- pypy-2.7 | |
#- pypy-3.6 | |
#- pypy-3.7 | |
steps: | |
- name: Checkout SSH docker container | |
run: docker pull sjourdan/alpine-sshd | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Update pip | |
run: python -m pip install -U pip wheel setuptools | |
- name: Install test dependencies | |
run: python -m pip install -U -r tests/requirements.txt | |
- name: Install paramiko ${{ matrix.paramiko-version }} | |
run: python -m pip install paramiko~=${{ matrix.paramiko-version }} | |
- name: Install local code | |
run: python -m pip install . | |
- name: Test with coverage | |
run: python -m coverage run -m unittest discover -vv | |
- name: Report coverage | |
run: python -m coverage report | |
- name: Export coverage statistics | |
run: python -m coverage xml | |
- name: Upload coverage statistics to Codecov | |
run: python -m codecov | |
package: | |
environment: PyPI | |
runs-on: ubuntu-latest | |
name: Deploy (PyPI) | |
needs: test | |
if: startsWith(github.ref, 'refs/tags') | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v1 | |
with: | |
python-version: 3.11 | |
- name: Install build package | |
run: python -m pip install -U build | |
- name: Build a wheel and source tarball | |
run: python -m build --sdist --wheel --outdir dist | |
- name: Publish distributions to PyPI | |
uses: pypa/gh-action-pypi-publish@master | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} | |
release: | |
environment: GitHub Releases | |
runs-on: ubuntu-latest | |
if: "startsWith(github.ref, 'refs/tags/v')" | |
name: Release | |
needs: package | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Release a Changelog | |
uses: rasmus-saks/[email protected] | |
with: | |
github-token: '${{ secrets.GITHUB_TOKEN }}' |