Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/benchmark-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Benchmark Tests (LangChain)

on:
push:
branches: ["main"]
pull_request:
# Only run when LangChain, LangChain Core, or LangChain Classic code changes.
paths:
- "libs/langchain/**"
- "libs/langchain-core/**"
workflow_dispatch: # Allows triggering the workflow manually in GitHub UI

# If another push to the same PR or branch happens while this workflow is still running,
# cancel the earlier run in favor of the next run.
#
# There's no point in testing an outdated version of the code. GitHub only allows
# a limited number of job runners to be active at the same time, so it's better to cancel
# pointless jobs early so that more useful jobs can run sooner.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
benchmark-tests:
name: Benchmark Tests
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
- name: Setup pnpm
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
- name: Use Node.js
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6
with:
node-version-file: ".nvmrc"
cache: "pnpm"
- name: Install dependencies
run: pnpm install --frozen-lockfile
# Running `test:unit:ci` from root will build first, however debugging
# in CI is easier if we separate the build step from the test step.
- name: Build LangChain
run: pnpm build --filter langchain
- name: Test
run: pnpm run test:bench --filter langchain
4 changes: 3 additions & 1 deletion libs/langchain/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"clean": "rm -rf .turbo dist/",
"test": "vitest run",
"test:watch": "vitest --watch",
"test:bench": "vitest --mode bench --run",
"test:integration": "vitest --mode int",
"format": "prettier --config .prettierrc --write \"src\"",
"format:check": "prettier --config .prettierrc --check \"src\""
Expand All @@ -68,6 +69,7 @@
"reflect-metadata": "^0.2.2",
"rimraf": "^5.0.1",
"rollup": "^3.19.1",
"tinybench": "^5.1.0",
"typeorm": "^0.3.26",
"typescript": "~5.8.3",
"vitest": "^3.2.4",
Expand Down Expand Up @@ -205,4 +207,4 @@
"./package.json": "./package.json"
},
"module": "./dist/index.js"
}
}
Loading
Loading