11name : MCP Tests
22
33on :
4- push :
5- branches :
64 pull_request :
75
86jobs :
119 # ##########################################################################
1210 local :
1311 runs-on : ubuntu-latest
14-
15- # Dummy key lets the clients authenticate against the local servers.
1612 env :
1713 API_KEY : ci-test-key
1814
2319 with :
2420 python-version : " 3.11"
2521
26- # Optional: cache wheels to speed up numpy / scipy installs
2722 - uses : actions/cache@v4
2823 with :
2924 path : ~/.cache/pip
@@ -33,47 +28,45 @@ jobs:
3328 run : |
3429 python -m pip install --upgrade pip
3530 pip install -r requirements.txt
36- pip install -r requirements-dev.txt
3731
3832 - name : Run pytest (local transports)
3933 run : pytest -q
4034
41-
4235 # ##########################################################################
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.
36+ # 2 - Remote smoke-test (skipped if ENV vars are missing)
5037 # ##########################################################################
5138 remote :
52- if : ${{ secrets.MCP_SERVER_URL != '' && secrets.API_KEY != '' }}
5339 runs-on : ubuntu-latest
54-
5540 env :
5641 MCP_SERVER_URL : ${{ secrets.MCP_SERVER_URL }}
57- API_KEY : ${{ secrets.API_KEY }}
42+ API_KEY : ${{ secrets.API_KEY }}
43+ SHOULD_RUN_REMOTE : ${{ secrets.MCP_SERVER_URL != '' && secrets.API_KEY != '' }}
5844
5945 steps :
46+ - name : Skip if secrets are missing
47+ if : env.SHOULD_RUN_REMOTE != 'true'
48+ run : echo "Skipping remote tests due to missing secrets."
49+
6050 - uses : actions/checkout@v4
51+ if : env.SHOULD_RUN_REMOTE == 'true'
6152
6253 - uses : actions/setup-python@v5
54+ if : env.SHOULD_RUN_REMOTE == 'true'
6355 with :
6456 python-version : " 3.11"
6557
6658 - uses : actions/cache@v4
59+ if : env.SHOULD_RUN_REMOTE == 'true'
6760 with :
6861 path : ~/.cache/pip
6962 key : ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }}
7063
7164 - name : Install dependencies
65+ if : env.SHOULD_RUN_REMOTE == 'true'
7266 run : |
7367 python -m pip install --upgrade pip
7468 pip install -r requirements.txt
7569
76- # We reuse the *same* test-suite; the fixture detects MCP_SERVER_URL
77- # and adds the “remote” parameter automatically.
7870 - name : Run pytest (remote smoke)
71+ if : env.SHOULD_RUN_REMOTE == 'true'
7972 run : pytest -q
0 commit comments