Skip to content

Commit

Permalink
update standard tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bracesproul committed Jun 4, 2024
1 parent ca50201 commit 74da454
Showing 1 changed file with 14 additions and 55 deletions.
69 changes: 14 additions & 55 deletions .github/workflows/standard-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,6 @@ on:
- cron: '0 13 * * *'

jobs:
install-dependencies:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Cache Yarn packages
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install --immutable --mode=skip-build
- name: Upload node_modules artifact
uses: actions/upload-artifact@v3
with:
name: node_modules
path: node_modules

tests:
needs: install-dependencies
runs-on: ubuntu-latest
Expand All @@ -41,11 +18,9 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Download cached node_modules
uses: actions/download-artifact@v3
with:
name: node_modules
path: node_modules
cache: "yarn"
- name: Install dependencies
run: yarn install --immutable --mode=skip-build
- name: Run standard tests (integration) for ${{ matrix.package }}
run: yarn test:standard:int --filter=@langchain/${{ matrix.package }}
env:
Expand All @@ -58,23 +33,6 @@ jobs:
# The `@langchain/openai` package contains standard tests for ChatOpenAI and AzureChatOpenAI
# We want to run these separately, so we need to pass the exact path for each test, which means
# we need separate jobs for each test.
build-langchain-openai:
needs: install-dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Download cached node_modules
uses: actions/download-artifact@v3
with:
name: node_modules
path: node_modules
- name: Build `@langchain/openai`
run: yarn build --filter=@langchain/openai

tests-ChatOpenAI:
needs: build-langchain-openai
runs-on: ubuntu-latest
Expand All @@ -84,11 +42,11 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Download cached node_modules
uses: actions/download-artifact@v3
with:
name: node_modules
path: node_modules
cache: "yarn"
- name: Install dependencies
run: yarn install --immutable --mode=skip-build
- name: Build `@langchain/openai`
run: yarn build --filter=@langchain/openai
- name: Run standard tests (integration) for `@langchain/openai` ChatOpenAI
run: yarn workspace @langchain/openai test:single src/tests/chat_models.standard.int.test.ts
env:
Expand All @@ -103,15 +61,16 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Download cached node_modules
uses: actions/download-artifact@v3
with:
name: node_modules
path: node_modules
cache: "yarn"
- name: Install dependencies
run: yarn install --immutable --mode=skip-build
- name: Build `@langchain/openai`
run: yarn build --filter=@langchain/openai
- name: Run standard tests (integration) for `@langchain/openai` AzureChatOpenAI
run: yarn workspace @langchain/openai test:single src/tests/azure/chat_models.standard.int.test.ts
env:
AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
AZURE_OPENAI_API_DEPLOYMENT_NAME: "chat"
AZURE_OPENAI_API_VERSION: ${{ secrets.AZURE_OPENAI_API_VERSION }}
AZURE_OPENAI_BASE_PATH: ${{ secrets.AZURE_OPENAI_BASE_PATH }}

0 comments on commit 74da454

Please sign in to comment.