Skip to content

Replace black and flake8 with ruff #89

Replace black and flake8 with ruff

Replace black and flake8 with ruff #89

Workflow file for this run

name: ci
on:
pull_request:
push:
branches: [main]
tags: ['*']
jobs:
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/
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 .
ruff:
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 ruff check
- run: poetry run ruff format --check
unittest:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- '3.7'
- '3.8'
- '3.9'
- '3.10'
- '3.11'
- '3.12'
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:
- build
- mypy
- ruff
- 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 }}