|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main] |
| 6 | + pull_request: |
| 7 | + branches: [main] |
| 8 | + |
| 9 | +jobs: |
| 10 | + python-checks: |
| 11 | + name: Python Lint & Import Check |
| 12 | + runs-on: ubuntu-latest |
| 13 | + strategy: |
| 14 | + matrix: |
| 15 | + python-version: ["3.10", "3.11", "3.12"] |
| 16 | + |
| 17 | + steps: |
| 18 | + - uses: actions/checkout@v4 |
| 19 | + |
| 20 | + - name: Set up Python ${{ matrix.python-version }} |
| 21 | + uses: actions/setup-python@v5 |
| 22 | + with: |
| 23 | + python-version: ${{ matrix.python-version }} |
| 24 | + |
| 25 | + - name: Install dependencies |
| 26 | + run: | |
| 27 | + python -m pip install --upgrade pip |
| 28 | + pip install -r MCP/requirements.txt |
| 29 | + pip install ruff |
| 30 | +
|
| 31 | + - name: Lint with ruff |
| 32 | + run: | |
| 33 | + ruff check MCP/ --select=E,F,W --ignore=E501,F401 |
| 34 | +
|
| 35 | + - name: Check all tool modules import cleanly |
| 36 | + run: | |
| 37 | + cd MCP |
| 38 | + python -c " |
| 39 | + import importlib, sys, os |
| 40 | +
|
| 41 | + # Add MCP dir to path (tools use relative imports) |
| 42 | + sys.path.insert(0, os.getcwd()) |
| 43 | +
|
| 44 | + # Import bridge first (tools depend on it) |
| 45 | + import _bridge |
| 46 | +
|
| 47 | + # Import each tool module |
| 48 | + tools_dir = os.path.join(os.getcwd(), 'tools') |
| 49 | + for f in sorted(os.listdir(tools_dir)): |
| 50 | + if f.endswith('.py') and f != '__init__.py': |
| 51 | + mod_name = f'tools.{f[:-3]}' |
| 52 | + print(f' Importing {mod_name}...', end=' ') |
| 53 | + importlib.import_module(mod_name) |
| 54 | + print('OK') |
| 55 | +
|
| 56 | + print(f'\nAll {len([f for f in os.listdir(tools_dir) if f.endswith(\".py\") and f != \"__init__.py\"])} tool modules imported successfully.') |
| 57 | + " |
| 58 | +
|
| 59 | + - name: Verify plugin descriptor is valid JSON |
| 60 | + run: | |
| 61 | + python -c " |
| 62 | + import json |
| 63 | + with open('UnrealMCP.uplugin') as f: |
| 64 | + data = json.load(f) |
| 65 | + assert 'Modules' in data, 'Missing Modules key' |
| 66 | + assert 'FriendlyName' in data, 'Missing FriendlyName key' |
| 67 | + print('Plugin descriptor is valid.') |
| 68 | + " |
0 commit comments