name: MCP Validator CI

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

jobs:
  test:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version: ['3.11', '3.12']

    steps:
    - uses: actions/checkout@v3
    
    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v4
      with:
        python-version: ${{ matrix.python-version }}
    
    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
        pip install pytest
    
    - name: Run tests
      run: |
        pytest
    
    - name: Run minimal server compliance tests
      run: |
        python -m mcp_testing.scripts.compliance_report \
          --server-command "./minimal_mcp_server/minimal_mcp_server.py" \
          --protocol-version 2025-03-26 \
          --output-dir "./reports" \
          --report-prefix "ci_minimal_"
    
    - name: Upload test reports
      uses: actions/upload-artifact@v4
      if: always()
      with:
        name: test-reports-${{ matrix.python-version }}
        path: ./reports/ 