|
| 1 | +name: MCP Tests |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main] |
| 6 | + pull_request: |
| 7 | + |
| 8 | +jobs: |
| 9 | + ########################################################################### |
| 10 | + # 1 - Local integration tests (always run) |
| 11 | + ########################################################################### |
| 12 | + local: |
| 13 | + runs-on: ubuntu-latest |
| 14 | + |
| 15 | + # Dummy key lets the clients authenticate against the local servers. |
| 16 | + env: |
| 17 | + API_KEY: ci-test-key |
| 18 | + |
| 19 | + steps: |
| 20 | + - uses: actions/checkout@v4 |
| 21 | + |
| 22 | + - uses: actions/setup-python@v5 |
| 23 | + with: |
| 24 | + python-version: "3.11" |
| 25 | + |
| 26 | + # Optional: cache wheels to speed up numpy / scipy installs |
| 27 | + - uses: actions/cache@v4 |
| 28 | + with: |
| 29 | + path: ~/.cache/pip |
| 30 | + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }} |
| 31 | + |
| 32 | + - name: Install dependencies |
| 33 | + run: | |
| 34 | + python -m pip install --upgrade pip |
| 35 | + pip install -r requirements.txt |
| 36 | + pip install -r requirements-dev.txt |
| 37 | +
|
| 38 | + - name: Run pytest (local transports) |
| 39 | + run: pytest -q |
| 40 | + |
| 41 | + |
| 42 | + ########################################################################### |
| 43 | + # 2 - Remote smoke-test (only when secrets are set) |
| 44 | + # |
| 45 | + # • Put MCP_SERVER_URL → “https://<app>.herokuapp.com” |
| 46 | + # • Put API_KEY → same key you set as Heroku config var |
| 47 | + # |
| 48 | + # The fixture auto-skips the remote case if these are missing, so |
| 49 | + # the job is conditionally *created* only when both secrets exist. |
| 50 | + ########################################################################### |
| 51 | + remote: |
| 52 | + if: ${{ secrets.MCP_SERVER_URL != '' && secrets.API_KEY != '' }} |
| 53 | + runs-on: ubuntu-latest |
| 54 | + |
| 55 | + env: |
| 56 | + MCP_SERVER_URL: ${{ secrets.MCP_SERVER_URL }} |
| 57 | + API_KEY: ${{ secrets.API_KEY }} |
| 58 | + |
| 59 | + steps: |
| 60 | + - uses: actions/checkout@v4 |
| 61 | + |
| 62 | + - uses: actions/setup-python@v5 |
| 63 | + with: |
| 64 | + python-version: "3.11" |
| 65 | + |
| 66 | + - uses: actions/cache@v4 |
| 67 | + with: |
| 68 | + path: ~/.cache/pip |
| 69 | + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }} |
| 70 | + |
| 71 | + - name: Install dependencies |
| 72 | + run: | |
| 73 | + python -m pip install --upgrade pip |
| 74 | + pip install -r requirements.txt |
| 75 | +
|
| 76 | + # We reuse the *same* test-suite; the fixture detects MCP_SERVER_URL |
| 77 | + # and adds the “remote” parameter automatically. |
| 78 | + - name: Run pytest (remote smoke) |
| 79 | + run: pytest -q |
0 commit comments