name: Test MCP Server
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v4
- 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
pip install -r requirements.txt
- name: Run tests
run: |
python test.py
- name: Test server import
run: |
python -c "import server; print('Server imports successfully')"
- name: Check code style (Python 3.11+ only)
if: matrix.python-version >= '3.11'
run: |
pip install black flake8
black --check --diff server.py
flake8 server.py --max-line-length=88 --extend-ignore=E203,W503