Skip to content

Commit e5f8353

Browse files
fix: try running in background
1 parent 21a9361 commit e5f8353

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

.github/workflows/cf-worker-example-test.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,21 @@ jobs:
2626
run: yarn --immutable
2727
- name: Setup .dev.vars file
2828
run: echo "DEVCYCLE_SERVER_SDK_KEY=${{ secrets.DEVCYCLE_SERVER_SDK_KEY }}" > examples/js-cloud-server/cloudflare-worker/.dev.vars
29-
- name: run example app
30-
run: yarn nx serve example-js-cloud-server-sdk-cf-worker
29+
- name: Run example app in background
30+
run: |
31+
yarn nx serve example-js-cloud-server-sdk-cf-worker &
32+
echo "SERVER_PID=$!" >> $SERVER_PID
33+
continue-on-error: true
34+
- name: Wait for the server to be up
35+
run: sleep 10
36+
- name: Test server with curl
37+
run: |
38+
RESPONSE=$(curl -s http://localhost:8787) # Replace with your server's port
39+
# Check the response or do something based on the result.
40+
if [[ "$RESPONSE" != *"DevCycle Variables:"* ]]; then
41+
echo "Server didn't return the expected 'DevCycle Variables:' response"
42+
exit 1
43+
fi
44+
- name: Cleanup server
45+
run: kill ${{ env.SERVER_PID }}
3146

0 commit comments

Comments
 (0)