nanochat/.github/workflows/pre-commit.yml
Eyal Frishman 59ed9392ed Add pre-commit documentation to README and GitHub workflow
Sets up a pre-commit workflow to automate code linting and formatting.

This ensures code quality and consistency by running checks before code is committed.
2025-12-05 19:59:38 +02:00

45 lines
915 B
YAML

name: Pre-commit
on:
push:
branches:
- main
- "release/**"
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
run-pre-commit:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Cache uv & pre-commit
uses: actions/cache@v4
with:
path: |
.venv
~/.cache/uv
~/.cache/pre-commit
key: ${{ runner.os }}-uv-${{ hashFiles('uv.lock', '.pre-commit-config.yaml') }}
restore-keys: |
${{ runner.os }}-uv-
- name: Install dev dependencies
run: uv sync --group dev
- name: Run pre-commit
run: uv run pre-commit run --all-files