Improved github CI #13
Workflow file for this run
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 Tests | |
| on: | |
| pull_request: | |
| jobs: | |
| ########################################################################### | |
| # 1 - Local integration tests (always run) | |
| ########################################################################### | |
| local: | |
| runs-on: ubuntu-latest | |
| # Dummy key lets the clients authenticate against the local servers. | |
| env: | |
| API_KEY: ci-test-key | |
| steps: | |
| # Optional: cache wheels to speed up numpy / scipy installs | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Run pytest (local transports) | |
| run: pytest -q | |
| ########################################################################### | |
| # 2 - Remote smoke-test (skipped if ENV vars are missing) | |
| # | |
| # • Put MCP_SERVER_URL → “https://<app>.herokuapp.com” | |
| # • Put API_KEY → same key you set as Heroku config var | |
| # | |
| # The fixture auto-skips the remote case if these are missing, so | |
| ########################################################################### | |
| remote: | |
| runs-on: ubuntu-latest | |
| env: | |
| MCP_SERVER_URL: ${{ secrets.MCP_SERVER_URL }} | |
| API_KEY: ${{ secrets.API_KEY }} | |
| SHOULD_RUN_REMOTE: ${{ secrets.MCP_SERVER_URL != '' && secrets.API_KEY != '' }} | |
| steps: | |
| - name: Skip if secrets are missing | |
| if: env.SHOULD_RUN_REMOTE != 'true' | |
| run: echo "Skipping remote tests due to missing secrets." | |
| - uses: actions/checkout@v4 | |
| if: env.SHOULD_RUN_REMOTE == 'true' | |
| - uses: actions/setup-python@v5 | |
| if: env.SHOULD_RUN_REMOTE == 'true' | |
| with: | |
| python-version: "3.11" | |
| - uses: actions/cache@v4 | |
| if: env.SHOULD_RUN_REMOTE == 'true' | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }} | |
| - name: Install dependencies | |
| if: env.SHOULD_RUN_REMOTE == 'true' | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| # We reuse the *same* test-suite; the fixture detects MCP_SERVER_URL | |
| - name: Run pytest (remote smoke) | |
| if: env.SHOULD_RUN_REMOTE == 'true' | |
| run: pytest -q |