Merge pull request #211 from pfahlr/main #127
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: MCP Conformance | |
| on: | |
| push: | |
| branches: ["**"] | |
| pull_request: | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install -U pip | |
| if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
| if command -v nvidia-smi >/dev/null 2>&1; then | |
| GPU_COUNT=$(nvidia-smi --query-gpu=name --format=csv,noheader | wc -l) | |
| else | |
| GPU_COUNT=0 | |
| fi | |
| if [ "$GPU_COUNT" -gt 0 ]; then | |
| pip install -r requirements-faiss-gpu.txt | |
| else | |
| pip install -r requirements-faiss-cpu.txt | |
| fi | |
| if [ -f requirements-test.txt ]; then pip install -r requirements-test.txt; fi | |
| - name: Start MCP server | |
| run: | | |
| uvicorn src.tool.mcp_app:app --port 3333 > server.log 2>&1 & | |
| sleep 3 | |
| - name: Run tests | |
| run: pytest -q | |
| - name: Print server logs on failure | |
| if: failure() | |
| run: cat server.log |