release(py): 0.4.39 #5602
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Integration Tests CI | |
| permissions: | |
| contents: read | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| types: [opened, synchronize, reopened, labeled, unlabeled] | |
| workflow_dispatch: | |
| inputs: | |
| run-python-tests: | |
| description: "Run Python integration tests" | |
| default: "true" | |
| required: false | |
| run-js-tests: | |
| description: "Run JS integration tests" | |
| default: "true" | |
| required: false | |
| jobs: | |
| changed_files: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| python_changed: ${{ steps.check-changes.outputs.python_changed }} | |
| js_changed: ${{ steps.check-changes.outputs.js_changed }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Required for diff with main branch | |
| - name: Check for file changes | |
| id: check-changes | |
| run: | | |
| if git diff --name-only origin/main HEAD | grep -E "^python/.*\.py$"; then | |
| echo "python_changed=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "python_changed=false" >> $GITHUB_OUTPUT | |
| fi | |
| if git diff --name-only origin/main HEAD | grep -E "^js/.*\.(js|ts|jsx|tsx)$"; then | |
| echo "js_changed=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "js_changed=false" >> $GITHUB_OUTPUT | |
| fi | |
| python_integration_test: | |
| name: Python ${{ matrix.test-type }} Test | |
| needs: changed_files | |
| if: > | |
| (github.event_name == 'push') || | |
| (github.event_name == 'pull_request' && ( | |
| contains(github.event.pull_request.labels.*.name, 'release') || | |
| needs.changed_files.outputs.python_changed == 'true' | |
| )) || | |
| (github.event_name == 'workflow_dispatch' && github.event.inputs.run-python-tests == 'true') | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| test-type: [integration, doctest, evals] | |
| defaults: | |
| run: | |
| working-directory: python | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Run Python ${{ matrix.test-type }} | |
| uses: ./.github/actions/python-integration-tests | |
| with: | |
| python-version: 3.11 | |
| langchain-api-key-beta: ${{ secrets.LANGSMITH_API_KEY_BETA }} | |
| langchain-api-key-prod: ${{ secrets.LANGSMITH_API_KEY_PROD }} | |
| openai-api-key: ${{ secrets.OPENAI_API_KEY }} | |
| anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }} | |
| test-type: ${{ matrix.test-type }} | |
| js_integration_test: | |
| name: JS Integration Test | |
| needs: changed_files | |
| if: > | |
| (github.event_name == 'push') || | |
| (github.event_name == 'pull_request' && ( | |
| contains(github.event.pull_request.labels.*.name, 'release') || | |
| needs.changed_files.outputs.js_changed == 'true' | |
| )) || | |
| (github.event_name == 'workflow_dispatch' && github.event.inputs.run-js-tests == 'true') | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: js | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Use Node.js 20.x | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: 20.x | |
| cache: "yarn" | |
| cache-dependency-path: "js/yarn.lock" | |
| - name: Install dependencies | |
| run: yarn install --immutable | |
| - name: Run JS integration tests | |
| uses: ./.github/actions/js-integration-tests | |
| with: | |
| node-version: 20.x | |
| langchain-api-key-beta: ${{ secrets.LANGSMITH_API_KEY_BETA }} | |
| openai-api-key: ${{ secrets.OPENAI_API_KEY }} | |
| js_vitest_eval_runner_test: | |
| name: JS Vitest Runner Test | |
| needs: changed_files | |
| if: > | |
| (github.event_name == 'push') || | |
| (github.event_name == 'pull_request' && ( | |
| contains(github.event.pull_request.labels.*.name, 'release') || | |
| needs.changed_files.outputs.js_changed == 'true' | |
| )) || | |
| (github.event_name == 'workflow_dispatch' && github.event.inputs.run-js-tests == 'true') | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: js | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Use Node.js 20.x | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: 20.x | |
| cache: "yarn" | |
| cache-dependency-path: "js/yarn.lock" | |
| - name: Install dependencies | |
| run: yarn install --immutable | |
| - name: Run JS Vitest eval runner test | |
| uses: ./.github/actions/js-vitest-eval-test | |
| with: | |
| node-version: 20.x | |
| langchain-api-key-beta: ${{ secrets.LANGSMITH_API_KEY_BETA }} | |
| openai-api-key: ${{ secrets.OPENAI_API_KEY }} | |
| bun-test: | |
| name: Bun Integration Tests | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: "js" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Run Bun tests | |
| run: bun test ./src/tests/bun/traceable.test.bun.ts | |
| env: | |
| LANGSMITH_TRACING: "true" | |
| LANGSMITH_ENDPOINT: https://beta.api.smith.langchain.com | |
| LANGSMITH_API_KEY: ${{ secrets.LANGSMITH_API_KEY_BETA }} |