name: CI on: push: branches: [ main, develop ] pull_request: branches: [ main, develop ] jobs: quality: name: Code Quality runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Install uv uses: astral-sh/setup-uv@v4 with: version: "latest" - name: Set up Python run: uv python install 3.12 - name: Install dependencies run: uv sync --all-extras - name: Check formatting with Black run: uv run black --check --diff . - name: Lint with Ruff run: uv run ruff check . - name: Type check with Ruff run: uv run ruff check --select=E9,F63,F7,F82 . test: name: Test runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] python-version: ["3.10", "3.11", "3.12", "3.13"] steps: - uses: actions/checkout@v4 - name: Install uv uses: astral-sh/setup-uv@v4 with: version: "latest" - name: Set up Python ${{ matrix.python-version }} run: uv python install ${{ matrix.python-version }} - name: Install dependencies run: uv sync --all-extras - name: Test imports run: | uv run python -c "from enhanced_mcp.mcp_server import run_server; print('✅ Imports work!')" uv run python -c "from enhanced_mcp import create_server, MCPToolServer; print('✅ Package imports work!')" - name: Test server starts shell: bash run: | if [[ "${{ runner.os }}" == "Windows" ]]; then timeout 5 uv run enhanced-mcp || echo "✅ Server started successfully" else timeout 5s uv run enhanced-mcp || echo "✅ Server started successfully" fi - name: Run tests run: uv run pytest tests/ -v --tb=short - name: Test build run: uv build - name: Test package installation run: | uv run pip install dist/*.whl --force-reinstall which enhanced-mcp || echo "enhanced-mcp not in PATH but package installed" coverage: name: Coverage runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Install uv uses: astral-sh/setup-uv@v4 with: version: "latest" - name: Set up Python run: uv python install 3.12 - name: Install dependencies run: uv sync --all-extras - name: Run tests with coverage run: uv run pytest tests/ --cov=enhanced_mcp --cov-report=xml --cov-report=term - name: Upload coverage to Codecov uses: codecov/codecov-action@v4 with: file: ./coverage.xml fail_ci_if_error: false