Skip to content

Commit 0219d62

Browse files
klagridaclaude
andcommitted
ci: add verification for posts Edge Functions
- Add checks for posts-create and posts-update endpoints in CI - Verify functions are accessible before running E2E tests - Log response codes to help debug Edge Function availability 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent b64450b commit 0219d62

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,35 @@ jobs:
185185
fi
186186
done
187187
188+
echo ""
189+
echo "Verifying posts Edge Functions..."
190+
191+
# Test posts-create function
192+
POSTS_CREATE_RESPONSE=$(curl -s -w "\nHTTP_CODE:%{http_code}" -X POST http://127.0.0.1:54321/functions/v1/posts-create \
193+
-H "Content-Type: application/json" \
194+
-d '{}' 2>&1)
195+
POSTS_CREATE_CODE=$(echo "$POSTS_CREATE_RESPONSE" | tail -n 1 | cut -d: -f2)
196+
197+
if [ "$POSTS_CREATE_CODE" == "401" ] || [ "$POSTS_CREATE_CODE" == "400" ]; then
198+
echo "✅ posts-create function is accessible (HTTP $POSTS_CREATE_CODE)"
199+
else
200+
echo "⚠️ posts-create function returned unexpected code: $POSTS_CREATE_CODE"
201+
echo "$POSTS_CREATE_RESPONSE" | head -n -1
202+
fi
203+
204+
# Test posts-update function
205+
POSTS_UPDATE_RESPONSE=$(curl -s -w "\nHTTP_CODE:%{http_code}" -X POST http://127.0.0.1:54321/functions/v1/posts-update \
206+
-H "Content-Type: application/json" \
207+
-d '{}' 2>&1)
208+
POSTS_UPDATE_CODE=$(echo "$POSTS_UPDATE_RESPONSE" | tail -n 1 | cut -d: -f2)
209+
210+
if [ "$POSTS_UPDATE_CODE" == "401" ] || [ "$POSTS_UPDATE_CODE" == "400" ]; then
211+
echo "✅ posts-update function is accessible (HTTP $POSTS_UPDATE_CODE)"
212+
else
213+
echo "⚠️ posts-update function returned unexpected code: $POSTS_UPDATE_CODE"
214+
echo "$POSTS_UPDATE_RESPONSE" | head -n -1
215+
fi
216+
188217
- name: Test Edge Functions
189218
shell: bash
190219
run: |

0 commit comments

Comments
 (0)