Skip to content

chore: add pre-commit hooks, pytest/coverage config, and CI workflow #8

chore: add pre-commit hooks, pytest/coverage config, and CI workflow

chore: add pre-commit hooks, pytest/coverage config, and CI workflow #8

Workflow file for this run

name: CI
"on":
push:
branches: [main]
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
name: Lint (pre-commit, Python 3.11)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: Set up Python 3.11
run: uv python install 3.11
- name: Install dependencies
run: uv sync --all-extras --dev --python 3.11
- name: Run pre-commit
run: uv run pre-commit run --all-files
env:
SKIP: mypy
typecheck:
name: Mypy (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Install dependencies
run: uv sync --all-extras --dev --python ${{ matrix.python-version }}
- name: Run mypy
run: uv run mypy src tests
build-test:
name: >-
Test (Python ${{ matrix.python-version }},
${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12", "3.13"]
os: [ubuntu-latest]
include:
- python-version: "3.13"
os: macos-latest
- python-version: "3.13"
os: windows-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Install dependencies
run: uv sync --all-extras --dev --python ${{ matrix.python-version }}
- name: Run tests with coverage
run: uv run pytest --cov=flake8_inheritance --cov-report=term-missing