name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 isort black
- name: Check formatting with black
run: black --check --line-length=120 src/openapi_mcp
- name: Check import sorting with isort
run: isort --check-only --profile=black --line-length=120 src/openapi_mcp
- name: Lint with flake8
run: flake8 src/openapi_mcp --max-line-length=120 --ignore=E501,W503,E203
type-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install mypy types-PyYAML types-requests
pip install -e .
- name: Type check with mypy
run: mypy src/openapi_mcp --ignore-missing-imports
continue-on-error: true # Don't fail CI on type errors initially
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install bandit[toml]
- name: Security check with bandit
run: bandit -r src/openapi_mcp -c pyproject.toml
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: Run tests
run: |
PYTHONPATH=src pytest test/ -v --tb=short
build:
runs-on: ubuntu-latest
needs: [lint, security, test]
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install build tools
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Check package
run: |
pip install twine
twine check dist/*