name: Browser tests on: # Called from CI workflow after build completes workflow_call: inputs: artifact-name: description: "Name of the build artifact to download" required: true type: string # Allow manual triggering (will build from scratch) workflow_dispatch: permissions: contents: read concurrency: group: browser-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: # Path rules: # - libs/sdk/** → all framework browser jobs (sdk output) # - libs/sdk-{react,angular,vue,svelte}/** → that package only # - edits to this workflow → full matrix # - workflow_dispatch → full matrix detect-changes: runs-on: ubuntu-latest outputs: sdk: ${{ steps.changes.outputs.sdk }} sdk-react: ${{ steps.changes.outputs.sdk-react }} sdk-angular: ${{ steps.changes.outputs.sdk-angular }} sdk-vue: ${{ steps.changes.outputs.sdk-vue }} sdk-svelte: ${{ steps.changes.outputs.sdk-svelte }} workflow: ${{ steps.changes.outputs.workflow }} steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3 id: changes with: filters: | sdk: - 'libs/sdk/**' - '!libs/sdk-*/**' sdk-react: - 'libs/sdk-react/**' sdk-angular: - 'libs/sdk-angular/**' sdk-vue: - 'libs/sdk-vue/**' sdk-svelte: - 'libs/sdk-svelte/**' workflow: - '.github/workflows/test-browser.yml' sdk-react: needs: detect-changes if: >- github.event_name == 'workflow_dispatch' || needs.detect-changes.outputs.workflow == 'true' || needs.detect-changes.outputs.sdk == 'true' || needs.detect-changes.outputs.sdk-react == 'true' runs-on: ubuntu-latest steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: ./.github/actions/setup-and-build with: artifact-name: ${{ inputs.artifact-name }} - name: Test sdk-react run: pnpm --filter @langchain/react run test sdk-python-server: needs: detect-changes if: >- github.event_name == 'workflow_dispatch' || needs.detect-changes.outputs.workflow == 'true' || needs.detect-changes.outputs.sdk == 'true' runs-on: ubuntu-latest timeout-minutes: 15 env: LANGGRAPH_SERVER_URL: http://127.0.0.1:2124 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: ./.github/actions/setup-and-build with: artifact-name: ${{ inputs.artifact-name }} - name: Start the Python dev server working-directory: libs/sdk/src/react/tests/python run: | python3 -m venv "$RUNNER_TEMP/venv" "$RUNNER_TEMP/venv/bin/pip" install --quiet "langgraph-cli[inmem]" \ langgraph-api==0.19.0.dev6 langgraph-runtime-inmem==0.39.0.dev6 deepagents "$RUNNER_TEMP/venv/bin/langgraph" dev --port 2124 --host 127.0.0.1 \ --no-browser --no-reload --n-jobs-per-worker 10 \ > "$RUNNER_TEMP/server.log" 2>&1 & for _ in $(seq 60); do curl -sf "$LANGGRAPH_SERVER_URL/ok" > /dev/null && exit 0 sleep 1 done exit 1 - name: Test the React hook against the Python dev server run: pnpm --filter @langchain/langgraph-sdk run test:browser - name: Server log if: failure() run: tail -n 200 "$RUNNER_TEMP/server.log" sdk-angular: needs: detect-changes if: >- github.event_name == 'workflow_dispatch' || needs.detect-changes.outputs.workflow == 'true' || needs.detect-changes.outputs.sdk == 'true' || needs.detect-changes.outputs.sdk-angular == 'true' runs-on: ubuntu-latest steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: ./.github/actions/setup-and-build with: artifact-name: ${{ inputs.artifact-name }} - name: Test sdk-angular run: pnpm --filter @langchain/angular run test sdk-vue: needs: detect-changes if: >- github.event_name == 'workflow_dispatch' || needs.detect-changes.outputs.workflow == 'true' || needs.detect-changes.outputs.sdk == 'true' || needs.detect-changes.outputs.sdk-vue == 'true' runs-on: ubuntu-latest steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: ./.github/actions/setup-and-build with: artifact-name: ${{ inputs.artifact-name }} - name: Test sdk-vue run: pnpm --filter @langchain/vue run test sdk-svelte: needs: detect-changes if: >- github.event_name == 'workflow_dispatch' || needs.detect-changes.outputs.workflow == 'true' || needs.detect-changes.outputs.sdk == 'true' || needs.detect-changes.outputs.sdk-svelte == 'true' runs-on: ubuntu-latest steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: ./.github/actions/setup-and-build with: artifact-name: ${{ inputs.artifact-name }} - name: Test sdk-svelte run: pnpm --filter @langchain/svelte run test