Skip to content

Bump mypy from 1.9.0 to 1.10.0 (#89) #285

Bump mypy from 1.9.0 to 1.10.0 (#89)

Bump mypy from 1.9.0 to 1.10.0 (#89) #285

Workflow file for this run

name: tests
on:
push:
pull_request_target:
workflow_dispatch:
env:
POETRY_VERSION: "1.6.1"
jobs:
deploy:
runs-on: ubuntu-latest # ${{ matrix.os }}
strategy:
matrix:
# os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.8", "3.9", "3.10", "3.11"]
env:
PYTHON_VERSION: ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
# Update full Python version
- name: Full Python version
run: |
echo "PYTHON_VERSION=$(python -c "import platform; print(platform.python_version())")"
echo "PYTHON_VERSION=$(python -c "import platform; print(platform.python_version())")" >> $GITHUB_ENV
# virtualenv cache should depends on OS, Python version and `poetry.lock` (and optionally workflow files).
- name: Cache Packages
uses: actions/cache@v4
with:
path: |
~/.local
.venv
key: poetry-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('**/poetry.lock') }}
- name: Install and configure Poetry
uses: snok/install-poetry@v1.3.4
with:
version: ${{ env.POETRY_VERSION }}
virtualenvs-create: true
virtualenvs-in-project: true
- name: Display Python version
run: poetry run python -c "import sys; print(sys.version)"
- name: Install dependencies
run: |
poetry install
- name: Style checking
if: ${{ matrix.python-version == '3.10' }}
run: |
poetry run ruff check src tests
poetry run ruff format --check src tests
- name: Type checking
if: ${{ matrix.python-version == '3.10' }}
run: |
poetry run mypy src tests
- name: Run tests
run: |
poetry run pytest --cov --cov-report xml
- name: Upload coverage to Codecov
if: ${{ github.event_name != 'pull_request_target' && matrix.python-version == '3.10' }}
uses: codecov/codecov-action@v4
with:
env_vars: PYTHON_VERSION