fix on_disconnect callback #40
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: ci | |
on: | |
push: | |
branches: [master, develop] | |
tags: | |
- 'v*' | |
pull_request: | |
branches: [master, develop] | |
jobs: | |
format: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Update pip | |
run: python3 -m pip install --no-cache --upgrade pip setuptools wheel | |
- name: Install dependencies | |
run: pip3 install .[format] | |
- name: Check PEP8 with black | |
run: black . --check | |
build: | |
needs: format | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Update pip | |
run: python3 -m pip install --no-cache --upgrade pip setuptools wheel | |
- name: Install dependencies | |
run: pip3 install . | |
- name: Build package | |
run: python3 setup.py bdist_wheel | |
- uses: actions/upload-artifact@master | |
with: | |
name: package | |
path: ./dist | |
test: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/download-artifact@master | |
with: | |
name: package | |
path: ./dist | |
- name: Remove system protobuf | |
run: sudo apt-get remove -y python3-protobuf | |
- name: Install package | |
run: pip3 install dist/* | |
- name: Install dependencies | |
run: pip3 install .[test] | |
- name: Run Tests | |
run: pytest tests | |
pylint: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/download-artifact@master | |
with: | |
name: package | |
path: ./dist | |
- name: Install package | |
run: pip3 install dist/* | |
- name: Install dependencies | |
run: pip3 install .[test,lint] | |
- name: Lint main | |
run: python3 -m pylint ./pkg/ | |
- name: Lint tests | |
run: python3 -m pylint ./tests | |
pip_upload: | |
name: Upload if release | |
needs: [ test, pylint ] | |
runs-on: ubuntu-latest | |
if: ${{ startsWith(github.event.ref, 'refs/tags/v') }} | |
steps: | |
- uses: actions/setup-python@v2 | |
- uses: actions/download-artifact@v2 | |
with: | |
name: package | |
path: ./dist | |
- uses: pypa/gh-action-pypi-publish@v1.5.0 | |
with: | |
user: ${{ secrets.PYPI_USERNAME }} | |
password: ${{ secrets.PYPI_PASSWORD }} |