Skip to content

Switch from pytest to unittest #83

Switch from pytest to unittest

Switch from pytest to unittest #83

Workflow file for this run

name: ci
on:
pull_request:
push:
branches: [main]
tags: ['*']
jobs:
black:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- run: pip install poetry
- run: poetry install
- run: poetry run black --check .
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- run: pip install poetry
- run: poetry build
- uses: actions/upload-artifact@v3
with:
name: dist
path: dist/
flake8:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- run: pip install poetry
- run: poetry install
- run: poetry run flake8
mypy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- run: pip install poetry
- run: poetry install
- run: poetry run mypy .
unittest:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- '3.7'
- '3.8'
- '3.9'
- '3.10'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- run: pip install poetry
- run: poetry install
- run: poetry run coverage run
- run: poetry run coverage report
- run: poetry run coverage lcov
- uses: codecov/codecov-action@v3
if: ${{ matrix.python-version == '3.10' }}
publish:
runs-on: ubuntu-latest
needs:
- black
- build
- flake8
- mypy
- unittest
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/download-artifact@v3
with:
name: dist
path: dist/
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}