Tests: generate single reports for LC/LI #585
Workflow file for this run
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' | |
- '.github/workflows/llamaindex-main-daily.yml' | |
- '.github/workflows/release-ragstack.yml' | |
- '.github/workflows/security-scan.yml' | |
- 'scripts/**' | |
- 'docs/**' | |
- 'README.md' | |
branches: | |
- main | |
concurrency: | |
group: ragstack-ci-${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
preconditions: | |
name: Preconditions | |
runs-on: ubuntu-latest | |
outputs: | |
notebooks: ${{ steps.filter.outputs.notebooks }} | |
e2e_tests: ${{ steps.filter.outputs.e2e_tests }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dorny/paths-filter@v2 | |
id: filter | |
with: | |
filters: ./.github/changes-filter.yaml | |
unit-tests: | |
name: Unit Tests | |
runs-on: ubuntu-latest | |
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: Run ragstack-ai unit tests | |
run: | | |
tox | |
e2e-tests: | |
name: End-to-end Tests (${{ matrix.name }}) | |
needs: ["preconditions"] | |
if: needs.preconditions.outputs.e2e_tests == 'true' || needs.preconditions.outputs.notebooks == 'true' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- name: Astra PROD | |
astra_token_secret: E2E_TESTS_ASTRA_PROD_DB_TOKEN | |
env: PROD | |
region: us-east-2 | |
cloud: aws | |
# - name: Astra DEV | |
# astra_token_secret: E2E_TESTS_ASTRA_DEV_DB_TOKEN | |
# env: DEV | |
# region: us-west-2 | |
# cloud: aws | |
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 | |
with: | |
astra-token: ${{ secrets[matrix.astra_token_secret] }} | |
db-name: ${{ github.run_id }} | |
env: ${{ matrix.env }} | |
region: ${{ matrix.region }} | |
cloud: ${{ matrix.cloud }} | |
- name: Run notebook tests | |
if: needs.preconditions.outputs.notebooks == 'true' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' | |
env: | |
ASTRA_DB_APPLICATION_TOKEN: "${{ secrets[matrix.astra_token_secret] }}" | |
ASTRA_DB_API_ENDPOINT: "${{ steps.astra-db.outputs.db_endpoint }}" | |
ASTRA_DB_ID: "${{ steps.astra-db.outputs.db_id }}" | |
OPENAI_API_KEY: "${{ secrets.E2E_TESTS_OPEN_AI_KEY }}" | |
LANGCHAIN_API_KEY: "${{ secrets.E2E_TESTS_LANGCHAIN_API_KEY }}" | |
run: | | |
tox -e notebooks | |
- name: Run E2E tests | |
id: e2e-tests | |
if: needs.preconditions.outputs.e2e_tests == 'true' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' | |
env: | |
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 }}" | |
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 }}" | |
HUGGINGFACE_HUB_KEY: "${{ secrets.E2E_TESTS_HUGGINGFACE_HUB_KEY }}" | |
run: | | |
tox -c ragstack-e2e-tests | |
- name: Dump report on Github Summary | |
if: always() | |
uses: ./.github/actions/add-report-to-github-summary | |
with: | |
all: true | |
- name: Compute commit URL | |
if: always() && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') | |
id: commit-ref | |
run: echo "commit-ref=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
- name: Prepare report for Slack | |
if: always() && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') | |
uses: ./.github/actions/generate-slack-report | |
with: | |
from-report-file: ragstack-e2e-tests/failed-tests-report.txt | |
output-file: slack-report.json | |
type: "RAGStack Tests" | |
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: Cleanup AstraDB | |
uses: ./.github/actions/cleanup-astra-db | |
if: always() | |
continue-on-error: true | |
with: | |
astra-token: ${{ secrets[matrix.astra_token_secret] }} | |
db-name: ${{ github.run_id }} | |
env: ${{ matrix.env }} |