Skip to content

ci: change poetry installer #69

ci: change poetry installer

ci: change poetry installer #69

# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Python package
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
release:
types: [ published ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
version: 1.5.0
- name: Install dependencies
run: |
poetry install -E cli
- name: Run black
run: |
poetry run python -m black -t py38 . --check
- name: Run pytest
run: |
poetry run python -m pytest
- name: Publish package
if: matrix.python-version == 3.8 && startsWith(github.ref, 'refs/tags')
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
poetry config pypi-token.pypi $PYPI_TOKEN
poetry publish --build