@@ -51,111 +51,112 @@ jobs:
51
51
# ##########################################################################
52
52
# 2 - Deploy this PR to a temp Heroku app and run tests against deployed app (in addition to 'local')
53
53
# ##########################################################################
54
- remote :
55
- if : false # These e2d depployment tests are super useful, but require you to add a HEROKU_API_KEY to your repo's actions secrets.
56
- runs-on : ubuntu-latest
57
- env :
58
- HEROKU_API_KEY : ${{ secrets.HEROKU_API_KEY }}
59
- API_KEY : ci-test-key
60
- # also note that github CI doesn't have access to your app's config vars, so here we're setting the remote
61
- # server type to streamable HTTP. Folks using SSE would need to change this line for their e2e remote integration
62
- # tests to test SSE instead of streamable HTTP.
63
- REMOTE_SERVER_TRANSPORT_MODULE : streamable_http_server
64
- # $APP_NAME is set below because we need to shorten the repo owner's name, as a precaution
65
-
66
- steps :
67
- - uses : actions/checkout@v4
68
- with :
69
- fetch-depth : 0 # <-- disables shallow clone, which heroku is upset by when running git push heroku later on
70
-
71
- # Setting a short $APP_NAME that will be unique even if folks choose to fork this repo --> avoids clashes.
72
- # Needs to be shortened if the github repo owner has a long name (max 30 char app name heroku limit).
73
- - name : Generate short APP_NAME
74
- id : appname
75
- run : |
76
- OWNER_SHORT=${GITHUB_REPOSITORY_OWNER:0:5}
77
- REPO_NAME=$(basename "$GITHUB_REPOSITORY")
78
- PR_NUMBER=$(jq .number "$GITHUB_EVENT_PATH")
79
- APP_NAME="${OWNER_SHORT}-${REPO_NAME}-${PR_NUMBER}"
80
- echo "APP_NAME=$APP_NAME"
81
- echo "APP_NAME=$APP_NAME" >> $GITHUB_ENV
82
-
83
- - name : Read Python version from .python-version
84
- id : python-version
85
- run : |
86
- PY_VERSION=$(cat .python-version)
87
- echo "version=$PY_VERSION" >> $GITHUB_OUTPUT
88
-
89
- - uses : actions/setup-python@v5
90
- with :
91
- python-version : ${{ steps.python-version.outputs.version }}
92
-
93
- - name : Read Node.js version from package.json
94
- id : node-version
95
- run : |
96
- NODE_VERSION=$(jq -r '.engines.node' package.json)
97
- echo "version=$NODE_VERSION" >> $GITHUB_OUTPUT
98
-
99
- - uses : actions/setup-node@v4
100
- with :
101
- node-version : ${{ steps.node-version.outputs.version }}
102
-
103
- - name : Install Heroku CLI
104
- run : |
105
- curl https://cli-assets.heroku.com/install.sh | sh
106
-
107
- - name : Log in to Heroku
108
- run : |
109
- echo "$HEROKU_API_KEY" | heroku auth:token
110
-
111
- - name : Pre-cleanup (destroy app if it exists)
112
- continue-on-error : true
113
- run : |
114
- heroku apps:destroy --app $APP_NAME --confirm $APP_NAME
115
-
116
- # github CI can't use our app.json, so the config etc bits must be set manually.
117
- # note WEB_CONCURRENCY is important! You get non-deterministic errors w/out it.
118
- - name : Create temp Heroku app for this PR
119
- run : |
120
- heroku create $APP_NAME
121
- heroku buildpacks:add --index 1 heroku/nodejs -a $APP_NAME
122
- heroku buildpacks:add --index 2 heroku/python -a $APP_NAME
123
- heroku config:set API_KEY=$API_KEY --app $APP_NAME
124
- heroku config:set STDIO_MODE_ONLY=false
125
- heroku config:set REMOTE_SERVER_TRANSPORT_MODULE=$REMOTE_SERVER_TRANSPORT_MODULE --app $APP_NAME
126
- heroku config:set WEB_CONCURRENCY=1 --app $APP_NAME
127
-
128
- - name : Deploy this branch to Heroku
129
- run : |
130
- git push https://heroku:[email protected] /$APP_NAME.git HEAD:refs/heads/main --force
131
-
132
- - uses : actions/cache@v4
133
- with :
134
- path : ~/.cache/pip
135
- key : ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }}
136
-
137
- - name : Install test dependencies
138
- run : |
139
- python -m pip install --upgrade pip
140
- pip install -r requirements.txt
141
-
142
- - name : Get Heroku env vars
143
- id : heroku_env
144
- run : |
145
- url=$(heroku info -s -a $APP_NAME | grep web_url | cut -d= -f2 | tr -d '\n')
146
- echo "url=$url" >> "$GITHUB_OUTPUT"
147
-
148
- - name : Run pytest against deployed app
149
- env :
150
- MCP_SERVER_URL : ${{ steps.heroku_env.outputs.url }}
151
- run : |
152
- echo "APP_NAME = $APP_NAME"
153
- echo "MCP_SERVER_URL = $MCP_SERVER_URL"
154
- echo "REMOTE_SERVER_TRANSPORT_MODULE = $REMOTE_SERVER_TRANSPORT_MODULE"
155
- echo "API_KEY is ${API_KEY:+set}" # won't print the key, just confirms it's non-empty
156
- pytest -q
157
-
158
- - name : Destroy Heroku app after test
159
- if : always()
160
- run : |
161
- heroku apps:destroy --app $APP_NAME --confirm $APP_NAME
54
+ # # These e2d deployment tests are super useful, but require you to add a HEROKU_API_KEY to your repo's actions secrets.
55
+ # # --> Uncomment after adding HEROKU_API_KEY to your forked repo's github action secrets.
56
+ # remote:
57
+ # runs-on: ubuntu-latest
58
+ # env:
59
+ # HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
60
+ # API_KEY: ci-test-key
61
+ # # also note that github CI doesn't have access to your app's config vars, so here we're setting the remote
62
+ # # server type to streamable HTTP. Folks using SSE would need to change this line for their e2e remote integration
63
+ # # tests to test SSE instead of streamable HTTP.
64
+ # REMOTE_SERVER_TRANSPORT_MODULE: streamable_http_server
65
+ # # $APP_NAME is set below because we need to shorten the repo owner's name, as a precaution
66
+
67
+ # steps:
68
+ # - uses: actions/checkout@v4
69
+ # with:
70
+ # fetch-depth: 0 # <-- disables shallow clone, which heroku is upset by when running git push heroku later on
71
+
72
+ # # Setting a short $APP_NAME that will be unique even if folks choose to fork this repo --> avoids clashes.
73
+ # # Needs to be shortened if the github repo owner has a long name (max 30 char app name heroku limit).
74
+ # - name: Generate short APP_NAME
75
+ # id: appname
76
+ # run: |
77
+ # OWNER_SHORT=${GITHUB_REPOSITORY_OWNER:0:5}
78
+ # REPO_NAME=$(basename "$GITHUB_REPOSITORY")
79
+ # PR_NUMBER=$(jq .number "$GITHUB_EVENT_PATH")
80
+ # APP_NAME="${OWNER_SHORT}-${REPO_NAME}-${PR_NUMBER}"
81
+ # echo "APP_NAME=$APP_NAME"
82
+ # echo "APP_NAME=$APP_NAME" >> $GITHUB_ENV
83
+
84
+ # - name: Read Python version from .python-version
85
+ # id: python-version
86
+ # run: |
87
+ # PY_VERSION=$(cat .python-version)
88
+ # echo "version=$PY_VERSION" >> $GITHUB_OUTPUT
89
+
90
+ # - uses: actions/setup-python@v5
91
+ # with:
92
+ # python-version: ${{ steps.python-version.outputs.version }}
93
+
94
+ # - name: Read Node.js version from package.json
95
+ # id: node-version
96
+ # run: |
97
+ # NODE_VERSION=$(jq -r '.engines.node' package.json)
98
+ # echo "version=$NODE_VERSION" >> $GITHUB_OUTPUT
99
+
100
+ # - uses: actions/setup-node@v4
101
+ # with:
102
+ # node-version: ${{ steps.node-version.outputs.version }}
103
+
104
+ # - name: Install Heroku CLI
105
+ # run: |
106
+ # curl https://cli-assets.heroku.com/install.sh | sh
107
+
108
+ # - name: Log in to Heroku
109
+ # run: |
110
+ # echo "$HEROKU_API_KEY" | heroku auth:token
111
+
112
+ # - name: Pre-cleanup (destroy app if it exists)
113
+ # continue-on-error: true
114
+ # run: |
115
+ # heroku apps:destroy --app $APP_NAME --confirm $APP_NAME
116
+
117
+ # # github CI can't use our app.json, so the config etc bits must be set manually.
118
+ # # note WEB_CONCURRENCY is important! You get non-deterministic errors w/out it.
119
+ # - name: Create temp Heroku app for this PR
120
+ # run: |
121
+ # heroku create $APP_NAME
122
+ # heroku buildpacks:add --index 1 heroku/nodejs -a $APP_NAME
123
+ # heroku buildpacks:add --index 2 heroku/python -a $APP_NAME
124
+ # heroku config:set API_KEY=$API_KEY --app $APP_NAME
125
+ # heroku config:set STDIO_MODE_ONLY=false
126
+ # heroku config:set REMOTE_SERVER_TRANSPORT_MODULE=$REMOTE_SERVER_TRANSPORT_MODULE --app $APP_NAME
127
+ # heroku config:set WEB_CONCURRENCY=1 --app $APP_NAME
128
+
129
+ # - name: Deploy this branch to Heroku
130
+ # run: |
131
+ # git push https://heroku:[email protected] /$APP_NAME.git HEAD:refs/heads/main --force
132
+
133
+ # - uses: actions/cache@v4
134
+ # with:
135
+ # path: ~/.cache/pip
136
+ # key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }}
137
+
138
+ # - name: Install test dependencies
139
+ # run: |
140
+ # python -m pip install --upgrade pip
141
+ # pip install -r requirements.txt
142
+
143
+ # - name: Get Heroku env vars
144
+ # id: heroku_env
145
+ # run: |
146
+ # url=$(heroku info -s -a $APP_NAME | grep web_url | cut -d= -f2 | tr -d '\n')
147
+ # echo "url=$url" >> "$GITHUB_OUTPUT"
148
+
149
+ # - name: Run pytest against deployed app
150
+ # env:
151
+ # MCP_SERVER_URL: ${{ steps.heroku_env.outputs.url }}
152
+ # run: |
153
+ # echo "APP_NAME = $APP_NAME"
154
+ # echo "MCP_SERVER_URL = $MCP_SERVER_URL"
155
+ # echo "REMOTE_SERVER_TRANSPORT_MODULE = $REMOTE_SERVER_TRANSPORT_MODULE"
156
+ # echo "API_KEY is ${API_KEY:+set}" # won't print the key, just confirms it's non-empty
157
+ # pytest -q
158
+
159
+ # - name: Destroy Heroku app after test
160
+ # if: always()
161
+ # run: |
162
+ # heroku apps:destroy --app $APP_NAME --confirm $APP_NAME
0 commit comments