| paths: | paths: | ||||
| - api/** | - api/** | ||||
| - docker/** | - docker/** | ||||
| - .github/workflows/api-tests.yml | |||||
| concurrency: | concurrency: | ||||
| group: api-tests-${{ github.head_ref || github.run_id }} | group: api-tests-${{ github.head_ref || github.run_id }} | ||||
| - name: Checkout code | - name: Checkout code | ||||
| uses: actions/checkout@v4 | uses: actions/checkout@v4 | ||||
| - name: Install Poetry | |||||
| uses: abatilo/actions-poetry@v3 | |||||
| - name: Set up Python ${{ matrix.python-version }} | - name: Set up Python ${{ matrix.python-version }} | ||||
| uses: actions/setup-python@v5 | uses: actions/setup-python@v5 | ||||
| with: | with: | ||||
| python-version: ${{ matrix.python-version }} | python-version: ${{ matrix.python-version }} | ||||
| cache-dependency-path: | | |||||
| api/pyproject.toml | |||||
| api/poetry.lock | |||||
| - name: Install Poetry | |||||
| uses: abatilo/actions-poetry@v3 | |||||
| cache: poetry | |||||
| cache-dependency-path: api/poetry.lock | |||||
| - name: Check Poetry lockfile | - name: Check Poetry lockfile | ||||
| run: | | run: | | ||||
| run: sh .github/workflows/expose_service_ports.sh | run: sh .github/workflows/expose_service_ports.sh | ||||
| - name: Set up Sandbox | - name: Set up Sandbox | ||||
| uses: hoverkraft-tech/compose-action@v2.0.0 | |||||
| uses: hoverkraft-tech/compose-action@v2.0.2 | |||||
| with: | with: | ||||
| compose-file: | | compose-file: | | ||||
| docker/docker-compose.middleware.yaml | docker/docker-compose.middleware.yaml |
| cp middleware.env.example middleware.env | cp middleware.env.example middleware.env | ||||
| - name: Set up Middlewares | - name: Set up Middlewares | ||||
| uses: hoverkraft-tech/compose-action@v2.0.0 | |||||
| uses: hoverkraft-tech/compose-action@v2.0.2 | |||||
| with: | with: | ||||
| compose-file: | | compose-file: | | ||||
| docker/docker-compose.middleware.yaml | docker/docker-compose.middleware.yaml |
| with: | with: | ||||
| files: api/** | files: api/** | ||||
| - name: Install Poetry | |||||
| if: steps.changed-files.outputs.any_changed == 'true' | |||||
| uses: abatilo/actions-poetry@v3 | |||||
| - name: Set up Python | - name: Set up Python | ||||
| uses: actions/setup-python@v5 | uses: actions/setup-python@v5 | ||||
| if: steps.changed-files.outputs.any_changed == 'true' | if: steps.changed-files.outputs.any_changed == 'true' | ||||
| with: | with: | ||||
| python-version: '3.10' | python-version: '3.10' | ||||
| - name: Install Poetry | |||||
| if: steps.changed-files.outputs.any_changed == 'true' | |||||
| uses: abatilo/actions-poetry@v3 | |||||
| - name: Python dependencies | - name: Python dependencies | ||||
| if: steps.changed-files.outputs.any_changed == 'true' | if: steps.changed-files.outputs.any_changed == 'true' | ||||
| run: poetry install -C api --only lint | run: poetry install -C api --only lint |
| paths: | paths: | ||||
| - api/core/rag/datasource/** | - api/core/rag/datasource/** | ||||
| - docker/** | - docker/** | ||||
| - .github/workflows/vdb-tests.yml | |||||
| concurrency: | concurrency: | ||||
| group: api-tests-${{ github.head_ref || github.run_id }} | |||||
| group: vdb-tests-${{ github.head_ref || github.run_id }} | |||||
| cancel-in-progress: true | cancel-in-progress: true | ||||
| jobs: | jobs: | ||||
| - name: Checkout code | - name: Checkout code | ||||
| uses: actions/checkout@v4 | uses: actions/checkout@v4 | ||||
| - name: Install Poetry | |||||
| uses: abatilo/actions-poetry@v3 | |||||
| - name: Set up Python ${{ matrix.python-version }} | - name: Set up Python ${{ matrix.python-version }} | ||||
| uses: actions/setup-python@v5 | uses: actions/setup-python@v5 | ||||
| with: | with: | ||||
| python-version: ${{ matrix.python-version }} | python-version: ${{ matrix.python-version }} | ||||
| cache-dependency-path: | | |||||
| api/pyproject.toml | |||||
| api/poetry.lock | |||||
| - name: Install Poetry | |||||
| uses: abatilo/actions-poetry@v3 | |||||
| cache: poetry | |||||
| cache-dependency-path: api/poetry.lock | |||||
| - name: Check Poetry lockfile | - name: Check Poetry lockfile | ||||
| run: | | run: | | ||||
| run: sh .github/workflows/expose_service_ports.sh | run: sh .github/workflows/expose_service_ports.sh | ||||
| - name: Set up Vector Stores (Weaviate, Qdrant, PGVector, Milvus, PgVecto-RS, Chroma, MyScale, ElasticSearch, Couchbase) | - name: Set up Vector Stores (Weaviate, Qdrant, PGVector, Milvus, PgVecto-RS, Chroma, MyScale, ElasticSearch, Couchbase) | ||||
| uses: hoverkraft-tech/compose-action@v2.0.0 | |||||
| uses: hoverkraft-tech/compose-action@v2.0.2 | |||||
| with: | with: | ||||
| compose-file: | | compose-file: | | ||||
| docker/docker-compose.yaml | docker/docker-compose.yaml |
| 1. Install dependencies for both the backend and the test environment | 1. Install dependencies for both the backend and the test environment | ||||
| ```bash | ```bash | ||||
| poetry install --with dev | |||||
| poetry install -C api --with dev | |||||
| ``` | ``` | ||||
| 2. Run the tests locally with mocked system environment variables in `tool.pytest_env` section in `pyproject.toml` | 2. Run the tests locally with mocked system environment variables in `tool.pytest_env` section in `pyproject.toml` | ||||
| ```bash | ```bash | ||||
| cd ../ | |||||
| poetry run -C api bash dev/pytest/pytest_all_tests.sh | poetry run -C api bash dev/pytest/pytest_all_tests.sh | ||||
| ``` | ``` | ||||