2023-08-08 21:55:25 +00:00
|
|
|
name: Scheduled tests
|
|
|
|
|
|
|
|
on:
|
2023-08-10 16:29:46 +00:00
|
|
|
workflow_dispatch: # Allows to trigger the workflow manually in GitHub UI
|
2023-08-09 16:44:25 +00:00
|
|
|
schedule:
|
2023-08-08 21:55:25 +00:00
|
|
|
- cron: '0 13 * * *'
|
|
|
|
|
|
|
|
env:
|
2024-01-17 16:51:20 +00:00
|
|
|
POETRY_VERSION: "1.7.1"
|
2023-08-08 21:55:25 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2024-06-10 15:07:42 +00:00
|
|
|
if: github.repository_owner == 'langchain-ai'
|
2024-05-30 20:57:12 +00:00
|
|
|
name: Python ${{ matrix.python-version }} - ${{ matrix.working-directory }}
|
2023-08-08 21:55:25 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
2024-05-10 18:28:57 +00:00
|
|
|
fail-fast: false
|
2023-08-08 21:55:25 +00:00
|
|
|
matrix:
|
|
|
|
python-version:
|
|
|
|
- "3.8"
|
|
|
|
- "3.11"
|
2024-04-16 20:49:46 +00:00
|
|
|
working-directory:
|
|
|
|
- "libs/partners/openai"
|
|
|
|
- "libs/partners/anthropic"
|
2024-04-23 21:14:16 +00:00
|
|
|
- "libs/partners/ai21"
|
2024-04-16 20:49:46 +00:00
|
|
|
- "libs/partners/fireworks"
|
2024-04-23 21:14:16 +00:00
|
|
|
- "libs/partners/groq"
|
2024-04-16 20:49:46 +00:00
|
|
|
- "libs/partners/mistralai"
|
2024-04-23 21:14:16 +00:00
|
|
|
- "libs/partners/together"
|
2024-05-30 20:57:12 +00:00
|
|
|
- "libs/partners/cohere"
|
|
|
|
- "libs/partners/google-vertexai"
|
|
|
|
- "libs/partners/google-genai"
|
|
|
|
- "libs/partners/aws"
|
|
|
|
|
2023-08-08 21:55:25 +00:00
|
|
|
steps:
|
2023-10-23 14:01:33 +00:00
|
|
|
- uses: actions/checkout@v4
|
2024-05-30 20:57:12 +00:00
|
|
|
with:
|
|
|
|
path: langchain
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
repository: langchain-ai/langchain-google
|
|
|
|
path: langchain-google
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
repository: langchain-ai/langchain-cohere
|
|
|
|
path: langchain-cohere
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
repository: langchain-ai/langchain-aws
|
|
|
|
path: langchain-aws
|
|
|
|
|
|
|
|
- name: Move libs
|
|
|
|
run: |
|
|
|
|
rm -rf \
|
|
|
|
langchain/libs/partners/google-genai \
|
|
|
|
langchain/libs/partners/google-vertexai \
|
|
|
|
langchain/libs/partners/cohere
|
|
|
|
mv langchain-google/libs/genai langchain/libs/partners/google-genai
|
|
|
|
mv langchain-google/libs/vertexai langchain/libs/partners/google-vertexai
|
|
|
|
mv langchain-cohere/libs/cohere langchain/libs/partners/cohere
|
|
|
|
mv langchain-aws/libs/aws langchain/libs/partners/aws
|
2023-08-22 20:07:53 +00:00
|
|
|
|
2023-08-08 21:55:25 +00:00
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
2024-05-30 20:57:12 +00:00
|
|
|
uses: "./langchain/.github/actions/poetry_setup"
|
2023-08-08 21:55:25 +00:00
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
2023-08-21 14:35:56 +00:00
|
|
|
poetry-version: ${{ env.POETRY_VERSION }}
|
2024-05-30 20:57:12 +00:00
|
|
|
working-directory: langchain/${{ matrix.working-directory }}
|
2023-08-22 20:07:53 +00:00
|
|
|
cache-key: scheduled
|
|
|
|
|
2023-09-23 22:51:59 +00:00
|
|
|
- name: 'Authenticate to Google Cloud'
|
|
|
|
id: 'auth'
|
2024-01-01 22:02:43 +00:00
|
|
|
uses: google-github-actions/auth@v2
|
2023-09-23 22:51:59 +00:00
|
|
|
with:
|
|
|
|
credentials_json: '${{ secrets.GOOGLE_CREDENTIALS }}'
|
|
|
|
|
2024-05-30 20:57:12 +00:00
|
|
|
- name: Configure AWS Credentials
|
|
|
|
uses: aws-actions/configure-aws-credentials@v4
|
|
|
|
with:
|
|
|
|
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
|
|
|
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
|
|
aws-region: ${{ secrets.AWS_REGION }}
|
|
|
|
|
2023-08-22 20:07:53 +00:00
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
echo "Running scheduled tests, installing dependencies with poetry..."
|
2024-05-30 20:57:12 +00:00
|
|
|
cd langchain/${{ matrix.working-directory }}
|
2023-12-08 18:37:44 +00:00
|
|
|
poetry install --with=test_integration,test
|
2023-08-22 20:07:53 +00:00
|
|
|
|
2024-04-16 20:49:46 +00:00
|
|
|
- name: Run integration tests
|
2023-08-08 21:55:25 +00:00
|
|
|
env:
|
|
|
|
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
2023-09-28 18:47:29 +00:00
|
|
|
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
2023-10-12 17:48:45 +00:00
|
|
|
AZURE_OPENAI_API_VERSION: ${{ secrets.AZURE_OPENAI_API_VERSION }}
|
|
|
|
AZURE_OPENAI_API_BASE: ${{ secrets.AZURE_OPENAI_API_BASE }}
|
|
|
|
AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
|
2023-12-08 18:27:21 +00:00
|
|
|
AZURE_OPENAI_CHAT_DEPLOYMENT_NAME: ${{ secrets.AZURE_OPENAI_CHAT_DEPLOYMENT_NAME }}
|
|
|
|
AZURE_OPENAI_LLM_DEPLOYMENT_NAME: ${{ secrets.AZURE_OPENAI_LLM_DEPLOYMENT_NAME }}
|
|
|
|
AZURE_OPENAI_EMBEDDINGS_DEPLOYMENT_NAME: ${{ secrets.AZURE_OPENAI_EMBEDDINGS_DEPLOYMENT_NAME }}
|
2024-04-16 20:49:46 +00:00
|
|
|
AI21_API_KEY: ${{ secrets.AI21_API_KEY }}
|
2023-10-26 21:24:42 +00:00
|
|
|
FIREWORKS_API_KEY: ${{ secrets.FIREWORKS_API_KEY }}
|
2024-04-16 20:49:46 +00:00
|
|
|
GROQ_API_KEY: ${{ secrets.GROQ_API_KEY }}
|
|
|
|
MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }}
|
|
|
|
TOGETHER_API_KEY: ${{ secrets.TOGETHER_API_KEY }}
|
2024-05-30 20:57:12 +00:00
|
|
|
COHERE_API_KEY: ${{ secrets.COHERE_API_KEY }}
|
|
|
|
NVIDIA_API_KEY: ${{ secrets.NVIDIA_API_KEY }}
|
|
|
|
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
|
|
|
|
GOOGLE_SEARCH_API_KEY: ${{ secrets.GOOGLE_SEARCH_API_KEY }}
|
|
|
|
GOOGLE_CSE_ID: ${{ secrets.GOOGLE_CSE_ID }}
|
2023-08-08 21:55:25 +00:00
|
|
|
run: |
|
2024-05-30 20:57:12 +00:00
|
|
|
cd langchain/${{ matrix.working-directory }}
|
|
|
|
make integration_tests
|
|
|
|
|
|
|
|
- name: Remove external libraries
|
|
|
|
run: |
|
|
|
|
rm -rf \
|
|
|
|
langchain/libs/partners/google-genai \
|
|
|
|
langchain/libs/partners/google-vertexai \
|
|
|
|
langchain/libs/partners/cohere \
|
|
|
|
langchain/libs/partners/aws
|
2023-10-04 15:35:55 +00:00
|
|
|
|
|
|
|
- name: Ensure the tests did not create any additional files
|
2024-05-30 20:57:12 +00:00
|
|
|
working-directory: langchain
|
2023-10-04 15:35:55 +00:00
|
|
|
run: |
|
|
|
|
set -eu
|
|
|
|
|
|
|
|
STATUS="$(git status)"
|
|
|
|
echo "$STATUS"
|
|
|
|
|
|
|
|
# grep will exit non-zero if the target message isn't found,
|
|
|
|
# and `set -e` above will cause the step to fail.
|
|
|
|
echo "$STATUS" | grep 'nothing to commit, working tree clean'
|