
- Add GitHub Actions CI/CD workflow with multi-OS testing (Ubuntu, macOS) - Add pyproject.toml for modern Python packaging with hatchling - Add pre-commit hooks for code quality (ruff, mypy, trailing whitespace) - Add Makefile for common development tasks (install, test, lint, format, build) - Add run_tests.py script for comprehensive test execution - Update requirements.txt with development dependencies - Update .gitignore for modern Python tooling (uv, ruff, pytest) - Add KiCad-specific ignore patterns for backup files This establishes a robust development workflow with: - Automated testing on Python 3.10, 3.11, 3.12 - Code formatting and linting with ruff - Type checking with mypy - Coverage reporting with pytest-cov - Package building with uv 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
98 lines
2.1 KiB
YAML
98 lines
2.1 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [ main, develop ]
|
|
pull_request:
|
|
branches: [ main, develop ]
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
name: Lint and Format
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@v4
|
|
with:
|
|
enable-cache: true
|
|
|
|
- name: Set up Python 3.12
|
|
run: |
|
|
uv python install 3.12
|
|
uv python pin 3.12
|
|
|
|
- name: Install dependencies
|
|
run: uv sync --group dev
|
|
|
|
- name: Lint with ruff
|
|
run: uv run ruff check kicad_mcp/ tests/
|
|
|
|
- name: Check formatting with ruff
|
|
run: uv run ruff format --check kicad_mcp/ tests/
|
|
|
|
test:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest]
|
|
python-version: ["3.10", "3.11", "3.12"]
|
|
|
|
name: Test Python ${{ matrix.python-version }} on ${{ matrix.os }}
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@v4
|
|
with:
|
|
enable-cache: true
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
run: |
|
|
uv python install ${{ matrix.python-version }}
|
|
uv python pin ${{ matrix.python-version }}
|
|
|
|
- name: Install dependencies
|
|
run: uv sync --group dev
|
|
|
|
- name: Run tests
|
|
run: uv run python -m pytest tests/ -v --cov=kicad_mcp --cov-report=xml --cov-fail-under=30
|
|
|
|
- name: Upload coverage to Codecov
|
|
uses: codecov/codecov-action@v4
|
|
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
|
|
with:
|
|
file: ./coverage.xml
|
|
fail_ci_if_error: false
|
|
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
name: Build Package
|
|
needs: [lint, test]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@v4
|
|
with:
|
|
enable-cache: true
|
|
|
|
- name: Set up Python 3.12
|
|
run: |
|
|
uv python install 3.12
|
|
uv python pin 3.12
|
|
|
|
- name: Build package
|
|
run: uv build
|
|
|
|
- name: Upload artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: dist
|
|
path: dist/
|