Skip to content

Commit

Permalink
fix: try running in background
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathannorris committed Sep 26, 2023
1 parent 21a9361 commit e5f8353
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions .github/workflows/cf-worker-example-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,21 @@ jobs:
run: yarn --immutable
- name: Setup .dev.vars file
run: echo "DEVCYCLE_SERVER_SDK_KEY=${{ secrets.DEVCYCLE_SERVER_SDK_KEY }}" > examples/js-cloud-server/cloudflare-worker/.dev.vars
- name: run example app
run: yarn nx serve example-js-cloud-server-sdk-cf-worker
- name: Run example app in background
run: |
yarn nx serve example-js-cloud-server-sdk-cf-worker &
echo "SERVER_PID=$!" >> $SERVER_PID
continue-on-error: true
- name: Wait for the server to be up
run: sleep 10
- name: Test server with curl
run: |
RESPONSE=$(curl -s http://localhost:8787) # Replace with your server's port
# Check the response or do something based on the result.
if [[ "$RESPONSE" != *"DevCycle Variables:"* ]]; then
echo "Server didn't return the expected 'DevCycle Variables:' response"
exit 1
fi
- name: Cleanup server
run: kill ${{ env.SERVER_PID }}

0 comments on commit e5f8353

Please sign in to comment.