RAGStack CI #265
This file contains 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: RAGStack CI | |
on: | |
workflow_dispatch: {} | |
schedule: | |
- cron: '0 0 * * *' | |
pull_request: | |
paths-ignore: | |
- '.github/workflows/langchain-master-daily.yml' | |
- 'docs/**' | |
- 'README.md' | |
branches: | |
- main | |
jobs: | |
tests: | |
name: Tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v3 | |
- name: Add SSH private keys for submodule repositories | |
uses: webfactory/[email protected] | |
with: | |
ssh-private-key: | | |
${{ secrets.SSH_PRIVATE_KEY_LANGCHAIN_SUBMODULE }} | |
${{ secrets.SSH_PRIVATE_KEY_LANGSMITH_SUBMODULE }} | |
- name: Update submodules | |
run: git submodule update --init --recursive | |
- 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 poetry | |
poetry install | |
- name: Run unit tests | |
run: | | |
poetry run pytest tests/unit-tests | |
- name: Build the distribution package | |
run: | | |
poetry build | |
- name: Test the distribution package | |
run: | | |
python -m venv /tmp/venv | |
source /tmp/venv/bin/activate | |
pip install dist/ragstack_ai-*.whl | |
pytest tests/unit-tests | |
deactivate | |
- name: Run notebook tests | |
env: | |
ASTRA_DB_APPLICATION_TOKEN: "${{ secrets.E2E_TESTS_ASTRA_DB_TOKEN }}" | |
ASTRA_DB_API_ENDPOINT: "${{ secrets.E2E_TESTS_ASTRA_DB_ENDPOINT }}" | |
ASTRA_DB_ID: "${{ secrets.E2E_TESTS_ASTRA_DB_ID }}" | |
OPENAI_API_KEY: "${{ secrets.E2E_TESTS_OPEN_AI_KEY }}" | |
run: | | |
poetry run pytest --nbmake examples/notebooks/*.ipynb | |
- name: Run E2E tests | |
id: e2e-tests | |
env: | |
ASTRA_DEV_DB_TOKEN: "${{ secrets.E2E_TESTS_ASTRA_DEV_DB_TOKEN }}" | |
ASTRA_DEV_DB_ENDPOINT: "${{ secrets.E2E_TESTS_ASTRA_DEV_DB_ENDPOINT }}" | |
ASTRA_PROD_DB_TOKEN: "${{ secrets.E2E_TESTS_ASTRA_DB_TOKEN }}" | |
ASTRA_PROD_DB_ENDPOINT: "${{ secrets.E2E_TESTS_ASTRA_DB_ENDPOINT }}" | |
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 }}" | |
GCLOUD_ACCOUNT_KEY_JSON: "${{ secrets.E2E_TESTS_GCLOUD_ACCOUNT_KEY_JSON }}" | |
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 }}" | |
run: | | |
poetry run tox -c ragstack-e2e-tests | |
- name: Dump report on Github Summary | |
if: always() | |
run: | | |
if [ -f "ragstack-e2e-tests/generated-compatibility-matrix.md" ]; then | |
echo "$(cat ragstack-e2e-tests/generated-compatibility-matrix.md)" >> $GITHUB_STEP_SUMMARY | |
echo "Report added to the summary" | |
else | |
echo "Report not found" | |
fi | |
- name: Compute commit URL | |
if: always() && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') | |
id: commit-ref | |
run: | |
echo "::set-output name=commit-ref::$(git rev-parse --short HEAD)" | |
- name: Prepare report for Slack | |
if: always() && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') | |
uses: ./.github/actions/generate-slack-report | |
with: | |
output-file: slack-report.json | |
type: ragstack | |
outcome: ${{ steps.e2e-tests.outcome }} | |
commit-url: "https://github.com/datastax/ragstack-ai/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: Run LangChain tests | |
env: | |
ASTRA_DB_TOKEN: "${{ secrets.E2E_TESTS_ASTRA_DB_TOKEN }}" | |
ASTRA_DB_ENDPOINT: "${{ secrets.E2E_TESTS_ASTRA_DB_ENDPOINT }}" | |
run: | | |
source /tmp/venv/bin/activate | |
./dev/run-langchain-e2e-tests.sh |