Skip to content

Updates for unified build #585

Updates for unified build

Updates for unified build #585

Workflow file for this run

name: CI - RAGStack tests
on:
pull_request:
branches:
- main
concurrency:
group: ragstack-tests-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-docker:
name: Docker
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Docker examples - basic
run: |
docker --version
cd docker/examples/basic
sudo docker build -t ragstack-basic .
- name: Docker examples - multistage
run: |
cd docker/examples/multistage
sudo docker build -t ragstack-multistage .
- name: Docker examples - local llm
run: |
cd docker/examples/local-llm
sudo docker build -t local-llm .
unit-tests:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: "Setup: Python 3.11"
uses: ./.github/actions/setup-python
- name: Run lint
uses: ./.github/actions/lint
- name: "Unit tests (root)"
run: tox -e unit-tests && rm -rf .tox
- name: "Unit tests (colbert)"
run: tox -e unit-tests -c libs/colbert && rm -rf libs/colbert/.tox
- name: "Unit tests (langchain)"
run: tox -e unit-tests -c libs/langchain && rm -rf libs/langchain/.tox
- name: "Unit tests (llamaindex)"
run: tox -e unit-tests -c libs/llamaindex && rm -rf libs/llamaindex/.tox
integration-tests:
name: Integration Tests
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Check out the repo
uses: actions/checkout@v4
- uses: dorny/paths-filter@v2
id: filter
with:
filters: ./.github/changes-filter.yaml
- name: "Setup: Python 3.11"
if: ${{ steps.filter.outputs.integration_tests == 'true' }}
uses: ./.github/actions/setup-python
- name: Compute db name
if: ${{ steps.filter.outputs.integration_tests == 'true' }}
id: db-name
run: |
echo "db-name=${{ github.run_id}}-$(echo $(for((i=1;i<=8;i++))
do printf '%s' "${RANDOM:0:1}"; done) | tr '[0-9]' '[a-z]')" >> $GITHUB_OUTPUT
- name: Setup AstraDB
uses: ./.github/actions/setup-astra-db
if: ${{ steps.filter.outputs.integration_tests == 'true' }}
id: astra-db
with:
astra-token: ${{ secrets.E2E_TESTS_ASTRA_DEV_DB_TOKEN }}
db-name: ${{ steps.db-name.outputs.db-name }}
env: "DEV"
region: "us-central1"
cloud: "gcp"
- name: "Integration tests"
if: ${{ steps.filter.outputs.integration_tests == 'true' }}
env:
ASTRA_DB_TOKEN: "${{ secrets.E2E_TESTS_ASTRA_DEV_DB_TOKEN }}"
ASTRA_DB_ID: "${{ steps.astra-db.outputs.db_id }}"
ASTRA_DB_ENV: "DEV"
run: |
set -ex
run_itests() {
local dir=$1
tox -e integration-tests -c $dir
rm -rf $dir/.tox
}
run_itests libs/colbert
run_itests libs/langchain
run_itests libs/llamaindex
- name: Cleanup AstraDB
uses: ./.github/actions/cleanup-astra-db
if: ${{ always() && steps.filter.outputs.integration_tests == 'true' }}
with:
astra-token: ${{ secrets.E2E_TESTS_ASTRA_DEV_DB_TOKEN }}
db-name: ${{ steps.db-name.outputs.db-name }}
env: "DEV"