Skip to content

fix: js-sdk was improperly setting isIntialized to true even for situations where the SDK token was invalid #1651

fix: js-sdk was improperly setting isIntialized to true even for situations where the SDK token was invalid

fix: js-sdk was improperly setting isIntialized to true even for situations where the SDK token was invalid #1651

name: Run CF Worker Example App
on:
pull_request:
branches: [main]
jobs:
build:
runs-on:
labels: ubuntu-latest-4-core
strategy:
matrix:
node-version: [20.x]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- name: Run Yarn
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 in background
run: |
yarn nx serve example-js-cloud-server-sdk-cf-worker &
echo "SERVER_PID=$!" >> $GITHUB_ENV
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 }}