Skip to content

fix: rename date to datetime #5

fix: rename date to datetime

fix: rename date to datetime #5

name: Lint, Format, and Type Check
on:
push:
branches:
- main
paths:
- 'src/**'
- 'tests/**'
- '.github/workflows/lint-and-type-check.yml'
pull_request:
branches:
- main
paths:
- 'src/**'
- 'tests/**'
- '.github/workflows/lint-and-type-check.yml'
workflow_dispatch:
defaults:
run:
shell: bash
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install pipx
run: python -m pip install pipx
- name: Install poetry
run: pipx install poetry
- name: Setup a local virtual environment
run: |
poetry config virtualenvs.create true --local
poetry config virtualenvs.in-project true --local
- uses: actions/cache@v4
name: Define a cache for the venv based on the dependencies lock file
with:
key: ubuntu-latest-3.12-${{ hashFiles('poetry.lock') }}
path: ./.venv
- name: Install the project dependencies
run: poetry install --all-extras
- name: Run mypy
run: poetry run mypy .
- name: Run ruff lint
run: poetry run ruff check .
- name: Run ruff format
run: poetry run ruff format --check .