--- #71
Workflow file for this run
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 | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up poetry | |
uses: abatilo/actions-poetry@v2 | |
with: | |
poetry-version: "1.2.2" | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
cache: "poetry" | |
- name: Check poetry file itself | |
run: poetry check | |
- name: Install package | |
run: poetry install | |
env: | |
PYTHON_KEYRING_BACKEND: "keyring.backends.null.Keyring" | |
- name: Lint | |
run: poetry run flake8 . | |
- name: Autoformat check | |
run: poetry run black . | |
- name: Isort import order check | |
run: poetry run isort -c . | |
- name: Unit tests | |
run: poetry run pytest | |
- name: Coveralls | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: poetry run coveralls --service=github | |
package: | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags') | |
needs: test | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up poetry | |
uses: abatilo/actions-poetry@v2 | |
with: | |
poetry-version: "1.2.2" | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
cache: "poetry" | |
- name: Install package | |
run: poetry install | |
env: | |
PYTHON_KEYRING_BACKEND: "keyring.backends.null.Keyring" | |
- name: Create packages | |
run: | | |
poetry run python setup.py sdist | |
poetry run python setup.py bdist_wheel | |
- name: Publish to test PyPi | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ secrets.TEST_PYPI_API_TOKEN }} | |
repository_url: https://test.pypi.org/legacy/ | |
- name: Publish to PyPi | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ secrets.PYPI_API_TOKEN }} |