Skip to content

LangChain master branch #862

LangChain master branch

LangChain master branch #862

name: LangChain master
on:
workflow_dispatch: {}
schedule:
- cron: '0 */2 * * *'
jobs:
langchain-tests:
name: "Tests using LangChain main branch (${{ matrix.name }})"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
# - name: Astra PROD
# vector_db_mode: "astradb"
# needs_astra_setup: true
# astra_token_secret: E2E_TESTS_ASTRA_PROD_DB_TOKEN
# env: PROD
# region: eu-west-1
# cloud: aws
# run_notebooks: true
# testspace_space: ""
- name: Astra DEV
type: "astradb"
needs_astra_setup: "true"
astra_token_secret: E2E_TESTS_ASTRA_DEV_DB_TOKEN
env: DEV
region: us-west-2
cloud: aws
run_notebooks: "false"
testspace_space: "RAGStack test suite - LangChain dev - AstraDB"
- name: DSE
type: "local-cassandra"
needs_astra_setup: "false"
astra_token_secret: ""
env: ""
region: ""
cloud: ""
run_notebooks: "false"
testspace_space: "RAGStack test suite - LangChain dev - DSE"
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: 'Setup: Python 3.11'
uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox
- name: Setup AstraDB
uses: ./.github/actions/setup-astra-db
id: astra-db
if: matrix.needs_astra_setup == 'true'
with:
astra-token: ${{ secrets[matrix.astra_token_secret] }}
db-name: ${{ github.run_id }}
env: ${{ matrix.env }}
region: ${{ matrix.region }}
cloud: ${{ matrix.cloud }}
- name: Run E2E tests
id: e2e-tests
env:
VECTOR_DATABASE_TYPE: "${{ matrix.type }}"
ASTRA_DB_TOKEN: "${{ secrets[matrix.astra_token_secret] }}"
ASTRA_DB_ENDPOINT: "${{ steps.astra-db.outputs.db_endpoint }}"
ASTRA_DB_ID: "${{ steps.astra-db.outputs.db_id }}"
ASTRA_DB_ENV: "${{ matrix.env }}"
OPEN_AI_KEY: "${{ secrets.E2E_TESTS_OPEN_AI_KEY }}"
AZURE_OPEN_AI_KEY: "${{ secrets.E2E_TESTS_AZURE_OPEN_AI_KEY }}"
AZURE_OPEN_AI_ENDPOINT: "${{ secrets.E2E_TESTS_AZURE_OPEN_AI_ENDPOINT }}"
AZURE_BLOB_STORAGE_CONNECTION_STRING: "${{ secrets.E2E_TESTS_AZURE_BLOB_STORAGE_CONNECTION_STRING }}"
GCLOUD_ACCOUNT_KEY_JSON: "${{ secrets.E2E_TESTS_GCLOUD_ACCOUNT_KEY_JSON }}"
GOOGLE_API_KEY: "${{ secrets.E2E_TESTS_GOOGLE_API_KEY }}"
AWS_ACCESS_KEY_ID: "${{ secrets.E2E_TESTS_AWS_ACCESS_KEY_ID }}"
AWS_SECRET_ACCESS_KEY: "${{ secrets.E2E_TESTS_AWS_SECRET_ACCESS_KEY }}"
BEDROCK_AWS_REGION: "${{ secrets.E2E_TESTS_BEDROCK_AWS_REGION }}"
HUGGINGFACE_HUB_KEY: "${{ secrets.E2E_TESTS_HUGGINGFACE_HUB_KEY }}"
NVIDIA_API_KEY: "${{ secrets.E2E_TESTS_NVIDIA_API_KEY }}"
LANGCHAIN_API_KEY: "${{ secrets.E2E_TESTS_LANGCHAIN_API_KEY }}"
run: |
source scripts/ci-common-env.sh
tox -c ragstack-e2e-tests -e langchain
- name: Dump report on Github Summary
if: always()
uses: ./.github/actions/add-report-to-github-summary
- name: Compute commit URL
if: always()
id: commit-ref
run: echo "commit-ref=$(grep resolved_reference ragstack-e2e-tests/poetry.lock | awk -F'"' '{print $2}' | head -1)" >> $GITHUB_OUTPUT
- name: Prepare report for Slack
if: always()
uses: ./.github/actions/generate-slack-report
with:
from-report-file: "ragstack-e2e-tests/failed-tests-report.txt"
output-file: slack-report.json
type: "Tests using LangChain main branch (${{ matrix.name }})"
outcome: ${{ steps.e2e-tests.outcome }}
commit-url: "https://github.com/langchain-ai/langchain/commits/${{ steps.commit-ref.outputs.commit-ref }}"
- name: Dump report on Slack
if: always() && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
uses: slackapi/[email protected]
with:
payload-file-path: "./slack-report.json"
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
- name: Testspace deploy report
uses: ./.github/actions/deploy-testspace-report
if: always() && matrix.testspace_space != '' && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
with:
token: ${{ secrets.TESTSPACE_TOKEN }}
report-file: ragstack-e2e-tests/results.xml
space: ${{ matrix.testspace_space }}
# - name: Upload report to Github Pages
# if: always() && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
# uses: ./.github/actions/deploy-tests-report
# with:
# target: "reports/tests/langchain.html"
# reference: "${{ steps.commit-ref.outputs.commit-ref }}"
# reference-link: "https://github.com/langchain-ai/langchain/commits/${{ steps.commit-ref.outputs.commit-ref }}"
# input: "ragstack-e2e-tests/langchain-tests-report.txt"
- name: Cleanup AstraDB
uses: ./.github/actions/cleanup-astra-db
if: always() && matrix.needs_astra_setup == 'true'
with:
astra-token: ${{ secrets[matrix.astra_token_secret] }}
db-name: ${{ github.run_id }}
env: ${{ matrix.env }}