diff --git a/.github/workflows/CI_coverage_comment.yml b/.github/workflows/CI_coverage_comment.yml index 23ecfbecfb..be7d7bf8d6 100644 --- a/.github/workflows/CI_coverage_comment.yml +++ b/.github/workflows/CI_coverage_comment.yml @@ -3,7 +3,57 @@ name: Add comment about test coverage to PRs on: workflow_run: workflows: + - "Test / aimlapi" + - "Test / amazon-bedrock" + - "Test / amazon-sagemaker" + - "Test / anthropic" + - "Test / arcadedb" + - "Test / astra" + - "Test / azure_ai_search" + - "Test / azure_doc_intelligence" + - "Test / chroma" + - "Test / cohere" + - "Test / cometapi" + - "Test / deepeval" + - "Test / elasticsearch" + - "Test / faiss" + - "Test / fastembed" + - "Test / firecrawl" + - "Test / github" + - "Test / google-genai" + - "Test / hanlp" + - "Test / jina" - "Test / kreuzberg" + - "Test / langfuse" + - "Test / lara" + - "Test / libreoffice" + - "Test / llama_cpp" + - "Test / llama_stack" + - "Test / markitdown" + - "Test / mcp" + - "Test / meta_llama" + - "Test / mistral" + - "Test / mongodb_atlas" + - "Test / nvidia" + - "Test / ollama" + - "Test / openrouter" + - "Test / opensearch" + - "Test / optimum" + - "Test / paddleocr" + - "Test / pgvector" + - "Test / pinecone" + - "Test / pyversity" + - "Test / qdrant" + - "Test / ragas" + - "Test / snowflake" + - "Test / stackit" + - "Test / tavily" + - "Test / togetherai" + - "Test / unstructured" + - "Test / valkey" + - "Test / watsonx" + - "Test / weave" + - "Test / weaviate" types: [completed] jobs: @@ -16,8 +66,8 @@ jobs: - name: Get integration name from workflow name id: integration run: | - # Workflow names follow "Test / " convention - echo "name=$(echo '${{ github.event.workflow_run.name }}' | sed 's/Test \/ //')" >> $GITHUB_OUTPUT + # Workflow names follow "Test / " convention; normalize hyphens to underscores to match directory names + echo "name=$(echo '${{ github.event.workflow_run.name }}' | sed 's/Test \/ //' | tr '-' '_')" >> $GITHUB_OUTPUT - uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 with: diff --git a/.github/workflows/aimlapi.yml b/.github/workflows/aimlapi.yml index 655d3e2dc7..873cabf075 100644 --- a/.github/workflows/aimlapi.yml +++ b/.github/workflows/aimlapi.yml @@ -10,29 +10,56 @@ on: - "integrations/aimlapi/**" - "!integrations/aimlapi/*.md" - ".github/workflows/aimlapi.yml" + push: + branches: + - main + paths: + - "integrations/aimlapi/**" + - "!integrations/aimlapi/*.md" + - ".github/workflows/aimlapi.yml" defaults: run: working-directory: integrations/aimlapi concurrency: - group: aimlapi-${{ github.head_ref }} + group: aimlapi-${{ github.head_ref || github.sha }} cancel-in-progress: true env: PYTHONUNBUFFERED: "1" FORCE_COLOR: "1" AIMLAPI_API_KEY: ${{ secrets.AIMLAPI_API_KEY }} + TEST_MATRIX_OS: '["ubuntu-latest", "windows-latest", "macos-latest"]' + TEST_MATRIX_PYTHON: '["3.10", "3.14"]' jobs: + compute-test-matrix: + runs-on: ubuntu-slim + defaults: + run: + working-directory: . + outputs: + os: ${{ steps.set.outputs.os }} + python-version: ${{ steps.set.outputs.python-version }} + steps: + - id: set + run: | + echo 'os=${{ github.event_name == 'push' && '["ubuntu-latest"]' || env.TEST_MATRIX_OS }}' >> $GITHUB_OUTPUT + echo 'python-version=${{ github.event_name == 'push' && '["3.10"]' || env.TEST_MATRIX_PYTHON }}' >> $GITHUB_OUTPUT + run: name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} + needs: compute-test-matrix + permissions: + contents: write + pull-requests: write runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - python-version: ["3.10", "3.14"] + os: ${{ fromJSON(needs.compute-test-matrix.outputs.os) }} + python-version: ${{ fromJSON(needs.compute-test-matrix.outputs.python-version) }} steps: - name: Support longpaths @@ -54,10 +81,33 @@ jobs: if: matrix.python-version == '3.10' && runner.os == 'Linux' run: hatch run fmt-check && hatch run test:types - - name: Run tests - run: hatch run test:cov-retry + - name: Run unit tests + run: hatch run test:unit-cov-retry + + # On PR: generates coverage comment artifact. On push to main: stores coverage baseline on data branch. + - name: Store unit tests coverage + if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name != 'schedule' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/aimlapi + SUBPROJECT_ID: aimlapi + COMMENT_ARTIFACT_NAME: coverage-comment-aimlapi + + - name: Run integration tests + run: hatch run test:integration-cov-append-retry + + - name: Store combined coverage + if: github.event_name == 'push' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/aimlapi + SUBPROJECT_ID: aimlapi-combined + COMMENT_ARTIFACT_NAME: coverage-comment-aimlapi-combined - name: Run unit tests with lowest direct dependencies + if: github.event_name != 'push' run: | hatch run uv pip compile pyproject.toml --resolution lowest-direct --output-file requirements_lowest_direct.txt hatch -e test env run -- uv pip install -r requirements_lowest_direct.txt @@ -69,7 +119,8 @@ jobs: run: | hatch env prune hatch -e test env run -- uv pip install git+https://github.com/deepset-ai/haystack.git@main - hatch run test:cov-retry + hatch run test:unit-cov-retry + hatch run test:integration-cov-append-retry notify-slack-on-failure: needs: run diff --git a/.github/workflows/amazon_bedrock.yml b/.github/workflows/amazon_bedrock.yml index 9b1486463e..e58d91f165 100644 --- a/.github/workflows/amazon_bedrock.yml +++ b/.github/workflows/amazon_bedrock.yml @@ -10,13 +10,20 @@ on: - "integrations/amazon_bedrock/**" - "!integrations/amazon_bedrock/*.md" - ".github/workflows/amazon_bedrock.yml" + push: + branches: + - main + paths: + - "integrations/amazon_bedrock/**" + - "!integrations/amazon_bedrock/*.md" + - ".github/workflows/amazon_bedrock.yml" defaults: run: working-directory: integrations/amazon_bedrock concurrency: - group: amazon-bedrock-${{ github.head_ref }} + group: amazon-bedrock-${{ github.head_ref || github.sha }} cancel-in-progress: true permissions: @@ -26,6 +33,8 @@ permissions: env: PYTHONUNBUFFERED: "1" FORCE_COLOR: "1" + TEST_MATRIX_OS: '["ubuntu-latest", "windows-latest", "macos-latest"]' + TEST_MATRIX_PYTHON: '["3.10", "3.14"]' AWS_REGION: "us-east-1" AWS_BEDROCK_GUARDRAIL_ID: ${{ secrets.AWS_BEDROCK_GUARDRAIL_ID }} @@ -34,14 +43,33 @@ env: jobs: + compute-test-matrix: + runs-on: ubuntu-slim + defaults: + run: + working-directory: . + outputs: + os: ${{ steps.set.outputs.os }} + python-version: ${{ steps.set.outputs.python-version }} + steps: + - id: set + run: | + echo 'os=${{ github.event_name == 'push' && '["ubuntu-latest"]' || env.TEST_MATRIX_OS }}' >> $GITHUB_OUTPUT + echo 'python-version=${{ github.event_name == 'push' && '["3.10"]' || env.TEST_MATRIX_PYTHON }}' >> $GITHUB_OUTPUT + run: name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} + needs: compute-test-matrix + permissions: + id-token: write + contents: write + pull-requests: write runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - python-version: ["3.10", "3.14"] + os: ${{ fromJSON(needs.compute-test-matrix.outputs.os) }} + python-version: ${{ fromJSON(needs.compute-test-matrix.outputs.python-version) }} steps: - name: Support longpaths @@ -64,7 +92,17 @@ jobs: run: hatch run fmt-check && hatch run test:types - name: Run unit tests - run: hatch run test:unit + run: hatch run test:unit-cov-retry + + # On PR: generates coverage comment artifact. On push to main: stores coverage baseline on data branch. + - name: Store unit tests coverage + if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name != 'schedule' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/amazon_bedrock + SUBPROJECT_ID: amazon_bedrock + COMMENT_ARTIFACT_NAME: coverage-comment-amazon_bedrock # Do not authenticate on PRs from forks and on PRs created by dependabot - name: AWS authentication @@ -77,9 +115,19 @@ jobs: - name: Run integration tests if: success() && steps.aws-auth.outcome == 'success' - run: hatch run test:cov-retry -m "integration" + run: hatch run test:integration-cov-append-retry + + - name: Store combined coverage + if: github.event_name == 'push' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/amazon_bedrock + SUBPROJECT_ID: amazon_bedrock-combined + COMMENT_ARTIFACT_NAME: coverage-comment-amazon_bedrock-combined - name: Run unit tests with lowest direct dependencies + if: github.event_name != 'push' run: | hatch run uv pip compile pyproject.toml --resolution lowest-direct --output-file requirements_lowest_direct.txt hatch -e test env run -- uv pip install -r requirements_lowest_direct.txt diff --git a/.github/workflows/amazon_sagemaker.yml b/.github/workflows/amazon_sagemaker.yml index 94d46c2b7d..dcb3d1a601 100644 --- a/.github/workflows/amazon_sagemaker.yml +++ b/.github/workflows/amazon_sagemaker.yml @@ -10,28 +10,55 @@ on: - "integrations/amazon_sagemaker/**" - "!integrations/amazon_sagemaker/*.md" - ".github/workflows/amazon_sagemaker.yml" + push: + branches: + - main + paths: + - "integrations/amazon_sagemaker/**" + - "!integrations/amazon_sagemaker/*.md" + - ".github/workflows/amazon_sagemaker.yml" defaults: run: working-directory: integrations/amazon_sagemaker concurrency: - group: amazon-sagemaker-${{ github.head_ref }} + group: amazon-sagemaker-${{ github.head_ref || github.sha }} cancel-in-progress: true env: PYTHONUNBUFFERED: "1" FORCE_COLOR: "1" + TEST_MATRIX_OS: '["ubuntu-latest", "windows-latest", "macos-latest"]' + TEST_MATRIX_PYTHON: '["3.10", "3.14"]' jobs: + compute-test-matrix: + runs-on: ubuntu-slim + defaults: + run: + working-directory: . + outputs: + os: ${{ steps.set.outputs.os }} + python-version: ${{ steps.set.outputs.python-version }} + steps: + - id: set + run: | + echo 'os=${{ github.event_name == 'push' && '["ubuntu-latest"]' || env.TEST_MATRIX_OS }}' >> $GITHUB_OUTPUT + echo 'python-version=${{ github.event_name == 'push' && '["3.10"]' || env.TEST_MATRIX_PYTHON }}' >> $GITHUB_OUTPUT + run: name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} + needs: compute-test-matrix + permissions: + contents: write + pull-requests: write runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - python-version: ["3.10", "3.14"] + os: ${{ fromJSON(needs.compute-test-matrix.outputs.os) }} + python-version: ${{ fromJSON(needs.compute-test-matrix.outputs.python-version) }} steps: - name: Support longpaths @@ -53,10 +80,33 @@ jobs: if: matrix.python-version == '3.10' && runner.os == 'Linux' run: hatch run fmt-check && hatch run test:types - - name: Run tests - run: hatch run test:cov-retry + - name: Run unit tests + run: hatch run test:unit-cov-retry + + # On PR: generates coverage comment artifact. On push to main: stores coverage baseline on data branch. + - name: Store unit tests coverage + if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name != 'schedule' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/amazon_sagemaker + SUBPROJECT_ID: amazon_sagemaker + COMMENT_ARTIFACT_NAME: coverage-comment-amazon_sagemaker + + - name: Run integration tests + run: hatch run test:integration-cov-append-retry + + - name: Store combined coverage + if: github.event_name == 'push' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/amazon_sagemaker + SUBPROJECT_ID: amazon_sagemaker-combined + COMMENT_ARTIFACT_NAME: coverage-comment-amazon_sagemaker-combined - name: Run unit tests with lowest direct dependencies + if: github.event_name != 'push' run: | hatch run uv pip compile pyproject.toml --resolution lowest-direct --output-file requirements_lowest_direct.txt hatch -e test env run -- uv pip install -r requirements_lowest_direct.txt diff --git a/.github/workflows/anthropic.yml b/.github/workflows/anthropic.yml index b87e8c2719..b95df31bb8 100644 --- a/.github/workflows/anthropic.yml +++ b/.github/workflows/anthropic.yml @@ -10,29 +10,56 @@ on: - "integrations/anthropic/**" - "!integrations/anthropic/*.md" - ".github/workflows/anthropic.yml" + push: + branches: + - main + paths: + - "integrations/anthropic/**" + - "!integrations/anthropic/*.md" + - ".github/workflows/anthropic.yml" defaults: run: working-directory: integrations/anthropic concurrency: - group: anthropic-${{ github.head_ref }} + group: anthropic-${{ github.head_ref || github.sha }} cancel-in-progress: true env: PYTHONUNBUFFERED: "1" FORCE_COLOR: "1" ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} + TEST_MATRIX_OS: '["ubuntu-latest", "windows-latest", "macos-latest"]' + TEST_MATRIX_PYTHON: '["3.10", "3.14"]' jobs: + compute-test-matrix: + runs-on: ubuntu-slim + defaults: + run: + working-directory: . + outputs: + os: ${{ steps.set.outputs.os }} + python-version: ${{ steps.set.outputs.python-version }} + steps: + - id: set + run: | + echo 'os=${{ github.event_name == 'push' && '["ubuntu-latest"]' || env.TEST_MATRIX_OS }}' >> $GITHUB_OUTPUT + echo 'python-version=${{ github.event_name == 'push' && '["3.10"]' || env.TEST_MATRIX_PYTHON }}' >> $GITHUB_OUTPUT + run: name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} + needs: compute-test-matrix + permissions: + contents: write + pull-requests: write runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - python-version: ["3.10", "3.14"] + os: ${{ fromJSON(needs.compute-test-matrix.outputs.os) }} + python-version: ${{ fromJSON(needs.compute-test-matrix.outputs.python-version) }} steps: - name: Support longpaths @@ -54,10 +81,33 @@ jobs: if: matrix.python-version == '3.10' && runner.os == 'Linux' run: hatch run fmt-check && hatch run test:types - - name: Run tests - run: hatch run test:cov-retry + - name: Run unit tests + run: hatch run test:unit-cov-retry + + # On PR: generates coverage comment artifact. On push to main: stores coverage baseline on data branch. + - name: Store unit tests coverage + if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name != 'schedule' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/anthropic + SUBPROJECT_ID: anthropic + COMMENT_ARTIFACT_NAME: coverage-comment-anthropic + + - name: Run integration tests + run: hatch run test:integration-cov-append-retry + + - name: Store combined coverage + if: github.event_name == 'push' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/anthropic + SUBPROJECT_ID: anthropic-combined + COMMENT_ARTIFACT_NAME: coverage-comment-anthropic-combined - name: Run unit tests with lowest direct dependencies + if: github.event_name != 'push' run: | hatch run uv pip compile pyproject.toml --resolution lowest-direct --output-file requirements_lowest_direct.txt hatch -e test env run -- uv pip install -r requirements_lowest_direct.txt diff --git a/.github/workflows/arcadedb.yml b/.github/workflows/arcadedb.yml index 585c86a740..465559fb79 100644 --- a/.github/workflows/arcadedb.yml +++ b/.github/workflows/arcadedb.yml @@ -10,9 +10,16 @@ on: - "integrations/arcadedb/**" - "!integrations/arcadedb/*.md" - ".github/workflows/arcadedb.yml" + push: + branches: + - main + paths: + - "integrations/arcadedb/**" + - "!integrations/arcadedb/*.md" + - ".github/workflows/arcadedb.yml" concurrency: - group: arcadedb-${{ github.head_ref }} + group: arcadedb-${{ github.head_ref || github.sha }} cancel-in-progress: true env: @@ -21,20 +28,40 @@ env: ARCADEDB_USERNAME: "root" # Only set in main repo (secrets not passed to fork workflows); integration tests skip when unset ARCADEDB_PASSWORD: ${{ secrets.ARCADEDB_PASSWORD }} + TEST_MATRIX_OS: '["ubuntu-latest"]' + TEST_MATRIX_PYTHON: '["3.10", "3.14"]' defaults: run: working-directory: integrations/arcadedb jobs: + compute-test-matrix: + runs-on: ubuntu-slim + defaults: + run: + working-directory: . + outputs: + os: ${{ steps.set.outputs.os }} + python-version: ${{ steps.set.outputs.python-version }} + steps: + - id: set + run: | + echo 'os=${{ github.event_name == 'push' && '["ubuntu-latest"]' || env.TEST_MATRIX_OS }}' >> $GITHUB_OUTPUT + echo 'python-version=${{ github.event_name == 'push' && '["3.10"]' || env.TEST_MATRIX_PYTHON }}' >> $GITHUB_OUTPUT + run: name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} + needs: compute-test-matrix + permissions: + contents: write + pull-requests: write runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-latest] - python-version: ["3.10", "3.14"] + os: ${{ fromJSON(needs.compute-test-matrix.outputs.os) }} + python-version: ${{ fromJSON(needs.compute-test-matrix.outputs.python-version) }} services: arcadedb: image: arcadedata/arcadedb:latest @@ -59,10 +86,33 @@ jobs: if: matrix.python-version == '3.10' && runner.os == 'Linux' run: hatch run fmt-check && hatch run test:types - - name: Run tests - run: hatch run test:cov-retry + - name: Run unit tests + run: hatch run test:unit-cov-retry + + # On PR: generates coverage comment artifact. On push to main: stores coverage baseline on data branch. + - name: Store unit tests coverage + if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name != 'schedule' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/arcadedb + SUBPROJECT_ID: arcadedb + COMMENT_ARTIFACT_NAME: coverage-comment-arcadedb + + - name: Run integration tests + run: hatch run test:integration-cov-append-retry + + - name: Store combined coverage + if: github.event_name == 'push' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/arcadedb + SUBPROJECT_ID: arcadedb-combined + COMMENT_ARTIFACT_NAME: coverage-comment-arcadedb-combined - name: Run unit tests with lowest direct dependencies + if: github.event_name != 'push' run: | hatch run uv pip compile pyproject.toml --resolution lowest-direct --output-file requirements_lowest_direct.txt hatch -e test env run -- uv pip install -r requirements_lowest_direct.txt diff --git a/.github/workflows/astra.yml b/.github/workflows/astra.yml index 4bd026edc3..c45d4a5467 100644 --- a/.github/workflows/astra.yml +++ b/.github/workflows/astra.yml @@ -10,29 +10,56 @@ on: - "integrations/astra/**" - "!integrations/astra/*.md" - ".github/workflows/astra.yml" + push: + branches: + - main + paths: + - "integrations/astra/**" + - "!integrations/astra/*.md" + - ".github/workflows/astra.yml" defaults: run: working-directory: integrations/astra concurrency: - group: astra-${{ github.head_ref }} + group: astra-${{ github.head_ref || github.sha }} cancel-in-progress: true env: PYTHONUNBUFFERED: "1" FORCE_COLOR: "1" + TEST_MATRIX_OS: '["ubuntu-latest", "windows-latest", "macos-latest"]' + TEST_MATRIX_PYTHON: '["3.10", "3.14"]' jobs: + compute-test-matrix: + runs-on: ubuntu-slim + defaults: + run: + working-directory: . + outputs: + os: ${{ steps.set.outputs.os }} + python-version: ${{ steps.set.outputs.python-version }} + steps: + - id: set + run: | + echo 'os=${{ github.event_name == 'push' && '["ubuntu-latest"]' || env.TEST_MATRIX_OS }}' >> $GITHUB_OUTPUT + echo 'python-version=${{ github.event_name == 'push' && '["3.10"]' || env.TEST_MATRIX_PYTHON }}' >> $GITHUB_OUTPUT + run: name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} + needs: compute-test-matrix + permissions: + contents: write + pull-requests: write runs-on: ${{ matrix.os }} strategy: fail-fast: false max-parallel: 1 matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - python-version: ["3.10", "3.14"] + os: ${{ fromJSON(needs.compute-test-matrix.outputs.os) }} + python-version: ${{ fromJSON(needs.compute-test-matrix.outputs.python-version) }} steps: - name: Support longpaths @@ -54,13 +81,36 @@ jobs: if: matrix.python-version == '3.10' && runner.os == 'Linux' run: hatch run fmt-check && hatch run test:types - - name: Run tests + - name: Run unit tests + run: hatch run test:unit-cov-retry + + # On PR: generates coverage comment artifact. On push to main: stores coverage baseline on data branch. + - name: Store unit tests coverage + if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name != 'schedule' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/astra + SUBPROJECT_ID: astra + COMMENT_ARTIFACT_NAME: coverage-comment-astra + + - name: Run integration tests env: ASTRA_DB_API_ENDPOINT: ${{ secrets.ASTRA_DB_API_ENDPOINT }} ASTRA_DB_APPLICATION_TOKEN: ${{ secrets.ASTRA_DB_APPLICATION_TOKEN }} - run: hatch run test:cov-retry + run: hatch run test:integration-cov-append-retry + + - name: Store combined coverage + if: github.event_name == 'push' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/astra + SUBPROJECT_ID: astra-combined + COMMENT_ARTIFACT_NAME: coverage-comment-astra-combined - name: Run unit tests with lowest direct dependencies + if: github.event_name != 'push' run: | hatch run uv pip compile pyproject.toml --resolution lowest-direct --output-file requirements_lowest_direct.txt hatch -e test env run -- uv pip install -r requirements_lowest_direct.txt diff --git a/.github/workflows/azure_ai_search.yml b/.github/workflows/azure_ai_search.yml index 73be628736..47b7f7b497 100644 --- a/.github/workflows/azure_ai_search.yml +++ b/.github/workflows/azure_ai_search.yml @@ -10,9 +10,16 @@ on: - "integrations/azure_ai_search/**" - "!integrations/azure_ai_search/*.md" - ".github/workflows/azure_ai_search.yml" + push: + branches: + - main + paths: + - "integrations/azure_ai_search/**" + - "!integrations/azure_ai_search/*.md" + - ".github/workflows/azure_ai_search.yml" concurrency: - group: azure_ai_search-${{ github.head_ref }} + group: azure_ai_search-${{ github.head_ref || github.sha }} cancel-in-progress: true env: @@ -20,21 +27,41 @@ env: FORCE_COLOR: "1" AZURE_AI_SEARCH_API_KEY: ${{ secrets.AZURE_AI_SEARCH_API_KEY }} AZURE_AI_SEARCH_ENDPOINT: ${{ secrets.AZURE_AI_SEARCH_ENDPOINT }} + TEST_MATRIX_OS: '["ubuntu-latest", "windows-latest"]' + TEST_MATRIX_PYTHON: '["3.10", "3.14"]' defaults: run: working-directory: integrations/azure_ai_search jobs: + compute-test-matrix: + runs-on: ubuntu-slim + defaults: + run: + working-directory: . + outputs: + os: ${{ steps.set.outputs.os }} + python-version: ${{ steps.set.outputs.python-version }} + steps: + - id: set + run: | + echo 'os=${{ github.event_name == 'push' && '["ubuntu-latest"]' || env.TEST_MATRIX_OS }}' >> $GITHUB_OUTPUT + echo 'python-version=${{ github.event_name == 'push' && '["3.10"]' || env.TEST_MATRIX_PYTHON }}' >> $GITHUB_OUTPUT + run: name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} + needs: compute-test-matrix + permissions: + contents: write + pull-requests: write runs-on: ${{ matrix.os }} strategy: fail-fast: false max-parallel: 3 matrix: - os: [ubuntu-latest, windows-latest] # the tests are slow and we can't run many of them in parallel, so we skip testing on macOS - python-version: ["3.10", "3.14"] + os: ${{ fromJSON(needs.compute-test-matrix.outputs.os) }} + python-version: ${{ fromJSON(needs.compute-test-matrix.outputs.python-version) }} steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 @@ -51,10 +78,33 @@ jobs: if: matrix.python-version == '3.10' && runner.os == 'Linux' run: hatch run fmt-check && hatch run test:types - - name: Run tests - run: hatch run test:cov-retry + - name: Run unit tests + run: hatch run test:unit-cov-retry + + # On PR: generates coverage comment artifact. On push to main: stores coverage baseline on data branch. + - name: Store unit tests coverage + if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name != 'schedule' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/azure_ai_search + SUBPROJECT_ID: azure_ai_search + COMMENT_ARTIFACT_NAME: coverage-comment-azure_ai_search + + - name: Run integration tests + run: hatch run test:integration-cov-append-retry + + - name: Store combined coverage + if: github.event_name == 'push' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/azure_ai_search + SUBPROJECT_ID: azure_ai_search-combined + COMMENT_ARTIFACT_NAME: coverage-comment-azure_ai_search-combined - name: Run unit tests with lowest direct dependencies + if: github.event_name != 'push' run: | hatch run uv pip compile pyproject.toml --resolution lowest-direct --output-file requirements_lowest_direct.txt hatch -e test env run -- uv pip install -r requirements_lowest_direct.txt diff --git a/.github/workflows/azure_doc_intelligence.yml b/.github/workflows/azure_doc_intelligence.yml index 9cac04eab2..c1c833fd18 100644 --- a/.github/workflows/azure_doc_intelligence.yml +++ b/.github/workflows/azure_doc_intelligence.yml @@ -10,9 +10,16 @@ on: - "integrations/azure_doc_intelligence/**" - "!integrations/azure_doc_intelligence/*.md" - ".github/workflows/azure_doc_intelligence.yml" + push: + branches: + - main + paths: + - "integrations/azure_doc_intelligence/**" + - "!integrations/azure_doc_intelligence/*.md" + - ".github/workflows/azure_doc_intelligence.yml" concurrency: - group: azure_doc_intelligence-${{ github.head_ref }} + group: azure_doc_intelligence-${{ github.head_ref || github.sha }} cancel-in-progress: true env: @@ -20,21 +27,41 @@ env: FORCE_COLOR: "1" AZURE_DI_ENDPOINT: ${{ secrets.AZURE_DI_ENDPOINT }} AZURE_AI_API_KEY: ${{ secrets.AZURE_AI_API_KEY }} + TEST_MATRIX_OS: '["ubuntu-latest", "windows-latest"]' + TEST_MATRIX_PYTHON: '["3.10", "3.14"]' defaults: run: working-directory: integrations/azure_doc_intelligence jobs: + compute-test-matrix: + runs-on: ubuntu-slim + defaults: + run: + working-directory: . + outputs: + os: ${{ steps.set.outputs.os }} + python-version: ${{ steps.set.outputs.python-version }} + steps: + - id: set + run: | + echo 'os=${{ github.event_name == 'push' && '["ubuntu-latest"]' || env.TEST_MATRIX_OS }}' >> $GITHUB_OUTPUT + echo 'python-version=${{ github.event_name == 'push' && '["3.10"]' || env.TEST_MATRIX_PYTHON }}' >> $GITHUB_OUTPUT + run: name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} + needs: compute-test-matrix + permissions: + contents: write + pull-requests: write runs-on: ${{ matrix.os }} strategy: fail-fast: false max-parallel: 3 matrix: - os: [ubuntu-latest, windows-latest] - python-version: ["3.10", "3.14"] + os: ${{ fromJSON(needs.compute-test-matrix.outputs.os) }} + python-version: ${{ fromJSON(needs.compute-test-matrix.outputs.python-version) }} steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 @@ -51,10 +78,33 @@ jobs: if: matrix.python-version == '3.10' && runner.os == 'Linux' run: hatch run fmt-check && hatch run test:types - - name: Run tests - run: hatch run test:cov-retry + - name: Run unit tests + run: hatch run test:unit-cov-retry + + # On PR: generates coverage comment artifact. On push to main: stores coverage baseline on data branch. + - name: Store unit tests coverage + if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name != 'schedule' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/azure_doc_intelligence + SUBPROJECT_ID: azure_doc_intelligence + COMMENT_ARTIFACT_NAME: coverage-comment-azure_doc_intelligence + + - name: Run integration tests + run: hatch run test:integration-cov-append-retry + + - name: Store combined coverage + if: github.event_name == 'push' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/azure_doc_intelligence + SUBPROJECT_ID: azure_doc_intelligence-combined + COMMENT_ARTIFACT_NAME: coverage-comment-azure_doc_intelligence-combined - name: Run unit tests with lowest direct dependencies + if: github.event_name != 'push' run: | hatch run uv pip compile pyproject.toml --resolution lowest-direct --output-file requirements_lowest_direct.txt hatch -e test env run -- uv pip install -r requirements_lowest_direct.txt diff --git a/.github/workflows/chroma.yml b/.github/workflows/chroma.yml index 1cb8ea7766..753ee53d72 100644 --- a/.github/workflows/chroma.yml +++ b/.github/workflows/chroma.yml @@ -10,28 +10,55 @@ on: - "integrations/chroma/**" - "!integrations/chroma/*.md" - ".github/workflows/chroma.yml" + push: + branches: + - main + paths: + - "integrations/chroma/**" + - "!integrations/chroma/*.md" + - ".github/workflows/chroma.yml" defaults: run: working-directory: integrations/chroma concurrency: - group: chroma-${{ github.head_ref }} + group: chroma-${{ github.head_ref || github.sha }} cancel-in-progress: true env: PYTHONUNBUFFERED: "1" FORCE_COLOR: "1" + TEST_MATRIX_OS: '["ubuntu-latest", "windows-latest", "macos-latest"]' + TEST_MATRIX_PYTHON: '["3.10", "3.14"]' jobs: + compute-test-matrix: + runs-on: ubuntu-slim + defaults: + run: + working-directory: . + outputs: + os: ${{ steps.set.outputs.os }} + python-version: ${{ steps.set.outputs.python-version }} + steps: + - id: set + run: | + echo 'os=${{ github.event_name == 'push' && '["ubuntu-latest"]' || env.TEST_MATRIX_OS }}' >> $GITHUB_OUTPUT + echo 'python-version=${{ github.event_name == 'push' && '["3.10"]' || env.TEST_MATRIX_PYTHON }}' >> $GITHUB_OUTPUT + run: name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} + needs: compute-test-matrix + permissions: + contents: write + pull-requests: write runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - python-version: ["3.10", "3.14"] + os: ${{ fromJSON(needs.compute-test-matrix.outputs.os) }} + python-version: ${{ fromJSON(needs.compute-test-matrix.outputs.python-version) }} steps: - name: Support longpaths @@ -57,10 +84,33 @@ jobs: if: matrix.os != 'windows-latest' run: hatch run chroma run & - - name: Run tests - run: hatch run test:cov-retry + - name: Run unit tests + run: hatch run test:unit-cov-retry + + # On PR: generates coverage comment artifact. On push to main: stores coverage baseline on data branch. + - name: Store unit tests coverage + if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name != 'schedule' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/chroma + SUBPROJECT_ID: chroma + COMMENT_ARTIFACT_NAME: coverage-comment-chroma + + - name: Run integration tests + run: hatch run test:integration-cov-append-retry + + - name: Store combined coverage + if: github.event_name == 'push' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/chroma + SUBPROJECT_ID: chroma-combined + COMMENT_ARTIFACT_NAME: coverage-comment-chroma-combined - name: Run unit tests with lowest direct dependencies + if: github.event_name != 'push' run: | hatch run uv pip compile pyproject.toml --resolution lowest-direct --output-file requirements_lowest_direct.txt hatch -e test env run -- uv pip install -r requirements_lowest_direct.txt diff --git a/.github/workflows/cohere.yml b/.github/workflows/cohere.yml index 8b6ce7cf9b..2b6b1bcbc2 100644 --- a/.github/workflows/cohere.yml +++ b/.github/workflows/cohere.yml @@ -10,29 +10,56 @@ on: - "integrations/cohere/**" - "!integrations/cohere/*.md" - ".github/workflows/cohere.yml" + push: + branches: + - main + paths: + - "integrations/cohere/**" + - "!integrations/cohere/*.md" + - ".github/workflows/cohere.yml" defaults: run: working-directory: integrations/cohere concurrency: - group: cohere-${{ github.head_ref }} + group: cohere-${{ github.head_ref || github.sha }} cancel-in-progress: true env: PYTHONUNBUFFERED: "1" FORCE_COLOR: "1" COHERE_API_KEY: ${{ secrets.COHERE_API_KEY }} + TEST_MATRIX_OS: '["ubuntu-latest", "windows-latest", "macos-latest"]' + TEST_MATRIX_PYTHON: '["3.10", "3.14"]' jobs: + compute-test-matrix: + runs-on: ubuntu-slim + defaults: + run: + working-directory: . + outputs: + os: ${{ steps.set.outputs.os }} + python-version: ${{ steps.set.outputs.python-version }} + steps: + - id: set + run: | + echo 'os=${{ github.event_name == 'push' && '["ubuntu-latest"]' || env.TEST_MATRIX_OS }}' >> $GITHUB_OUTPUT + echo 'python-version=${{ github.event_name == 'push' && '["3.10"]' || env.TEST_MATRIX_PYTHON }}' >> $GITHUB_OUTPUT + run: name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} + needs: compute-test-matrix + permissions: + contents: write + pull-requests: write runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - python-version: ["3.10", "3.14"] + os: ${{ fromJSON(needs.compute-test-matrix.outputs.os) }} + python-version: ${{ fromJSON(needs.compute-test-matrix.outputs.python-version) }} steps: - name: Support longpaths @@ -54,10 +81,33 @@ jobs: if: matrix.python-version == '3.10' && runner.os == 'Linux' run: hatch run fmt-check && hatch run test:types - - name: Run tests - run: hatch run test:cov-retry + - name: Run unit tests + run: hatch run test:unit-cov-retry + + # On PR: generates coverage comment artifact. On push to main: stores coverage baseline on data branch. + - name: Store unit tests coverage + if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name != 'schedule' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/cohere + SUBPROJECT_ID: cohere + COMMENT_ARTIFACT_NAME: coverage-comment-cohere + + - name: Run integration tests + run: hatch run test:integration-cov-append-retry + + - name: Store combined coverage + if: github.event_name == 'push' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/cohere + SUBPROJECT_ID: cohere-combined + COMMENT_ARTIFACT_NAME: coverage-comment-cohere-combined - name: Run unit tests with lowest direct dependencies + if: github.event_name != 'push' run: | hatch run uv pip compile pyproject.toml --resolution lowest-direct --output-file requirements_lowest_direct.txt hatch -e test env run -- uv pip install -r requirements_lowest_direct.txt diff --git a/.github/workflows/cometapi.yml b/.github/workflows/cometapi.yml index 28d671c28e..8ede1bb806 100644 --- a/.github/workflows/cometapi.yml +++ b/.github/workflows/cometapi.yml @@ -10,29 +10,56 @@ on: - "integrations/cometapi/**" - "!integrations/cometapi/*.md" - ".github/workflows/cometapi.yml" + push: + branches: + - main + paths: + - "integrations/cometapi/**" + - "!integrations/cometapi/*.md" + - ".github/workflows/cometapi.yml" defaults: run: working-directory: integrations/cometapi concurrency: - group: cometapi-${{ github.head_ref }} + group: cometapi-${{ github.head_ref || github.sha }} cancel-in-progress: true env: PYTHONUNBUFFERED: "1" FORCE_COLOR: "1" COMET_API_KEY: "${{ secrets.COMET_API_KEY }}" + TEST_MATRIX_OS: '["ubuntu-latest", "windows-latest", "macos-latest"]' + TEST_MATRIX_PYTHON: '["3.10", "3.14"]' jobs: + compute-test-matrix: + runs-on: ubuntu-slim + defaults: + run: + working-directory: . + outputs: + os: ${{ steps.set.outputs.os }} + python-version: ${{ steps.set.outputs.python-version }} + steps: + - id: set + run: | + echo 'os=${{ github.event_name == 'push' && '["ubuntu-latest"]' || env.TEST_MATRIX_OS }}' >> $GITHUB_OUTPUT + echo 'python-version=${{ github.event_name == 'push' && '["3.10"]' || env.TEST_MATRIX_PYTHON }}' >> $GITHUB_OUTPUT + run: name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} + needs: compute-test-matrix + permissions: + contents: write + pull-requests: write runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - python-version: ["3.10", "3.14"] + os: ${{ fromJSON(needs.compute-test-matrix.outputs.os) }} + python-version: ${{ fromJSON(needs.compute-test-matrix.outputs.python-version) }} max-parallel: 2 # to avoid "429 Resource has been exhausted" steps: @@ -54,10 +81,33 @@ jobs: if: matrix.python-version == '3.10' && runner.os == 'Linux' run: hatch run fmt-check && hatch run test:types - - name: Run tests - run: hatch run test:cov-retry + - name: Run unit tests + run: hatch run test:unit-cov-retry + + # On PR: generates coverage comment artifact. On push to main: stores coverage baseline on data branch. + - name: Store unit tests coverage + if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name != 'schedule' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/cometapi + SUBPROJECT_ID: cometapi + COMMENT_ARTIFACT_NAME: coverage-comment-cometapi + + - name: Run integration tests + run: hatch run test:integration-cov-append-retry + + - name: Store combined coverage + if: github.event_name == 'push' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/cometapi + SUBPROJECT_ID: cometapi-combined + COMMENT_ARTIFACT_NAME: coverage-comment-cometapi-combined - name: Run unit tests with lowest direct dependencies + if: github.event_name != 'push' run: | hatch run uv pip compile pyproject.toml --resolution lowest-direct --output-file requirements_lowest_direct.txt hatch -e test env run -- uv pip install -r requirements_lowest_direct.txt @@ -69,7 +119,8 @@ jobs: run: | hatch env prune hatch -e test env run -- uv pip install git+https://github.com/deepset-ai/haystack.git@main - hatch run test:cov-retry + hatch run test:unit-cov-retry + hatch run test:integration-cov-append-retry notify-slack-on-failure: needs: run diff --git a/.github/workflows/deepeval.yml b/.github/workflows/deepeval.yml index 84ee1feb64..d93c3cd4a0 100644 --- a/.github/workflows/deepeval.yml +++ b/.github/workflows/deepeval.yml @@ -10,29 +10,56 @@ on: - "integrations/deepeval/**" - "!integrations/deepeval/*.md" - ".github/workflows/deepeval.yml" + push: + branches: + - main + paths: + - "integrations/deepeval/**" + - "!integrations/deepeval/*.md" + - ".github/workflows/deepeval.yml" defaults: run: working-directory: integrations/deepeval concurrency: - group: deepeval-${{ github.head_ref }} + group: deepeval-${{ github.head_ref || github.sha }} cancel-in-progress: true env: PYTHONUNBUFFERED: "1" FORCE_COLOR: "1" OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + TEST_MATRIX_OS: '["ubuntu-latest", "windows-latest", "macos-latest"]' + TEST_MATRIX_PYTHON: '["3.10", "3.14"]' jobs: + compute-test-matrix: + runs-on: ubuntu-slim + defaults: + run: + working-directory: . + outputs: + os: ${{ steps.set.outputs.os }} + python-version: ${{ steps.set.outputs.python-version }} + steps: + - id: set + run: | + echo 'os=${{ github.event_name == 'push' && '["ubuntu-latest"]' || env.TEST_MATRIX_OS }}' >> $GITHUB_OUTPUT + echo 'python-version=${{ github.event_name == 'push' && '["3.10"]' || env.TEST_MATRIX_PYTHON }}' >> $GITHUB_OUTPUT + run: name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} + needs: compute-test-matrix + permissions: + contents: write + pull-requests: write runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - python-version: ["3.10", "3.14"] + os: ${{ fromJSON(needs.compute-test-matrix.outputs.os) }} + python-version: ${{ fromJSON(needs.compute-test-matrix.outputs.python-version) }} steps: - name: Support longpaths @@ -53,10 +80,33 @@ jobs: if: matrix.python-version == '3.10' && runner.os == 'Linux' run: hatch run fmt-check && hatch run test:types - - name: Run tests - run: hatch run test:cov-retry + - name: Run unit tests + run: hatch run test:unit-cov-retry + + # On PR: generates coverage comment artifact. On push to main: stores coverage baseline on data branch. + - name: Store unit tests coverage + if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name != 'schedule' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/deepeval + SUBPROJECT_ID: deepeval + COMMENT_ARTIFACT_NAME: coverage-comment-deepeval + + - name: Run integration tests + run: hatch run test:integration-cov-append-retry + + - name: Store combined coverage + if: github.event_name == 'push' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/deepeval + SUBPROJECT_ID: deepeval-combined + COMMENT_ARTIFACT_NAME: coverage-comment-deepeval-combined - name: Run unit tests with lowest direct dependencies + if: github.event_name != 'push' run: | hatch run uv pip compile pyproject.toml --resolution lowest-direct --output-file requirements_lowest_direct.txt hatch -e test env run -- uv pip install -r requirements_lowest_direct.txt diff --git a/.github/workflows/elasticsearch.yml b/.github/workflows/elasticsearch.yml index bf7072c8a4..fc82a14688 100644 --- a/.github/workflows/elasticsearch.yml +++ b/.github/workflows/elasticsearch.yml @@ -10,28 +10,55 @@ on: - "integrations/elasticsearch/**" - "!integrations/elasticsearch/*.md" - ".github/workflows/elasticsearch.yml" + push: + branches: + - main + paths: + - "integrations/elasticsearch/**" + - "!integrations/elasticsearch/*.md" + - ".github/workflows/elasticsearch.yml" defaults: run: working-directory: integrations/elasticsearch concurrency: - group: elasticsearch-${{ github.head_ref }} + group: elasticsearch-${{ github.head_ref || github.sha }} cancel-in-progress: true env: PYTHONUNBUFFERED: "1" FORCE_COLOR: "1" + TEST_MATRIX_OS: '["ubuntu-latest"]' + TEST_MATRIX_PYTHON: '["3.10", "3.14"]' jobs: + compute-test-matrix: + runs-on: ubuntu-slim + defaults: + run: + working-directory: . + outputs: + os: ${{ steps.set.outputs.os }} + python-version: ${{ steps.set.outputs.python-version }} + steps: + - id: set + run: | + echo 'os=${{ github.event_name == 'push' && '["ubuntu-latest"]' || env.TEST_MATRIX_OS }}' >> $GITHUB_OUTPUT + echo 'python-version=${{ github.event_name == 'push' && '["3.10"]' || env.TEST_MATRIX_PYTHON }}' >> $GITHUB_OUTPUT + run: name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} + needs: compute-test-matrix + permissions: + contents: write + pull-requests: write runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-latest] # we run Elasticsearch using Docker, which is not available on MacOS and Windows GitHub Runners - python-version: ["3.10", "3.14"] + os: ${{ fromJSON(needs.compute-test-matrix.outputs.os) }} + python-version: ${{ fromJSON(needs.compute-test-matrix.outputs.python-version) }} steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 @@ -51,10 +78,33 @@ jobs: - name: Run ElasticSearch container run: docker compose up -d - - name: Run tests - run: hatch run test:cov-retry + - name: Run unit tests + run: hatch run test:unit-cov-retry + + # On PR: generates coverage comment artifact. On push to main: stores coverage baseline on data branch. + - name: Store unit tests coverage + if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name != 'schedule' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/elasticsearch + SUBPROJECT_ID: elasticsearch + COMMENT_ARTIFACT_NAME: coverage-comment-elasticsearch + + - name: Run integration tests + run: hatch run test:integration-cov-append-retry + + - name: Store combined coverage + if: github.event_name == 'push' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/elasticsearch + SUBPROJECT_ID: elasticsearch-combined + COMMENT_ARTIFACT_NAME: coverage-comment-elasticsearch-combined - name: Run unit tests with lowest direct dependencies + if: github.event_name != 'push' run: | hatch run uv pip compile pyproject.toml --resolution lowest-direct --output-file requirements_lowest_direct.txt hatch -e test env run -- uv pip install -r requirements_lowest_direct.txt diff --git a/.github/workflows/faiss.yml b/.github/workflows/faiss.yml index 5974c9ec90..9cd95a9e6d 100644 --- a/.github/workflows/faiss.yml +++ b/.github/workflows/faiss.yml @@ -10,29 +10,56 @@ on: - "integrations/faiss/**" - "!integrations/faiss/*.md" - ".github/workflows/faiss.yml" + push: + branches: + - main + paths: + - "integrations/faiss/**" + - "!integrations/faiss/*.md" + - ".github/workflows/faiss.yml" concurrency: - group: faiss-${{ github.head_ref }} + group: faiss-${{ github.head_ref || github.sha }} cancel-in-progress: true env: PYTHONUNBUFFERED: "1" FORCE_COLOR: "1" + TEST_MATRIX_OS: '["ubuntu-latest"]' + TEST_MATRIX_PYTHON: '["3.10", "3.14"]' defaults: run: working-directory: integrations/faiss jobs: + compute-test-matrix: + runs-on: ubuntu-slim + defaults: + run: + working-directory: . + outputs: + os: ${{ steps.set.outputs.os }} + python-version: ${{ steps.set.outputs.python-version }} + steps: + - id: set + run: | + echo 'os=${{ github.event_name == 'push' && '["ubuntu-latest"]' || env.TEST_MATRIX_OS }}' >> $GITHUB_OUTPUT + echo 'python-version=${{ github.event_name == 'push' && '["3.10"]' || env.TEST_MATRIX_PYTHON }}' >> $GITHUB_OUTPUT + run: name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} + needs: compute-test-matrix + permissions: + contents: write + pull-requests: write runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: # FAISS wheels are most reliable on Linux in CI. - os: [ubuntu-latest] #[ubuntu-latest, windows-latest, macos-latest] - python-version: ["3.10", "3.14"] + os: ${{ fromJSON(needs.compute-test-matrix.outputs.os) }} + python-version: ${{ fromJSON(needs.compute-test-matrix.outputs.python-version) }} steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 @@ -49,8 +76,20 @@ jobs: if: matrix.python-version == '3.10' && runner.os == 'Linux' run: hatch run fmt-check && hatch run test:types - - name: Run tests - run: hatch run test:cov-retry + - name: Run unit tests + run: hatch run test:unit-cov-retry + + # On PR: generates coverage comment artifact. On push to main: stores coverage baseline on data branch. + - name: Store unit tests coverage + if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name != 'schedule' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/faiss + SUBPROJECT_ID: faiss + COMMENT_ARTIFACT_NAME: coverage-comment-faiss + + # No integration tests yet — add integration-cov-append-retry + combined coverage step when needed - name: Run unit tests with lowest direct dependencies if: matrix.python-version == '3.10' && runner.os == 'Linux' diff --git a/.github/workflows/fastembed.yml b/.github/workflows/fastembed.yml index ce96ef6cab..28103169c4 100644 --- a/.github/workflows/fastembed.yml +++ b/.github/workflows/fastembed.yml @@ -8,20 +8,51 @@ on: - "integrations/fastembed/**" - "!integrations/fastembed/*.md" - ".github/workflows/fastembed.yml" + push: + branches: + - main + paths: + - "integrations/fastembed/**" + - "!integrations/fastembed/*.md" + - ".github/workflows/fastembed.yml" defaults: run: working-directory: integrations/fastembed +env: + PYTHONUNBUFFERED: "1" + FORCE_COLOR: "1" + TEST_MATRIX_OS: '["ubuntu-latest", "windows-latest", "macos-latest"]' + TEST_MATRIX_PYTHON: '["3.10", "3.13"]' + jobs: + compute-test-matrix: + runs-on: ubuntu-slim + defaults: + run: + working-directory: . + outputs: + os: ${{ steps.set.outputs.os }} + python-version: ${{ steps.set.outputs.python-version }} + steps: + - id: set + run: | + echo 'os=${{ github.event_name == 'push' && '["ubuntu-latest"]' || env.TEST_MATRIX_OS }}' >> $GITHUB_OUTPUT + echo 'python-version=${{ github.event_name == 'push' && '["3.10"]' || env.TEST_MATRIX_PYTHON }}' >> $GITHUB_OUTPUT + run: name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} + needs: compute-test-matrix + permissions: + contents: write + pull-requests: write runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - python-version: ["3.10", "3.13"] + os: ${{ fromJSON(needs.compute-test-matrix.outputs.os) }} + python-version: ${{ fromJSON(needs.compute-test-matrix.outputs.python-version) }} steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 @@ -37,10 +68,33 @@ jobs: if: matrix.python-version == '3.10' && runner.os == 'Linux' run: hatch run fmt-check && hatch run test:types - - name: Run tests - run: hatch run test:cov-retry + - name: Run unit tests + run: hatch run test:unit-cov-retry + + # On PR: generates coverage comment artifact. On push to main: stores coverage baseline on data branch. + - name: Store unit tests coverage + if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name != 'schedule' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/fastembed + SUBPROJECT_ID: fastembed + COMMENT_ARTIFACT_NAME: coverage-comment-fastembed + + - name: Run integration tests + run: hatch run test:integration-cov-append-retry + + - name: Store combined coverage + if: github.event_name == 'push' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/fastembed + SUBPROJECT_ID: fastembed-combined + COMMENT_ARTIFACT_NAME: coverage-comment-fastembed-combined - name: Run unit tests with lowest direct dependencies + if: github.event_name != 'push' run: | hatch run uv pip compile pyproject.toml --resolution lowest-direct --output-file requirements_lowest_direct.txt hatch -e test env run -- uv pip install -r requirements_lowest_direct.txt diff --git a/.github/workflows/firecrawl.yml b/.github/workflows/firecrawl.yml index bf5362758f..3c7eaa5221 100644 --- a/.github/workflows/firecrawl.yml +++ b/.github/workflows/firecrawl.yml @@ -10,29 +10,56 @@ on: - "integrations/firecrawl/**" - "!integrations/firecrawl/*.md" - ".github/workflows/firecrawl.yml" + push: + branches: + - main + paths: + - "integrations/firecrawl/**" + - "!integrations/firecrawl/*.md" + - ".github/workflows/firecrawl.yml" concurrency: - group: firecrawl-${{ github.head_ref }} + group: firecrawl-${{ github.head_ref || github.sha }} cancel-in-progress: true env: PYTHONUNBUFFERED: "1" FORCE_COLOR: "1" FIRECRAWL_API_KEY: ${{ secrets.FIRECRAWL_API_KEY }} + TEST_MATRIX_OS: '["ubuntu-latest", "windows-latest", "macos-latest"]' + TEST_MATRIX_PYTHON: '["3.10", "3.14"]' defaults: run: working-directory: integrations/firecrawl jobs: + compute-test-matrix: + runs-on: ubuntu-slim + defaults: + run: + working-directory: . + outputs: + os: ${{ steps.set.outputs.os }} + python-version: ${{ steps.set.outputs.python-version }} + steps: + - id: set + run: | + echo 'os=${{ github.event_name == 'push' && '["ubuntu-latest"]' || env.TEST_MATRIX_OS }}' >> $GITHUB_OUTPUT + echo 'python-version=${{ github.event_name == 'push' && '["3.10"]' || env.TEST_MATRIX_PYTHON }}' >> $GITHUB_OUTPUT + run: name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} + needs: compute-test-matrix + permissions: + contents: write + pull-requests: write runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - python-version: ["3.10", "3.14"] + os: ${{ fromJSON(needs.compute-test-matrix.outputs.os) }} + python-version: ${{ fromJSON(needs.compute-test-matrix.outputs.python-version) }} steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 @@ -49,10 +76,33 @@ jobs: if: matrix.python-version == '3.10' && runner.os == 'Linux' run: hatch run fmt-check && hatch run test:types - - name: Run tests - run: hatch run test:cov-retry + - name: Run unit tests + run: hatch run test:unit-cov-retry + + # On PR: generates coverage comment artifact. On push to main: stores coverage baseline on data branch. + - name: Store unit tests coverage + if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name != 'schedule' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/firecrawl + SUBPROJECT_ID: firecrawl + COMMENT_ARTIFACT_NAME: coverage-comment-firecrawl + + - name: Run integration tests + run: hatch run test:integration-cov-append-retry + + - name: Store combined coverage + if: github.event_name == 'push' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/firecrawl + SUBPROJECT_ID: firecrawl-combined + COMMENT_ARTIFACT_NAME: coverage-comment-firecrawl-combined - name: Run unit tests with lowest direct dependencies + if: github.event_name != 'push' run: | hatch run uv pip compile pyproject.toml --resolution lowest-direct --output-file requirements_lowest_direct.txt hatch -e test env run -- uv pip install -r requirements_lowest_direct.txt diff --git a/.github/workflows/github.yml b/.github/workflows/github.yml index 71b787ec3f..ef2a56a04c 100644 --- a/.github/workflows/github.yml +++ b/.github/workflows/github.yml @@ -10,28 +10,55 @@ on: - "integrations/github/**" - "!integrations/github/*.md" - ".github/workflows/github.yml" + push: + branches: + - main + paths: + - "integrations/github/**" + - "!integrations/github/*.md" + - ".github/workflows/github.yml" defaults: run: working-directory: integrations/github concurrency: - group: github-${{ github.head_ref }} + group: github-${{ github.head_ref || github.sha }} cancel-in-progress: true env: PYTHONUNBUFFERED: "1" FORCE_COLOR: "1" + TEST_MATRIX_OS: '["ubuntu-latest", "windows-latest", "macos-latest"]' + TEST_MATRIX_PYTHON: '["3.10", "3.14"]' jobs: + compute-test-matrix: + runs-on: ubuntu-slim + defaults: + run: + working-directory: . + outputs: + os: ${{ steps.set.outputs.os }} + python-version: ${{ steps.set.outputs.python-version }} + steps: + - id: set + run: | + echo 'os=${{ github.event_name == 'push' && '["ubuntu-latest"]' || env.TEST_MATRIX_OS }}' >> $GITHUB_OUTPUT + echo 'python-version=${{ github.event_name == 'push' && '["3.10"]' || env.TEST_MATRIX_PYTHON }}' >> $GITHUB_OUTPUT + run: name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} + needs: compute-test-matrix + permissions: + contents: write + pull-requests: write runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - python-version: ["3.10", "3.14"] + os: ${{ fromJSON(needs.compute-test-matrix.outputs.os) }} + python-version: ${{ fromJSON(needs.compute-test-matrix.outputs.python-version) }} steps: - name: Support longpaths @@ -52,10 +79,23 @@ jobs: if: matrix.python-version == '3.10' && runner.os == 'Linux' run: hatch run fmt-check && hatch run test:types - - name: Run tests - run: hatch run test:cov-retry + - name: Run unit tests + run: hatch run test:unit-cov-retry + + # On PR: generates coverage comment artifact. On push to main: stores coverage baseline on data branch. + - name: Store unit tests coverage + if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name != 'schedule' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/github + SUBPROJECT_ID: github + COMMENT_ARTIFACT_NAME: coverage-comment-github + + # No integration tests yet — add integration-cov-append-retry + combined coverage step when needed - name: Run unit tests with lowest direct dependencies + if: github.event_name != 'push' run: | hatch run uv pip compile pyproject.toml --resolution lowest-direct --output-file requirements_lowest_direct.txt hatch -e test env run -- uv pip install -r requirements_lowest_direct.txt diff --git a/.github/workflows/google_genai.yml b/.github/workflows/google_genai.yml index c575b8add8..1a00528fab 100644 --- a/.github/workflows/google_genai.yml +++ b/.github/workflows/google_genai.yml @@ -10,29 +10,56 @@ on: - "integrations/google_genai/**" - "!integrations/google_genai/*.md" - ".github/workflows/google_genai.yml" + push: + branches: + - main + paths: + - "integrations/google_genai/**" + - "!integrations/google_genai/*.md" + - ".github/workflows/google_genai.yml" defaults: run: working-directory: integrations/google_genai concurrency: - group: google-genai-${{ github.head_ref }} + group: google-genai-${{ github.head_ref || github.sha }} cancel-in-progress: true env: PYTHONUNBUFFERED: "1" FORCE_COLOR: "1" GOOGLE_API_KEY: "${{ secrets.GOOGLE_API_KEY }}" + TEST_MATRIX_OS: '["ubuntu-latest", "windows-latest", "macos-latest"]' + TEST_MATRIX_PYTHON: '["3.10", "3.14"]' jobs: + compute-test-matrix: + runs-on: ubuntu-slim + defaults: + run: + working-directory: . + outputs: + os: ${{ steps.set.outputs.os }} + python-version: ${{ steps.set.outputs.python-version }} + steps: + - id: set + run: | + echo 'os=${{ github.event_name == 'push' && '["ubuntu-latest"]' || env.TEST_MATRIX_OS }}' >> $GITHUB_OUTPUT + echo 'python-version=${{ github.event_name == 'push' && '["3.10"]' || env.TEST_MATRIX_PYTHON }}' >> $GITHUB_OUTPUT + run: name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} + needs: compute-test-matrix + permissions: + contents: write + pull-requests: write runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - python-version: ["3.10", "3.14"] + os: ${{ fromJSON(needs.compute-test-matrix.outputs.os) }} + python-version: ${{ fromJSON(needs.compute-test-matrix.outputs.python-version) }} max-parallel: 2 # to avoid "429 Resource has been exhausted" steps: @@ -54,10 +81,33 @@ jobs: if: matrix.python-version == '3.10' && runner.os == 'Linux' run: hatch run fmt-check && hatch run test:types - - name: Run tests - run: hatch run test:cov-retry + - name: Run unit tests + run: hatch run test:unit-cov-retry + + # On PR: generates coverage comment artifact. On push to main: stores coverage baseline on data branch. + - name: Store unit tests coverage + if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name != 'schedule' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/google_genai + SUBPROJECT_ID: google_genai + COMMENT_ARTIFACT_NAME: coverage-comment-google_genai + + - name: Run integration tests + run: hatch run test:integration-cov-append-retry + + - name: Store combined coverage + if: github.event_name == 'push' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/google_genai + SUBPROJECT_ID: google_genai-combined + COMMENT_ARTIFACT_NAME: coverage-comment-google_genai-combined - name: Run unit tests with lowest direct dependencies + if: github.event_name != 'push' run: | hatch run uv pip compile pyproject.toml --resolution lowest-direct --output-file requirements_lowest_direct.txt hatch -e test env run -- uv pip install -r requirements_lowest_direct.txt diff --git a/.github/workflows/hanlp.yml b/.github/workflows/hanlp.yml index 337a15f995..d7dee4e605 100644 --- a/.github/workflows/hanlp.yml +++ b/.github/workflows/hanlp.yml @@ -10,28 +10,55 @@ on: - "integrations/hanlp/**" - "!integrations/hanlp/*.md" - ".github/workflows/hanlp.yml" + push: + branches: + - main + paths: + - "integrations/hanlp/**" + - "!integrations/hanlp/*.md" + - ".github/workflows/hanlp.yml" defaults: run: working-directory: integrations/hanlp concurrency: - group: hanlp-${{ github.head_ref }} + group: hanlp-${{ github.head_ref || github.sha }} cancel-in-progress: true env: PYTHONUNBUFFERED: "1" FORCE_COLOR: "1" + TEST_MATRIX_OS: '["ubuntu-latest", "windows-latest", "macos-latest"]' + TEST_MATRIX_PYTHON: '["3.10", "3.14"]' jobs: + compute-test-matrix: + runs-on: ubuntu-slim + defaults: + run: + working-directory: . + outputs: + os: ${{ steps.set.outputs.os }} + python-version: ${{ steps.set.outputs.python-version }} + steps: + - id: set + run: | + echo 'os=${{ github.event_name == 'push' && '["ubuntu-latest"]' || env.TEST_MATRIX_OS }}' >> $GITHUB_OUTPUT + echo 'python-version=${{ github.event_name == 'push' && '["3.10"]' || env.TEST_MATRIX_PYTHON }}' >> $GITHUB_OUTPUT + run: name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} + needs: compute-test-matrix + permissions: + contents: write + pull-requests: write runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - python-version: ["3.10", "3.14"] + os: ${{ fromJSON(needs.compute-test-matrix.outputs.os) }} + python-version: ${{ fromJSON(needs.compute-test-matrix.outputs.python-version) }} steps: - name: Support longpaths @@ -53,10 +80,33 @@ jobs: if: matrix.python-version == '3.10' && runner.os == 'Linux' run: hatch run fmt-check && hatch run test:types - - name: Run tests - run: hatch run test:cov-retry + - name: Run unit tests + run: hatch run test:unit-cov-retry + + # On PR: generates coverage comment artifact. On push to main: stores coverage baseline on data branch. + - name: Store unit tests coverage + if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name != 'schedule' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/hanlp + SUBPROJECT_ID: hanlp + COMMENT_ARTIFACT_NAME: coverage-comment-hanlp + + - name: Run integration tests + run: hatch run test:integration-cov-append-retry + + - name: Store combined coverage + if: github.event_name == 'push' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/hanlp + SUBPROJECT_ID: hanlp-combined + COMMENT_ARTIFACT_NAME: coverage-comment-hanlp-combined - name: Run unit tests with lowest direct dependencies + if: github.event_name != 'push' run: | hatch run uv pip compile pyproject.toml --resolution lowest-direct --output-file requirements_lowest_direct.txt hatch -e test env run -- uv pip install -r requirements_lowest_direct.txt diff --git a/.github/workflows/jina.yml b/.github/workflows/jina.yml index c79735bba8..258b85b92f 100644 --- a/.github/workflows/jina.yml +++ b/.github/workflows/jina.yml @@ -10,28 +10,55 @@ on: - "integrations/jina/**" - "!integrations/jina/*.md" - ".github/workflows/jina.yml" + push: + branches: + - main + paths: + - "integrations/jina/**" + - "!integrations/jina/*.md" + - ".github/workflows/jina.yml" defaults: run: working-directory: integrations/jina concurrency: - group: jina-${{ github.head_ref }} + group: jina-${{ github.head_ref || github.sha }} cancel-in-progress: true env: JINA_API_KEY: ${{ secrets.JINA_API_KEY }} PYTHONUNBUFFERED: "1" FORCE_COLOR: "1" + TEST_MATRIX_OS: '["ubuntu-latest", "windows-latest", "macos-latest"]' + TEST_MATRIX_PYTHON: '["3.10", "3.14"]' jobs: + compute-test-matrix: + runs-on: ubuntu-slim + defaults: + run: + working-directory: . + outputs: + os: ${{ steps.set.outputs.os }} + python-version: ${{ steps.set.outputs.python-version }} + steps: + - id: set + run: | + echo 'os=${{ github.event_name == 'push' && '["ubuntu-latest"]' || env.TEST_MATRIX_OS }}' >> $GITHUB_OUTPUT + echo 'python-version=${{ github.event_name == 'push' && '["3.10"]' || env.TEST_MATRIX_PYTHON }}' >> $GITHUB_OUTPUT + run: name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} + needs: compute-test-matrix + permissions: + contents: write + pull-requests: write runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - python-version: ["3.10", "3.14"] + os: ${{ fromJSON(needs.compute-test-matrix.outputs.os) }} + python-version: ${{ fromJSON(needs.compute-test-matrix.outputs.python-version) }} steps: - name: Support longpaths @@ -53,10 +80,33 @@ jobs: if: matrix.python-version == '3.10' && runner.os == 'Linux' run: hatch run fmt-check && hatch run test:types - - name: Run tests - run: hatch run test:cov-retry + - name: Run unit tests + run: hatch run test:unit-cov-retry + + # On PR: generates coverage comment artifact. On push to main: stores coverage baseline on data branch. + - name: Store unit tests coverage + if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name != 'schedule' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/jina + SUBPROJECT_ID: jina + COMMENT_ARTIFACT_NAME: coverage-comment-jina + + - name: Run integration tests + run: hatch run test:integration-cov-append-retry + + - name: Store combined coverage + if: github.event_name == 'push' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/jina + SUBPROJECT_ID: jina-combined + COMMENT_ARTIFACT_NAME: coverage-comment-jina-combined - name: Run unit tests with lowest direct dependencies + if: github.event_name != 'push' run: | hatch run uv pip compile pyproject.toml --resolution lowest-direct --output-file requirements_lowest_direct.txt hatch -e test env run -- uv pip install -r requirements_lowest_direct.txt diff --git a/.github/workflows/kreuzberg.yml b/.github/workflows/kreuzberg.yml index 55c4f060ba..a3b4d6afc9 100644 --- a/.github/workflows/kreuzberg.yml +++ b/.github/workflows/kreuzberg.yml @@ -44,8 +44,8 @@ jobs: steps: - id: set run: | - echo "os=${{ github.event_name == 'push' && '["ubuntu-latest"]' || env.TEST_MATRIX_OS }}" >> $GITHUB_OUTPUT - echo "python-version=${{ github.event_name == 'push' && '["3.10"]' || env.TEST_MATRIX_PYTHON }}" >> $GITHUB_OUTPUT + echo 'os=${{ github.event_name == 'push' && '["ubuntu-latest"]' || env.TEST_MATRIX_OS }}' >> $GITHUB_OUTPUT + echo 'python-version=${{ github.event_name == 'push' && '["3.10"]' || env.TEST_MATRIX_PYTHON }}' >> $GITHUB_OUTPUT run: name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} diff --git a/.github/workflows/langfuse.yml b/.github/workflows/langfuse.yml index 22289db4bd..3ef58d8c26 100644 --- a/.github/workflows/langfuse.yml +++ b/.github/workflows/langfuse.yml @@ -10,13 +10,20 @@ on: - "integrations/langfuse/**" - "!integrations/langfuse/*.md" - ".github/workflows/langfuse.yml" + push: + branches: + - main + paths: + - "integrations/langfuse/**" + - "!integrations/langfuse/*.md" + - ".github/workflows/langfuse.yml" defaults: run: working-directory: integrations/langfuse concurrency: - group: langfuse-${{ github.head_ref }} + group: langfuse-${{ github.head_ref || github.sha }} cancel-in-progress: true env: @@ -27,16 +34,36 @@ env: OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} COHERE_API_KEY: ${{ secrets.COHERE_API_KEY }} + TEST_MATRIX_OS: '["ubuntu-latest", "windows-latest", "macos-latest"]' + TEST_MATRIX_PYTHON: '["3.10", "3.13"]' jobs: + compute-test-matrix: + runs-on: ubuntu-slim + defaults: + run: + working-directory: . + outputs: + os: ${{ steps.set.outputs.os }} + python-version: ${{ steps.set.outputs.python-version }} + steps: + - id: set + run: | + echo 'os=${{ github.event_name == 'push' && '["ubuntu-latest"]' || env.TEST_MATRIX_OS }}' >> $GITHUB_OUTPUT + echo 'python-version=${{ github.event_name == 'push' && '["3.10"]' || env.TEST_MATRIX_PYTHON }}' >> $GITHUB_OUTPUT + run: name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} + needs: compute-test-matrix + permissions: + contents: write + pull-requests: write runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - python-version: ["3.10", "3.13"] + os: ${{ fromJSON(needs.compute-test-matrix.outputs.os) }} + python-version: ${{ fromJSON(needs.compute-test-matrix.outputs.python-version) }} steps: - name: Support longpaths @@ -60,10 +87,33 @@ jobs: if: matrix.python-version == '3.10' && runner.os == 'Linux' run: hatch run fmt-check && hatch run test:types - - name: Run tests - run: hatch run test:cov-retry + - name: Run unit tests + run: hatch run test:unit-cov-retry + + # On PR: generates coverage comment artifact. On push to main: stores coverage baseline on data branch. + - name: Store unit tests coverage + if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name != 'schedule' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/langfuse + SUBPROJECT_ID: langfuse + COMMENT_ARTIFACT_NAME: coverage-comment-langfuse + + - name: Run integration tests + run: hatch run test:integration-cov-append-retry + + - name: Store combined coverage + if: github.event_name == 'push' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/langfuse + SUBPROJECT_ID: langfuse-combined + COMMENT_ARTIFACT_NAME: coverage-comment-langfuse-combined - name: Run unit tests with lowest direct dependencies + if: github.event_name != 'push' run: | hatch run uv pip compile pyproject.toml --resolution lowest-direct --output-file requirements_lowest_direct.txt hatch -e test env run -- uv pip install -r requirements_lowest_direct.txt diff --git a/.github/workflows/lara.yml b/.github/workflows/lara.yml index bb1f11c268..9ef458ca20 100644 --- a/.github/workflows/lara.yml +++ b/.github/workflows/lara.yml @@ -10,9 +10,16 @@ on: - "integrations/lara/**" - "!integrations/lara/*.md" - ".github/workflows/lara.yml" + push: + branches: + - main + paths: + - "integrations/lara/**" + - "!integrations/lara/*.md" + - ".github/workflows/lara.yml" concurrency: - group: lara-${{ github.head_ref }} + group: lara-${{ github.head_ref || github.sha }} cancel-in-progress: true env: @@ -20,21 +27,41 @@ env: FORCE_COLOR: "1" LARA_ACCESS_KEY_ID: ${{ secrets.LARA_ACCESS_KEY_ID }} LARA_ACCESS_KEY_SECRET: ${{ secrets.LARA_ACCESS_KEY_SECRET }} + TEST_MATRIX_OS: '["ubuntu-latest", "windows-latest", "macos-latest"]' + TEST_MATRIX_PYTHON: '["3.10", "3.14"]' defaults: run: working-directory: integrations/lara jobs: + compute-test-matrix: + runs-on: ubuntu-slim + defaults: + run: + working-directory: . + outputs: + os: ${{ steps.set.outputs.os }} + python-version: ${{ steps.set.outputs.python-version }} + steps: + - id: set + run: | + echo 'os=${{ github.event_name == 'push' && '["ubuntu-latest"]' || env.TEST_MATRIX_OS }}' >> $GITHUB_OUTPUT + echo 'python-version=${{ github.event_name == 'push' && '["3.10"]' || env.TEST_MATRIX_PYTHON }}' >> $GITHUB_OUTPUT + run: name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} + needs: compute-test-matrix + permissions: + contents: write + pull-requests: write runs-on: ${{ matrix.os }} strategy: fail-fast: false max-parallel: 3 matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - python-version: ["3.10", "3.14"] + os: ${{ fromJSON(needs.compute-test-matrix.outputs.os) }} + python-version: ${{ fromJSON(needs.compute-test-matrix.outputs.python-version) }} steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 @@ -51,10 +78,33 @@ jobs: if: matrix.python-version == '3.10' && runner.os == 'Linux' run: hatch run fmt-check && hatch run test:types - - name: Run tests - run: hatch run test:cov-retry + - name: Run unit tests + run: hatch run test:unit-cov-retry + + # On PR: generates coverage comment artifact. On push to main: stores coverage baseline on data branch. + - name: Store unit tests coverage + if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name != 'schedule' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/lara + SUBPROJECT_ID: lara + COMMENT_ARTIFACT_NAME: coverage-comment-lara + + - name: Run integration tests + run: hatch run test:integration-cov-append-retry + + - name: Store combined coverage + if: github.event_name == 'push' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/lara + SUBPROJECT_ID: lara-combined + COMMENT_ARTIFACT_NAME: coverage-comment-lara-combined - name: Run unit tests with lowest direct dependencies + if: github.event_name != 'push' run: | hatch run uv pip compile pyproject.toml --resolution lowest-direct --output-file requirements_lowest_direct.txt hatch -e test env run -- uv pip install -r requirements_lowest_direct.txt diff --git a/.github/workflows/libreoffice.yml b/.github/workflows/libreoffice.yml index 987628b9a1..82eb076922 100644 --- a/.github/workflows/libreoffice.yml +++ b/.github/workflows/libreoffice.yml @@ -10,28 +10,55 @@ on: - "integrations/libreoffice/**" - "!integrations/libreoffice/*.md" - ".github/workflows/libreoffice.yml" + push: + branches: + - main + paths: + - "integrations/libreoffice/**" + - "!integrations/libreoffice/*.md" + - ".github/workflows/libreoffice.yml" defaults: run: working-directory: integrations/libreoffice concurrency: - group: libreoffice-${{ github.head_ref }} + group: libreoffice-${{ github.head_ref || github.sha }} cancel-in-progress: true env: PYTHONUNBUFFERED: "1" FORCE_COLOR: "1" + TEST_MATRIX_OS: '["ubuntu-latest", "windows-latest", "macos-latest"]' + TEST_MATRIX_PYTHON: '["3.10", "3.14"]' jobs: + compute-test-matrix: + runs-on: ubuntu-slim + defaults: + run: + working-directory: . + outputs: + os: ${{ steps.set.outputs.os }} + python-version: ${{ steps.set.outputs.python-version }} + steps: + - id: set + run: | + echo 'os=${{ github.event_name == 'push' && '["ubuntu-latest"]' || env.TEST_MATRIX_OS }}' >> $GITHUB_OUTPUT + echo 'python-version=${{ github.event_name == 'push' && '["3.10"]' || env.TEST_MATRIX_PYTHON }}' >> $GITHUB_OUTPUT + run: name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} + needs: compute-test-matrix + permissions: + contents: write + pull-requests: write runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - python-version: ["3.10", "3.14"] + os: ${{ fromJSON(needs.compute-test-matrix.outputs.os) }} + python-version: ${{ fromJSON(needs.compute-test-matrix.outputs.python-version) }} steps: - name: Support longpaths @@ -66,21 +93,44 @@ jobs: if: runner.os == 'macOS' run: brew install --cask libreoffice - - name: Run tests - run: hatch run test:cov-retry + - name: Run unit tests + run: hatch run test:unit-cov-retry + + # On PR: generates coverage comment artifact. On push to main: stores coverage baseline on data branch. + - name: Store unit tests coverage + if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name != 'schedule' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/libreoffice + SUBPROJECT_ID: libreoffice + COMMENT_ARTIFACT_NAME: coverage-comment-libreoffice + + - name: Run integration tests + run: hatch run test:integration-cov-append-retry + + - name: Store combined coverage + if: github.event_name == 'push' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/libreoffice + SUBPROJECT_ID: libreoffice-combined + COMMENT_ARTIFACT_NAME: coverage-comment-libreoffice-combined - name: Run unit tests with lowest direct dependencies + if: github.event_name != 'push' run: | hatch run uv pip compile pyproject.toml --resolution lowest-direct --output-file requirements_lowest_direct.txt hatch -e test env run -- uv pip install -r requirements_lowest_direct.txt hatch run test:unit - - name: Nightly - run tests with Haystack main branch + - name: Nightly - run unit tests with Haystack main branch if: github.event_name == 'schedule' run: | hatch env prune hatch -e test env run -- uv pip install git+https://github.com/deepset-ai/haystack.git@main - hatch run test:cov-retry + hatch run test:unit notify-slack-on-failure: diff --git a/.github/workflows/llama_cpp.yml b/.github/workflows/llama_cpp.yml index aad41d514b..156aadf688 100644 --- a/.github/workflows/llama_cpp.yml +++ b/.github/workflows/llama_cpp.yml @@ -10,40 +10,62 @@ on: - "integrations/llama_cpp/**" - "!integrations/llama_cpp/*.md" - ".github/workflows/llama_cpp.yml" + push: + branches: + - main + paths: + - "integrations/llama_cpp/**" + - "!integrations/llama_cpp/*.md" + - ".github/workflows/llama_cpp.yml" defaults: run: working-directory: integrations/llama_cpp concurrency: - group: llama_cpp-${{ github.head_ref }} + group: llama_cpp-${{ github.head_ref || github.sha }} cancel-in-progress: true env: PYTHONUNBUFFERED: "1" FORCE_COLOR: "1" + TEST_MATRIX_OS: '["ubuntu-latest", "windows-latest", "macos-latest"]' + TEST_MATRIX_PYTHON: '["3.10", "3.14"]' jobs: + compute-test-matrix: + runs-on: ubuntu-slim + defaults: + run: + working-directory: . + outputs: + os: ${{ steps.set.outputs.os }} + python-version: ${{ steps.set.outputs.python-version }} + steps: + - id: set + run: | + echo 'os=${{ github.event_name == 'push' && '["ubuntu-latest"]' || env.TEST_MATRIX_OS }}' >> $GITHUB_OUTPUT + echo 'python-version=${{ github.event_name == 'push' && '["3.10"]' || env.TEST_MATRIX_PYTHON }}' >> $GITHUB_OUTPUT + run: name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} + needs: compute-test-matrix + permissions: + contents: write + pull-requests: write runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - include: - - os: ubuntu-latest - python-version: "3.10" - - os: ubuntu-latest - python-version: "3.14" - - os: windows-latest - python-version: "3.10" - - os: windows-latest - python-version: "3.14" - - # on macOS, we test with 3.10 and 3.12 because pre-built wheels are only available for these Python versions - # and installing from source might fail due to missing dependencies (CMake fails with "OpenMP not found") + os: ${{ fromJSON(needs.compute-test-matrix.outputs.os) }} + python-version: ${{ fromJSON(needs.compute-test-matrix.outputs.python-version) }} + exclude: + # on macOS, pre-built wheels for 3.14 are not available and installing from source + # might fail due to missing dependencies (CMake fails with "OpenMP not found") - os: macos-latest - python-version: "3.10" + python-version: "3.14" + include: + # on macOS, we test with 3.12 because pre-built wheels are available for this version - os: macos-latest python-version: "3.12" @@ -67,10 +89,33 @@ jobs: if: matrix.python-version == '3.10' && runner.os == 'Linux' run: hatch run fmt-check && hatch run test:types - - name: Run tests - run: hatch run test:cov-retry + - name: Run unit tests + run: hatch run test:unit-cov-retry + + # On PR: generates coverage comment artifact. On push to main: stores coverage baseline on data branch. + - name: Store unit tests coverage + if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name != 'schedule' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/llama_cpp + SUBPROJECT_ID: llama_cpp + COMMENT_ARTIFACT_NAME: coverage-comment-llama_cpp + + - name: Run integration tests + run: hatch run test:integration-cov-append-retry + + - name: Store combined coverage + if: github.event_name == 'push' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/llama_cpp + SUBPROJECT_ID: llama_cpp-combined + COMMENT_ARTIFACT_NAME: coverage-comment-llama_cpp-combined - name: Run unit tests with lowest direct dependencies + if: github.event_name != 'push' run: | hatch run uv pip compile pyproject.toml --resolution lowest-direct --output-file requirements_lowest_direct.txt hatch -e test env run -- uv pip install -r requirements_lowest_direct.txt diff --git a/.github/workflows/llama_stack.yml b/.github/workflows/llama_stack.yml index 87c44244ed..5c072d1c88 100644 --- a/.github/workflows/llama_stack.yml +++ b/.github/workflows/llama_stack.yml @@ -10,28 +10,55 @@ on: - "integrations/llama_stack/**" - "!integrations/llama_stack/*.md" - ".github/workflows/llama_stack.yml" + push: + branches: + - main + paths: + - "integrations/llama_stack/**" + - "!integrations/llama_stack/*.md" + - ".github/workflows/llama_stack.yml" defaults: run: working-directory: integrations/llama_stack concurrency: - group: llama_stack-${{ github.head_ref }} + group: llama_stack-${{ github.head_ref || github.sha }} cancel-in-progress: true env: PYTHONUNBUFFERED: "1" FORCE_COLOR: "1" + TEST_MATRIX_OS: '["ubuntu-latest"]' + TEST_MATRIX_PYTHON: '["3.12", "3.14"]' jobs: + compute-test-matrix: + runs-on: ubuntu-slim + defaults: + run: + working-directory: . + outputs: + os: ${{ steps.set.outputs.os }} + python-version: ${{ steps.set.outputs.python-version }} + steps: + - id: set + run: | + echo 'os=${{ github.event_name == 'push' && '["ubuntu-latest"]' || env.TEST_MATRIX_OS }}' >> $GITHUB_OUTPUT + echo 'python-version=${{ github.event_name == 'push' && '["3.10"]' || env.TEST_MATRIX_PYTHON }}' >> $GITHUB_OUTPUT + run: name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} + needs: compute-test-matrix + permissions: + contents: write + pull-requests: write runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-latest] # to test on other Operating Systems, we need to install Ollama differently - python-version: ["3.12", "3.14"] + os: ${{ fromJSON(needs.compute-test-matrix.outputs.os) }} + python-version: ${{ fromJSON(needs.compute-test-matrix.outputs.python-version) }} steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 @@ -116,10 +143,33 @@ jobs: if: matrix.python-version == '3.12' && runner.os == 'Linux' run: hatch run fmt-check && hatch run test:types - - name: Run tests - run: hatch run test:cov-retry + - name: Run unit tests + run: hatch run test:unit-cov-retry + + # On PR: generates coverage comment artifact. On push to main: stores coverage baseline on data branch. + - name: Store unit tests coverage + if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name != 'schedule' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/llama_stack + SUBPROJECT_ID: llama_stack + COMMENT_ARTIFACT_NAME: coverage-comment-llama_stack + + - name: Run integration tests + run: hatch run test:integration-cov-append-retry + + - name: Store combined coverage + if: github.event_name == 'push' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/llama_stack + SUBPROJECT_ID: llama_stack-combined + COMMENT_ARTIFACT_NAME: coverage-comment-llama_stack-combined - name: Run unit tests with lowest direct dependencies + if: github.event_name != 'push' run: | hatch run uv pip compile pyproject.toml --resolution lowest-direct --output-file requirements_lowest_direct.txt hatch -e test env run -- uv pip install -r requirements_lowest_direct.txt @@ -131,7 +181,8 @@ jobs: run: | hatch env prune hatch -e test env run -- uv pip install git+https://github.com/deepset-ai/haystack.git@main - hatch run test:cov-retry + hatch run test:unit-cov-retry + hatch run test:integration-cov-append-retry notify-slack-on-failure: needs: run diff --git a/.github/workflows/markitdown.yml b/.github/workflows/markitdown.yml index a9cc5f1107..c9c01acc35 100644 --- a/.github/workflows/markitdown.yml +++ b/.github/workflows/markitdown.yml @@ -10,28 +10,55 @@ on: - "integrations/markitdown/**" - "!integrations/markitdown/*.md" - ".github/workflows/markitdown.yml" + push: + branches: + - main + paths: + - "integrations/markitdown/**" + - "!integrations/markitdown/*.md" + - ".github/workflows/markitdown.yml" defaults: run: working-directory: integrations/markitdown concurrency: - group: markitdown-${{ github.head_ref }} + group: markitdown-${{ github.head_ref || github.sha }} cancel-in-progress: true env: PYTHONUNBUFFERED: "1" FORCE_COLOR: "1" + TEST_MATRIX_OS: '["ubuntu-latest", "windows-latest", "macos-latest"]' + TEST_MATRIX_PYTHON: '["3.10", "3.14"]' jobs: + compute-test-matrix: + runs-on: ubuntu-slim + defaults: + run: + working-directory: . + outputs: + os: ${{ steps.set.outputs.os }} + python-version: ${{ steps.set.outputs.python-version }} + steps: + - id: set + run: | + echo 'os=${{ github.event_name == 'push' && '["ubuntu-latest"]' || env.TEST_MATRIX_OS }}' >> $GITHUB_OUTPUT + echo 'python-version=${{ github.event_name == 'push' && '["3.10"]' || env.TEST_MATRIX_PYTHON }}' >> $GITHUB_OUTPUT + run: name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} + needs: compute-test-matrix + permissions: + contents: write + pull-requests: write runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - python-version: ["3.10", "3.14"] + os: ${{ fromJSON(needs.compute-test-matrix.outputs.os) }} + python-version: ${{ fromJSON(needs.compute-test-matrix.outputs.python-version) }} steps: - name: Support longpaths @@ -52,21 +79,44 @@ jobs: if: matrix.python-version == '3.10' && runner.os == 'Linux' run: hatch run fmt-check && hatch run test:types - - name: Run tests - run: hatch run test:cov-retry + - name: Run unit tests + run: hatch run test:unit-cov-retry + + # On PR: generates coverage comment artifact. On push to main: stores coverage baseline on data branch. + - name: Store unit tests coverage + if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name != 'schedule' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/markitdown + SUBPROJECT_ID: markitdown + COMMENT_ARTIFACT_NAME: coverage-comment-markitdown + + - name: Run integration tests + run: hatch run test:integration-cov-append-retry + + - name: Store combined coverage + if: github.event_name == 'push' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/markitdown + SUBPROJECT_ID: markitdown-combined + COMMENT_ARTIFACT_NAME: coverage-comment-markitdown-combined - name: Run unit tests with lowest direct dependencies + if: github.event_name != 'push' run: | hatch run uv pip compile pyproject.toml --resolution lowest-direct --output-file requirements_lowest_direct.txt hatch -e test env run -- uv pip install -r requirements_lowest_direct.txt hatch run test:unit - - name: Nightly - run tests with Haystack main branch + - name: Nightly - run unit tests with Haystack main branch if: github.event_name == 'schedule' run: | hatch env prune hatch -e test env run -- uv pip install git+https://github.com/deepset-ai/haystack.git@main - hatch run test:cov-retry + hatch run test:unit notify-slack-on-failure: diff --git a/.github/workflows/mcp.yml b/.github/workflows/mcp.yml index b272e25dab..26761fa41d 100644 --- a/.github/workflows/mcp.yml +++ b/.github/workflows/mcp.yml @@ -10,13 +10,20 @@ on: - "integrations/mcp/**" - "!integrations/mcp/*.md" - ".github/workflows/mcp.yml" + push: + branches: + - main + paths: + - "integrations/mcp/**" + - "!integrations/mcp/*.md" + - ".github/workflows/mcp.yml" defaults: run: working-directory: integrations/mcp concurrency: - group: mcp-${{ github.head_ref }} + group: mcp-${{ github.head_ref || github.sha }} cancel-in-progress: true env: @@ -24,16 +31,36 @@ env: FORCE_COLOR: "1" BRAVE_API_KEY: ${{ secrets.BRAVE_API_KEY }} OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + TEST_MATRIX_OS: '["ubuntu-latest", "macos-latest", "windows-latest"]' + TEST_MATRIX_PYTHON: '["3.10", "3.14"]' jobs: + compute-test-matrix: + runs-on: ubuntu-slim + defaults: + run: + working-directory: . + outputs: + os: ${{ steps.set.outputs.os }} + python-version: ${{ steps.set.outputs.python-version }} + steps: + - id: set + run: | + echo 'os=${{ github.event_name == 'push' && '["ubuntu-latest"]' || env.TEST_MATRIX_OS }}' >> $GITHUB_OUTPUT + echo 'python-version=${{ github.event_name == 'push' && '["3.10"]' || env.TEST_MATRIX_PYTHON }}' >> $GITHUB_OUTPUT + run: name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} + needs: compute-test-matrix + permissions: + contents: write + pull-requests: write runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - python-version: ["3.10", "3.14"] # MCP Python SDK is not compatible with Python<3.10 + os: ${{ fromJSON(needs.compute-test-matrix.outputs.os) }} + python-version: ${{ fromJSON(needs.compute-test-matrix.outputs.python-version) }} steps: - name: Support longpaths @@ -67,10 +94,33 @@ jobs: if: matrix.python-version == '3.10' && runner.os == 'Linux' run: hatch run fmt-check && hatch run test:types - - name: Run tests - run: hatch run test:cov-retry + - name: Run unit tests + run: hatch run test:unit-cov-retry + + # On PR: generates coverage comment artifact. On push to main: stores coverage baseline on data branch. + - name: Store unit tests coverage + if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name != 'schedule' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/mcp + SUBPROJECT_ID: mcp + COMMENT_ARTIFACT_NAME: coverage-comment-mcp + + - name: Run integration tests + run: hatch run test:integration-cov-append-retry + + - name: Store combined coverage + if: github.event_name == 'push' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/mcp + SUBPROJECT_ID: mcp-combined + COMMENT_ARTIFACT_NAME: coverage-comment-mcp-combined - name: Run unit tests with lowest direct dependencies + if: github.event_name != 'push' run: | hatch run uv pip compile pyproject.toml --resolution lowest-direct --output-file requirements_lowest_direct.txt hatch -e test env run -- uv pip install -r requirements_lowest_direct.txt diff --git a/.github/workflows/meta_llama.yml b/.github/workflows/meta_llama.yml index 0aec9ac8b8..cf7d47eedf 100644 --- a/.github/workflows/meta_llama.yml +++ b/.github/workflows/meta_llama.yml @@ -10,29 +10,56 @@ on: - 'integrations/meta_llama/**' - '!integrations/meta_llama/*.md' - '.github/workflows/meta_llama.yml' + push: + branches: + - main + paths: + - 'integrations/meta_llama/**' + - '!integrations/meta_llama/*.md' + - '.github/workflows/meta_llama.yml' defaults: run: working-directory: integrations/meta_llama concurrency: - group: meta-llama-${{ github.head_ref }} + group: meta-llama-${{ github.head_ref || github.sha }} cancel-in-progress: true env: PYTHONUNBUFFERED: '1' FORCE_COLOR: '1' LLAMA_API_KEY: ${{ secrets.LLAMA_API_KEY }} + TEST_MATRIX_OS: '["ubuntu-latest", "windows-latest", "macos-latest"]' + TEST_MATRIX_PYTHON: '["3.10", "3.14"]' jobs: + compute-test-matrix: + runs-on: ubuntu-slim + defaults: + run: + working-directory: . + outputs: + os: ${{ steps.set.outputs.os }} + python-version: ${{ steps.set.outputs.python-version }} + steps: + - id: set + run: | + echo 'os=${{ github.event_name == 'push' && '["ubuntu-latest"]' || env.TEST_MATRIX_OS }}' >> $GITHUB_OUTPUT + echo 'python-version=${{ github.event_name == 'push' && '["3.10"]' || env.TEST_MATRIX_PYTHON }}' >> $GITHUB_OUTPUT + run: name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} + needs: compute-test-matrix + permissions: + contents: write + pull-requests: write runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - python-version: ["3.10", "3.14"] + os: ${{ fromJSON(needs.compute-test-matrix.outputs.os) }} + python-version: ${{ fromJSON(needs.compute-test-matrix.outputs.python-version) }} max-parallel: 2 # to avoid rate limiting steps: @@ -54,10 +81,33 @@ jobs: if: matrix.python-version == '3.10' && runner.os == 'Linux' run: hatch run fmt-check && hatch run test:types - - name: Run tests - run: hatch run test:cov-retry + - name: Run unit tests + run: hatch run test:unit-cov-retry + + # On PR: generates coverage comment artifact. On push to main: stores coverage baseline on data branch. + - name: Store unit tests coverage + if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name != 'schedule' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/meta_llama + SUBPROJECT_ID: meta_llama + COMMENT_ARTIFACT_NAME: coverage-comment-meta_llama + + - name: Run integration tests + run: hatch run test:integration-cov-append-retry + + - name: Store combined coverage + if: github.event_name == 'push' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/meta_llama + SUBPROJECT_ID: meta_llama-combined + COMMENT_ARTIFACT_NAME: coverage-comment-meta_llama-combined - name: Run unit tests with lowest direct dependencies + if: github.event_name != 'push' run: | hatch run uv pip compile pyproject.toml --resolution lowest-direct --output-file requirements_lowest_direct.txt hatch -e test env run -- uv pip install -r requirements_lowest_direct.txt @@ -69,7 +119,8 @@ jobs: run: | hatch env prune hatch -e test env run -- uv pip install git+https://github.com/deepset-ai/haystack.git@main - hatch run test:cov-retry + hatch run test:unit-cov-retry + hatch run test:integration-cov-append-retry notify-slack-on-failure: needs: run diff --git a/.github/workflows/mistral.yml b/.github/workflows/mistral.yml index af38fcea27..348fd0923a 100644 --- a/.github/workflows/mistral.yml +++ b/.github/workflows/mistral.yml @@ -10,29 +10,56 @@ on: - "integrations/mistral/**" - "!integrations/mistral/*.md" - ".github/workflows/mistral.yml" + push: + branches: + - main + paths: + - "integrations/mistral/**" + - "!integrations/mistral/*.md" + - ".github/workflows/mistral.yml" defaults: run: working-directory: integrations/mistral concurrency: - group: mistral-${{ github.head_ref }} + group: mistral-${{ github.head_ref || github.sha }} cancel-in-progress: true env: PYTHONUNBUFFERED: "1" FORCE_COLOR: "1" MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }} + TEST_MATRIX_OS: '["ubuntu-latest", "windows-latest", "macos-latest"]' + TEST_MATRIX_PYTHON: '["3.10", "3.14"]' jobs: + compute-test-matrix: + runs-on: ubuntu-slim + defaults: + run: + working-directory: . + outputs: + os: ${{ steps.set.outputs.os }} + python-version: ${{ steps.set.outputs.python-version }} + steps: + - id: set + run: | + echo 'os=${{ github.event_name == 'push' && '["ubuntu-latest"]' || env.TEST_MATRIX_OS }}' >> $GITHUB_OUTPUT + echo 'python-version=${{ github.event_name == 'push' && '["3.10"]' || env.TEST_MATRIX_PYTHON }}' >> $GITHUB_OUTPUT + run: name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} + needs: compute-test-matrix + permissions: + contents: write + pull-requests: write runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - python-version: ["3.10", "3.14"] + os: ${{ fromJSON(needs.compute-test-matrix.outputs.os) }} + python-version: ${{ fromJSON(needs.compute-test-matrix.outputs.python-version) }} steps: - name: Support longpaths @@ -54,10 +81,33 @@ jobs: if: matrix.python-version == '3.10' && runner.os == 'Linux' run: hatch run fmt-check && hatch run test:types - - name: Run tests - run: hatch run test:cov-retry + - name: Run unit tests + run: hatch run test:unit-cov-retry + + # On PR: generates coverage comment artifact. On push to main: stores coverage baseline on data branch. + - name: Store unit tests coverage + if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name != 'schedule' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/mistral + SUBPROJECT_ID: mistral + COMMENT_ARTIFACT_NAME: coverage-comment-mistral + + - name: Run integration tests + run: hatch run test:integration-cov-append-retry + + - name: Store combined coverage + if: github.event_name == 'push' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/mistral + SUBPROJECT_ID: mistral-combined + COMMENT_ARTIFACT_NAME: coverage-comment-mistral-combined - name: Run unit tests with lowest direct dependencies + if: github.event_name != 'push' run: | hatch run uv pip compile pyproject.toml --resolution lowest-direct --output-file requirements_lowest_direct.txt hatch -e test env run -- uv pip install -r requirements_lowest_direct.txt @@ -69,7 +119,8 @@ jobs: run: | hatch env prune hatch -e test env run -- uv pip install git+https://github.com/deepset-ai/haystack.git@main - hatch run test:cov-retry + hatch run test:unit-cov-retry + hatch run test:integration-cov-append-retry notify-slack-on-failure: needs: run diff --git a/.github/workflows/mongodb_atlas.yml b/.github/workflows/mongodb_atlas.yml index c232f98c73..7fc1e32c04 100644 --- a/.github/workflows/mongodb_atlas.yml +++ b/.github/workflows/mongodb_atlas.yml @@ -10,13 +10,20 @@ on: - 'integrations/mongodb_atlas/**' - '!integrations/mongodb_atlas/*.md' - '.github/workflows/mongodb_atlas.yml' + push: + branches: + - main + paths: + - 'integrations/mongodb_atlas/**' + - '!integrations/mongodb_atlas/*.md' + - '.github/workflows/mongodb_atlas.yml' defaults: run: working-directory: integrations/mongodb_atlas concurrency: - group: mongodb-atlas-${{ github.head_ref }} + group: mongodb-atlas-${{ github.head_ref || github.sha }} cancel-in-progress: true env: @@ -24,16 +31,36 @@ env: FORCE_COLOR: '1' MONGO_CONNECTION_STRING: ${{ secrets.MONGO_CONNECTION_STRING }} MONGO_CONNECTION_STRING_2: ${{ secrets.MONGO_CONNECTION_STRING_2 }} + TEST_MATRIX_OS: '["ubuntu-latest", "windows-latest", "macos-latest"]' + TEST_MATRIX_PYTHON: '["3.10", "3.14"]' jobs: + compute-test-matrix: + runs-on: ubuntu-slim + defaults: + run: + working-directory: . + outputs: + os: ${{ steps.set.outputs.os }} + python-version: ${{ steps.set.outputs.python-version }} + steps: + - id: set + run: | + echo 'os=${{ github.event_name == 'push' && '["ubuntu-latest"]' || env.TEST_MATRIX_OS }}' >> $GITHUB_OUTPUT + echo 'python-version=${{ github.event_name == 'push' && '["3.10"]' || env.TEST_MATRIX_PYTHON }}' >> $GITHUB_OUTPUT + run: name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} + needs: compute-test-matrix + permissions: + contents: write + pull-requests: write runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - python-version: ["3.10", "3.14"] + os: ${{ fromJSON(needs.compute-test-matrix.outputs.os) }} + python-version: ${{ fromJSON(needs.compute-test-matrix.outputs.python-version) }} steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 @@ -50,10 +77,33 @@ jobs: if: matrix.python-version == '3.10' && runner.os == 'Linux' run: hatch run fmt-check && hatch run test:types - - name: Run tests - run: hatch run test:cov-retry + - name: Run unit tests + run: hatch run test:unit-cov-retry + + # On PR: generates coverage comment artifact. On push to main: stores coverage baseline on data branch. + - name: Store unit tests coverage + if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name != 'schedule' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/mongodb_atlas + SUBPROJECT_ID: mongodb_atlas + COMMENT_ARTIFACT_NAME: coverage-comment-mongodb_atlas + + - name: Run integration tests + run: hatch run test:integration-cov-append-retry + + - name: Store combined coverage + if: github.event_name == 'push' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/mongodb_atlas + SUBPROJECT_ID: mongodb_atlas-combined + COMMENT_ARTIFACT_NAME: coverage-comment-mongodb_atlas-combined - name: Run unit tests with lowest direct dependencies + if: github.event_name != 'push' run: | hatch run uv pip compile pyproject.toml --resolution lowest-direct --output-file requirements_lowest_direct.txt hatch -e test env run -- uv pip install -r requirements_lowest_direct.txt diff --git a/.github/workflows/nvidia.yml b/.github/workflows/nvidia.yml index b41875e64b..2a0d7ec714 100644 --- a/.github/workflows/nvidia.yml +++ b/.github/workflows/nvidia.yml @@ -10,13 +10,20 @@ on: - "integrations/nvidia/**" - "!integrations/nvidia/*.md" - ".github/workflows/nvidia.yml" + push: + branches: + - main + paths: + - "integrations/nvidia/**" + - "!integrations/nvidia/*.md" + - ".github/workflows/nvidia.yml" defaults: run: working-directory: integrations/nvidia concurrency: - group: nvidia-${{ github.head_ref }} + group: nvidia-${{ github.head_ref || github.sha }} cancel-in-progress: true env: @@ -24,16 +31,36 @@ env: FORCE_COLOR: "1" NVIDIA_API_KEY: ${{ secrets.NVIDIA_API_KEY }} NVIDIA_CATALOG_API_KEY: ${{ secrets.NVIDIA_CATALOG_API_KEY }} + TEST_MATRIX_OS: '["ubuntu-latest", "windows-latest", "macos-latest"]' + TEST_MATRIX_PYTHON: '["3.10"]' jobs: + compute-test-matrix: + runs-on: ubuntu-slim + defaults: + run: + working-directory: . + outputs: + os: ${{ steps.set.outputs.os }} + python-version: ${{ steps.set.outputs.python-version }} + steps: + - id: set + run: | + echo 'os=${{ github.event_name == 'push' && '["ubuntu-latest"]' || env.TEST_MATRIX_OS }}' >> $GITHUB_OUTPUT + echo 'python-version=${{ github.event_name == 'push' && '["3.10"]' || env.TEST_MATRIX_PYTHON }}' >> $GITHUB_OUTPUT + run: name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} + needs: compute-test-matrix + permissions: + contents: write + pull-requests: write runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - python-version: ["3.10"] # we don't test on other python versions to reduce API calls + os: ${{ fromJSON(needs.compute-test-matrix.outputs.os) }} + python-version: ${{ fromJSON(needs.compute-test-matrix.outputs.python-version) }} steps: - name: Support longpaths @@ -55,10 +82,33 @@ jobs: if: matrix.python-version == '3.10' && runner.os == 'Linux' run: hatch run fmt-check && hatch run test:types - - name: Run tests - run: hatch run test:cov-retry + - name: Run unit tests + run: hatch run test:unit-cov-retry + + # On PR: generates coverage comment artifact. On push to main: stores coverage baseline on data branch. + - name: Store unit tests coverage + if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name != 'schedule' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/nvidia + SUBPROJECT_ID: nvidia + COMMENT_ARTIFACT_NAME: coverage-comment-nvidia + + - name: Run integration tests + run: hatch run test:integration-cov-append-retry + + - name: Store combined coverage + if: github.event_name == 'push' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/nvidia + SUBPROJECT_ID: nvidia-combined + COMMENT_ARTIFACT_NAME: coverage-comment-nvidia-combined - name: Run unit tests with lowest direct dependencies + if: github.event_name != 'push' run: | hatch run uv pip compile pyproject.toml --resolution lowest-direct --output-file requirements_lowest_direct.txt hatch -e test env run -- uv pip install -r requirements_lowest_direct.txt @@ -70,7 +120,8 @@ jobs: run: | hatch env prune hatch -e test env run -- uv pip install git+https://github.com/deepset-ai/haystack.git@main - hatch run test:cov-retry + hatch run test:unit-cov-retry + hatch run test:integration-cov-append-retry notify-slack-on-failure: needs: run diff --git a/.github/workflows/ollama.yml b/.github/workflows/ollama.yml index a8cc1ad3f3..36dcaa8c0a 100644 --- a/.github/workflows/ollama.yml +++ b/.github/workflows/ollama.yml @@ -10,13 +10,20 @@ on: - "integrations/ollama/**" - "!integrations/ollama/*.md" - ".github/workflows/ollama.yml" + push: + branches: + - main + paths: + - "integrations/ollama/**" + - "!integrations/ollama/*.md" + - ".github/workflows/ollama.yml" defaults: run: working-directory: integrations/ollama concurrency: - group: ollama-${{ github.head_ref }} + group: ollama-${{ github.head_ref || github.sha }} cancel-in-progress: true env: @@ -25,16 +32,36 @@ env: LLM_FOR_TESTS: "qwen3:0.6b" VISION_LLM_FOR_TESTS: "moondream:1.8b" EMBEDDER_FOR_TESTS: "all-minilm" + TEST_MATRIX_OS: '["ubuntu-latest"]' + TEST_MATRIX_PYTHON: '["3.10", "3.14"]' jobs: + compute-test-matrix: + runs-on: ubuntu-slim + defaults: + run: + working-directory: . + outputs: + os: ${{ steps.set.outputs.os }} + python-version: ${{ steps.set.outputs.python-version }} + steps: + - id: set + run: | + echo 'os=${{ github.event_name == 'push' && '["ubuntu-latest"]' || env.TEST_MATRIX_OS }}' >> $GITHUB_OUTPUT + echo 'python-version=${{ github.event_name == 'push' && '["3.10"]' || env.TEST_MATRIX_PYTHON }}' >> $GITHUB_OUTPUT + run: name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} + needs: compute-test-matrix + permissions: + contents: write + pull-requests: write runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-latest] # to test on other Operating Systems, we need to install Ollama differently - python-version: ["3.10", "3.14"] + os: ${{ fromJSON(needs.compute-test-matrix.outputs.os) }} + python-version: ${{ fromJSON(needs.compute-test-matrix.outputs.python-version) }} steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 @@ -92,10 +119,33 @@ jobs: if: matrix.python-version == '3.10' && runner.os == 'Linux' run: hatch run fmt-check && hatch run test:types - - name: Run tests - run: hatch run test:cov-retry + - name: Run unit tests + run: hatch run test:unit-cov-retry + + # On PR: generates coverage comment artifact. On push to main: stores coverage baseline on data branch. + - name: Store unit tests coverage + if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name != 'schedule' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/ollama + SUBPROJECT_ID: ollama + COMMENT_ARTIFACT_NAME: coverage-comment-ollama + + - name: Run integration tests + run: hatch run test:integration-cov-append-retry + + - name: Store combined coverage + if: github.event_name == 'push' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/ollama + SUBPROJECT_ID: ollama-combined + COMMENT_ARTIFACT_NAME: coverage-comment-ollama-combined - name: Run unit tests with lowest direct dependencies + if: github.event_name != 'push' run: | hatch run uv pip compile pyproject.toml --resolution lowest-direct --output-file requirements_lowest_direct.txt hatch -e test env run -- uv pip install -r requirements_lowest_direct.txt diff --git a/.github/workflows/openrouter.yml b/.github/workflows/openrouter.yml index 651d41b37f..597de34d90 100644 --- a/.github/workflows/openrouter.yml +++ b/.github/workflows/openrouter.yml @@ -10,29 +10,56 @@ on: - "integrations/openrouter/**" - "!integrations/openrouter/*.md" - ".github/workflows/openrouter.yml" + push: + branches: + - main + paths: + - "integrations/openrouter/**" + - "!integrations/openrouter/*.md" + - ".github/workflows/openrouter.yml" defaults: run: working-directory: integrations/openrouter concurrency: - group: openrouter-${{ github.head_ref }} + group: openrouter-${{ github.head_ref || github.sha }} cancel-in-progress: true env: PYTHONUNBUFFERED: "1" FORCE_COLOR: "1" OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }} + TEST_MATRIX_OS: '["ubuntu-latest", "windows-latest", "macos-latest"]' + TEST_MATRIX_PYTHON: '["3.10", "3.14"]' jobs: + compute-test-matrix: + runs-on: ubuntu-slim + defaults: + run: + working-directory: . + outputs: + os: ${{ steps.set.outputs.os }} + python-version: ${{ steps.set.outputs.python-version }} + steps: + - id: set + run: | + echo 'os=${{ github.event_name == 'push' && '["ubuntu-latest"]' || env.TEST_MATRIX_OS }}' >> $GITHUB_OUTPUT + echo 'python-version=${{ github.event_name == 'push' && '["3.10"]' || env.TEST_MATRIX_PYTHON }}' >> $GITHUB_OUTPUT + run: name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} + needs: compute-test-matrix + permissions: + contents: write + pull-requests: write runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - python-version: ["3.10", "3.14"] + os: ${{ fromJSON(needs.compute-test-matrix.outputs.os) }} + python-version: ${{ fromJSON(needs.compute-test-matrix.outputs.python-version) }} steps: - name: Support longpaths @@ -53,10 +80,33 @@ jobs: if: matrix.python-version == '3.10' && runner.os == 'Linux' run: hatch run fmt-check && hatch run test:types - - name: Run tests - run: hatch run test:cov-retry + - name: Run unit tests + run: hatch run test:unit-cov-retry + + # On PR: generates coverage comment artifact. On push to main: stores coverage baseline on data branch. + - name: Store unit tests coverage + if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name != 'schedule' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/openrouter + SUBPROJECT_ID: openrouter + COMMENT_ARTIFACT_NAME: coverage-comment-openrouter + + - name: Run integration tests + run: hatch run test:integration-cov-append-retry + + - name: Store combined coverage + if: github.event_name == 'push' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/openrouter + SUBPROJECT_ID: openrouter-combined + COMMENT_ARTIFACT_NAME: coverage-comment-openrouter-combined - name: Run unit tests with lowest direct dependencies + if: github.event_name != 'push' run: | hatch run uv pip compile pyproject.toml --resolution lowest-direct --output-file requirements_lowest_direct.txt hatch -e test env run -- uv pip install -r requirements_lowest_direct.txt @@ -68,7 +118,8 @@ jobs: run: | hatch env prune hatch -e test env run -- uv pip install git+https://github.com/deepset-ai/haystack.git@main - hatch run test:cov-retry + hatch run test:unit-cov-retry + hatch run test:integration-cov-append-retry notify-slack-on-failure: needs: run diff --git a/.github/workflows/opensearch.yml b/.github/workflows/opensearch.yml index 0fd83ac579..09cd4b2433 100644 --- a/.github/workflows/opensearch.yml +++ b/.github/workflows/opensearch.yml @@ -10,28 +10,55 @@ on: - "integrations/opensearch/**" - "!integrations/opensearch/*.md" - ".github/workflows/opensearch.yml" + push: + branches: + - main + paths: + - "integrations/opensearch/**" + - "!integrations/opensearch/*.md" + - ".github/workflows/opensearch.yml" concurrency: - group: opensearch-${{ github.head_ref }} + group: opensearch-${{ github.head_ref || github.sha }} cancel-in-progress: true env: PYTHONUNBUFFERED: "1" FORCE_COLOR: "1" + TEST_MATRIX_OS: '["ubuntu-latest"]' + TEST_MATRIX_PYTHON: '["3.10", "3.14"]' defaults: run: working-directory: integrations/opensearch jobs: + compute-test-matrix: + runs-on: ubuntu-slim + defaults: + run: + working-directory: . + outputs: + os: ${{ steps.set.outputs.os }} + python-version: ${{ steps.set.outputs.python-version }} + steps: + - id: set + run: | + echo 'os=${{ github.event_name == 'push' && '["ubuntu-latest"]' || env.TEST_MATRIX_OS }}' >> $GITHUB_OUTPUT + echo 'python-version=${{ github.event_name == 'push' && '["3.10"]' || env.TEST_MATRIX_PYTHON }}' >> $GITHUB_OUTPUT + run: name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} + needs: compute-test-matrix + permissions: + contents: write + pull-requests: write runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-latest] # we run OpenSearch using Docker, which is not available on MacOS and Windows GitHub Runners - python-version: ["3.10", "3.14"] + os: ${{ fromJSON(needs.compute-test-matrix.outputs.os) }} + python-version: ${{ fromJSON(needs.compute-test-matrix.outputs.python-version) }} steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 @@ -51,10 +78,33 @@ jobs: - name: Run opensearch container run: docker compose up -d - - name: Run tests (in parallel, using 4 cores) - run: hatch run test:cov-retry -n 4 # GA runner has 4 cores + - name: Run unit tests (in parallel, using 4 cores) + run: hatch run test:unit-cov-retry -n 4 # GA runner has 4 cores + + # On PR: generates coverage comment artifact. On push to main: stores coverage baseline on data branch. + - name: Store unit tests coverage + if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name != 'schedule' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/opensearch + SUBPROJECT_ID: opensearch + COMMENT_ARTIFACT_NAME: coverage-comment-opensearch + + - name: Run integration tests (in parallel, using 4 cores) + run: hatch run test:integration-cov-append-retry -n 4 # GA runner has 4 cores + + - name: Store combined coverage + if: github.event_name == 'push' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/opensearch + SUBPROJECT_ID: opensearch-combined + COMMENT_ARTIFACT_NAME: coverage-comment-opensearch-combined - name: Run unit tests with lowest direct dependencies + if: github.event_name != 'push' run: | hatch run uv pip compile pyproject.toml --resolution lowest-direct --output-file requirements_lowest_direct.txt hatch -e test env run -- uv pip install -r requirements_lowest_direct.txt diff --git a/.github/workflows/optimum.yml b/.github/workflows/optimum.yml index 4902417803..ddc6e381dd 100644 --- a/.github/workflows/optimum.yml +++ b/.github/workflows/optimum.yml @@ -10,28 +10,55 @@ on: - "integrations/optimum/**" - "!integrations/optimum/*.md" - ".github/workflows/optimum.yml" + push: + branches: + - main + paths: + - "integrations/optimum/**" + - "!integrations/optimum/*.md" + - ".github/workflows/optimum.yml" defaults: run: working-directory: integrations/optimum concurrency: - group: optimum-${{ github.head_ref }} + group: optimum-${{ github.head_ref || github.sha }} cancel-in-progress: true env: PYTHONUNBUFFERED: "1" FORCE_COLOR: "1" + TEST_MATRIX_OS: '["ubuntu-latest", "windows-latest", "macos-latest"]' + TEST_MATRIX_PYTHON: '["3.10", "3.14"]' jobs: + compute-test-matrix: + runs-on: ubuntu-slim + defaults: + run: + working-directory: . + outputs: + os: ${{ steps.set.outputs.os }} + python-version: ${{ steps.set.outputs.python-version }} + steps: + - id: set + run: | + echo 'os=${{ github.event_name == 'push' && '["ubuntu-latest"]' || env.TEST_MATRIX_OS }}' >> $GITHUB_OUTPUT + echo 'python-version=${{ github.event_name == 'push' && '["3.10"]' || env.TEST_MATRIX_PYTHON }}' >> $GITHUB_OUTPUT + run: name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} + needs: compute-test-matrix + permissions: + contents: write + pull-requests: write runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - python-version: ["3.10", "3.14"] + os: ${{ fromJSON(needs.compute-test-matrix.outputs.os) }} + python-version: ${{ fromJSON(needs.compute-test-matrix.outputs.python-version) }} steps: - name: Support longpaths @@ -53,10 +80,33 @@ jobs: if: matrix.python-version == '3.10' && runner.os == 'Linux' run: hatch run fmt-check && hatch run test:types - - name: Run tests - run: hatch run test:cov-retry + - name: Run unit tests + run: hatch run test:unit-cov-retry + + # On PR: generates coverage comment artifact. On push to main: stores coverage baseline on data branch. + - name: Store unit tests coverage + if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name != 'schedule' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/optimum + SUBPROJECT_ID: optimum + COMMENT_ARTIFACT_NAME: coverage-comment-optimum + + - name: Run integration tests + run: hatch run test:integration-cov-append-retry + + - name: Store combined coverage + if: github.event_name == 'push' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/optimum + SUBPROJECT_ID: optimum-combined + COMMENT_ARTIFACT_NAME: coverage-comment-optimum-combined - name: Run unit tests with lowest direct dependencies + if: github.event_name != 'push' run: | hatch run uv pip compile pyproject.toml --resolution lowest-direct --output-file requirements_lowest_direct.txt hatch -e test env run -- uv pip install -r requirements_lowest_direct.txt diff --git a/.github/workflows/paddleocr.yml b/.github/workflows/paddleocr.yml index 543741bf35..0c55991229 100644 --- a/.github/workflows/paddleocr.yml +++ b/.github/workflows/paddleocr.yml @@ -10,13 +10,20 @@ on: - "integrations/paddleocr/**" - "!integrations/paddleocr/*.md" - ".github/workflows/paddleocr.yml" + push: + branches: + - main + paths: + - "integrations/paddleocr/**" + - "!integrations/paddleocr/*.md" + - ".github/workflows/paddleocr.yml" defaults: run: working-directory: integrations/paddleocr concurrency: - group: paddleocr-${{ github.head_ref }} + group: paddleocr-${{ github.head_ref || github.sha }} cancel-in-progress: true env: @@ -24,16 +31,36 @@ env: FORCE_COLOR: "1" AISTUDIO_ACCESS_TOKEN: ${{ secrets.AISTUDIO_ACCESS_TOKEN }} PADDLEOCR_VL_API_URL: ${{ secrets.PADDLEOCR_VL_API_URL }} + TEST_MATRIX_OS: '["ubuntu-latest", "windows-latest", "macos-latest"]' + TEST_MATRIX_PYTHON: '["3.10", "3.12"]' jobs: + compute-test-matrix: + runs-on: ubuntu-slim + defaults: + run: + working-directory: . + outputs: + os: ${{ steps.set.outputs.os }} + python-version: ${{ steps.set.outputs.python-version }} + steps: + - id: set + run: | + echo 'os=${{ github.event_name == 'push' && '["ubuntu-latest"]' || env.TEST_MATRIX_OS }}' >> $GITHUB_OUTPUT + echo 'python-version=${{ github.event_name == 'push' && '["3.10"]' || env.TEST_MATRIX_PYTHON }}' >> $GITHUB_OUTPUT + run: name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} + needs: compute-test-matrix + permissions: + contents: write + pull-requests: write runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - python-version: ["3.10", "3.12"] + os: ${{ fromJSON(needs.compute-test-matrix.outputs.os) }} + python-version: ${{ fromJSON(needs.compute-test-matrix.outputs.python-version) }} steps: - name: Support longpaths @@ -55,10 +82,33 @@ jobs: if: matrix.python-version == '3.10' && runner.os == 'Linux' run: hatch run fmt-check && hatch run test:types - - name: Run tests - run: hatch run test:cov-retry + - name: Run unit tests + run: hatch run test:unit-cov-retry + + # On PR: generates coverage comment artifact. On push to main: stores coverage baseline on data branch. + - name: Store unit tests coverage + if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name != 'schedule' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/paddleocr + SUBPROJECT_ID: paddleocr + COMMENT_ARTIFACT_NAME: coverage-comment-paddleocr + + - name: Run integration tests + run: hatch run test:integration-cov-append-retry + + - name: Store combined coverage + if: github.event_name == 'push' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/paddleocr + SUBPROJECT_ID: paddleocr-combined + COMMENT_ARTIFACT_NAME: coverage-comment-paddleocr-combined - name: Run unit tests with lowest direct dependencies + if: github.event_name != 'push' run: | hatch run uv pip compile pyproject.toml --resolution lowest-direct --output-file requirements_lowest_direct.txt hatch -e test env run -- uv pip install -r requirements_lowest_direct.txt diff --git a/.github/workflows/pgvector.yml b/.github/workflows/pgvector.yml index 776a2d9b25..6732c77131 100644 --- a/.github/workflows/pgvector.yml +++ b/.github/workflows/pgvector.yml @@ -10,28 +10,55 @@ on: - "integrations/pgvector/**" - "!integrations/pgvector/*.md" - ".github/workflows/pgvector.yml" + push: + branches: + - main + paths: + - "integrations/pgvector/**" + - "!integrations/pgvector/*.md" + - ".github/workflows/pgvector.yml" concurrency: - group: pgvector-${{ github.head_ref }} + group: pgvector-${{ github.head_ref || github.sha }} cancel-in-progress: true env: PYTHONUNBUFFERED: "1" FORCE_COLOR: "1" + TEST_MATRIX_OS: '["ubuntu-latest"]' + TEST_MATRIX_PYTHON: '["3.10", "3.14"]' defaults: run: working-directory: integrations/pgvector jobs: + compute-test-matrix: + runs-on: ubuntu-slim + defaults: + run: + working-directory: . + outputs: + os: ${{ steps.set.outputs.os }} + python-version: ${{ steps.set.outputs.python-version }} + steps: + - id: set + run: | + echo 'os=${{ github.event_name == 'push' && '["ubuntu-latest"]' || env.TEST_MATRIX_OS }}' >> $GITHUB_OUTPUT + echo 'python-version=${{ github.event_name == 'push' && '["3.10"]' || env.TEST_MATRIX_PYTHON }}' >> $GITHUB_OUTPUT + run: name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} + needs: compute-test-matrix + permissions: + contents: write + pull-requests: write runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-latest] # we run pgvector using Docker, which is not available on MacOS and Windows GitHub Runners - python-version: ["3.10", "3.14"] + os: ${{ fromJSON(needs.compute-test-matrix.outputs.os) }} + python-version: ${{ fromJSON(needs.compute-test-matrix.outputs.python-version) }} services: pgvector: image: pgvector/pgvector:pg17 @@ -57,10 +84,33 @@ jobs: if: matrix.python-version == '3.10' && runner.os == 'Linux' run: hatch run fmt-check && hatch run test:types - - name: Run tests - run: hatch run test:cov-retry + - name: Run unit tests + run: hatch run test:unit-cov-retry + + # On PR: generates coverage comment artifact. On push to main: stores coverage baseline on data branch. + - name: Store unit tests coverage + if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name != 'schedule' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/pgvector + SUBPROJECT_ID: pgvector + COMMENT_ARTIFACT_NAME: coverage-comment-pgvector + + - name: Run integration tests + run: hatch run test:integration-cov-append-retry + + - name: Store combined coverage + if: github.event_name == 'push' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/pgvector + SUBPROJECT_ID: pgvector-combined + COMMENT_ARTIFACT_NAME: coverage-comment-pgvector-combined - name: Run unit tests with lowest direct dependencies + if: github.event_name != 'push' run: | hatch run uv pip compile pyproject.toml --resolution lowest-direct --output-file requirements_lowest_direct.txt hatch -e test env run -- uv pip install -r requirements_lowest_direct.txt diff --git a/.github/workflows/pinecone.yml b/.github/workflows/pinecone.yml index 3e3c9ddcce..48e5bb72cd 100644 --- a/.github/workflows/pinecone.yml +++ b/.github/workflows/pinecone.yml @@ -10,31 +10,57 @@ on: - "integrations/pinecone/**" - "!integrations/pinecone/*.md" - ".github/workflows/pinecone.yml" + push: + branches: + - main + paths: + - "integrations/pinecone/**" + - "!integrations/pinecone/*.md" + - ".github/workflows/pinecone.yml" defaults: run: working-directory: integrations/pinecone concurrency: - group: pinecone-${{ github.head_ref }} + group: pinecone-${{ github.head_ref || github.sha }} cancel-in-progress: true env: PYTHONUNBUFFERED: "1" FORCE_COLOR: "1" PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }} + TEST_MATRIX_OS: '["ubuntu-latest"]' + TEST_MATRIX_PYTHON: '["3.10", "3.14"]' jobs: + compute-test-matrix: + runs-on: ubuntu-slim + defaults: + run: + working-directory: . + outputs: + os: ${{ steps.set.outputs.os }} + python-version: ${{ steps.set.outputs.python-version }} + steps: + - id: set + run: | + echo 'os=${{ github.event_name == 'push' && '["ubuntu-latest"]' || env.TEST_MATRIX_OS }}' >> $GITHUB_OUTPUT + echo 'python-version=${{ github.event_name == 'push' && '["3.10"]' || env.TEST_MATRIX_PYTHON }}' >> $GITHUB_OUTPUT + run: name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} + needs: compute-test-matrix + permissions: + contents: write + pull-requests: write runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: # Pinecone tests are time expensive, so only test on Ubuntu - os: [ubuntu-latest] - python-version: ["3.10", "3.14"] - # the INDEX_NAME is used in test_serverless_index_creation_from_scratch + os: ${{ fromJSON(needs.compute-test-matrix.outputs.os) }} + python-version: ${{ fromJSON(needs.compute-test-matrix.outputs.python-version) }} include: - python-version: "3.10" INDEX_NAME: "index-310" @@ -58,12 +84,35 @@ jobs: if: matrix.python-version == '3.10' && runner.os == 'Linux' run: hatch run fmt-check && hatch run test:types - - name: Run tests + - name: Run unit tests + run: hatch run test:unit-cov-retry + + # On PR: generates coverage comment artifact. On push to main: stores coverage baseline on data branch. + - name: Store unit tests coverage + if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name != 'schedule' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/pinecone + SUBPROJECT_ID: pinecone + COMMENT_ARTIFACT_NAME: coverage-comment-pinecone + + - name: Run integration tests env: INDEX_NAME: ${{ matrix.INDEX_NAME }} - run: hatch run test:cov-retry + run: hatch run test:integration-cov-append-retry + + - name: Store combined coverage + if: github.event_name == 'push' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/pinecone + SUBPROJECT_ID: pinecone-combined + COMMENT_ARTIFACT_NAME: coverage-comment-pinecone-combined - name: Run unit tests with lowest direct dependencies + if: github.event_name != 'push' run: | hatch run uv pip compile pyproject.toml --resolution lowest-direct --output-file requirements_lowest_direct.txt hatch -e test env run -- uv pip install -r requirements_lowest_direct.txt diff --git a/.github/workflows/pyversity.yml b/.github/workflows/pyversity.yml index c894a5089e..1cc6e9b873 100644 --- a/.github/workflows/pyversity.yml +++ b/.github/workflows/pyversity.yml @@ -8,20 +8,51 @@ on: - "integrations/pyversity/**" - "!integrations/pyversity/*.md" - ".github/workflows/pyversity.yml" + push: + branches: + - main + paths: + - "integrations/pyversity/**" + - "!integrations/pyversity/*.md" + - ".github/workflows/pyversity.yml" defaults: run: working-directory: integrations/pyversity +env: + PYTHONUNBUFFERED: "1" + FORCE_COLOR: "1" + TEST_MATRIX_OS: '["ubuntu-latest", "windows-latest", "macos-latest"]' + TEST_MATRIX_PYTHON: '["3.10", "3.14"]' + jobs: + compute-test-matrix: + runs-on: ubuntu-slim + defaults: + run: + working-directory: . + outputs: + os: ${{ steps.set.outputs.os }} + python-version: ${{ steps.set.outputs.python-version }} + steps: + - id: set + run: | + echo 'os=${{ github.event_name == 'push' && '["ubuntu-latest"]' || env.TEST_MATRIX_OS }}' >> $GITHUB_OUTPUT + echo 'python-version=${{ github.event_name == 'push' && '["3.10"]' || env.TEST_MATRIX_PYTHON }}' >> $GITHUB_OUTPUT + run: name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} + needs: compute-test-matrix + permissions: + contents: write + pull-requests: write runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - python-version: ["3.10", "3.14"] + os: ${{ fromJSON(needs.compute-test-matrix.outputs.os) }} + python-version: ${{ fromJSON(needs.compute-test-matrix.outputs.python-version) }} steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 @@ -38,10 +69,23 @@ jobs: if: matrix.python-version == '3.10' && runner.os == 'Linux' run: hatch run fmt-check && hatch run test:types - - name: Run tests - run: hatch run test:cov-retry + - name: Run unit tests + run: hatch run test:unit-cov-retry + + # On PR: generates coverage comment artifact. On push to main: stores coverage baseline on data branch. + - name: Store unit tests coverage + if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name != 'schedule' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/pyversity + SUBPROJECT_ID: pyversity + COMMENT_ARTIFACT_NAME: coverage-comment-pyversity + + # No integration tests yet — add integration-cov-append-retry + combined coverage step when needed - name: Run unit tests with lowest direct dependencies + if: github.event_name != 'push' run: | hatch run uv pip compile pyproject.toml --resolution lowest-direct --output-file requirements_lowest_direct.txt hatch -e test env run -- uv pip install -r requirements_lowest_direct.txt diff --git a/.github/workflows/qdrant.yml b/.github/workflows/qdrant.yml index a2b8092ee4..f8f35913ea 100644 --- a/.github/workflows/qdrant.yml +++ b/.github/workflows/qdrant.yml @@ -10,28 +10,55 @@ on: - "integrations/qdrant/**" - "!integrations/qdrant/*.md" - ".github/workflows/qdrant.yml" + push: + branches: + - main + paths: + - "integrations/qdrant/**" + - "!integrations/qdrant/*.md" + - ".github/workflows/qdrant.yml" defaults: run: working-directory: integrations/qdrant concurrency: - group: qdrant-${{ github.head_ref }} + group: qdrant-${{ github.head_ref || github.sha }} cancel-in-progress: true env: PYTHONUNBUFFERED: "1" FORCE_COLOR: "1" + TEST_MATRIX_OS: '["ubuntu-latest", "windows-latest", "macos-latest"]' + TEST_MATRIX_PYTHON: '["3.10", "3.14"]' jobs: + compute-test-matrix: + runs-on: ubuntu-slim + defaults: + run: + working-directory: . + outputs: + os: ${{ steps.set.outputs.os }} + python-version: ${{ steps.set.outputs.python-version }} + steps: + - id: set + run: | + echo 'os=${{ github.event_name == 'push' && '["ubuntu-latest"]' || env.TEST_MATRIX_OS }}' >> $GITHUB_OUTPUT + echo 'python-version=${{ github.event_name == 'push' && '["3.10"]' || env.TEST_MATRIX_PYTHON }}' >> $GITHUB_OUTPUT + run: name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} + needs: compute-test-matrix + permissions: + contents: write + pull-requests: write runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - python-version: ["3.10", "3.14"] + os: ${{ fromJSON(needs.compute-test-matrix.outputs.os) }} + python-version: ${{ fromJSON(needs.compute-test-matrix.outputs.python-version) }} steps: - name: Support longpaths @@ -53,10 +80,23 @@ jobs: if: matrix.python-version == '3.10' && runner.os == 'Linux' run: hatch run fmt-check && hatch run test:types - - name: Run tests - run: hatch run test:cov-retry + - name: Run unit tests + run: hatch run test:unit-cov-retry + + # On PR: generates coverage comment artifact. On push to main: stores coverage baseline on data branch. + - name: Store unit tests coverage + if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name != 'schedule' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/qdrant + SUBPROJECT_ID: qdrant + COMMENT_ARTIFACT_NAME: coverage-comment-qdrant + + # No integration tests yet — add integration-cov-append-retry + combined coverage step when needed - name: Run unit tests with lowest direct dependencies + if: github.event_name != 'push' run: | hatch run uv pip compile pyproject.toml --resolution lowest-direct --output-file requirements_lowest_direct.txt hatch -e test env run -- uv pip install -r requirements_lowest_direct.txt diff --git a/.github/workflows/ragas.yml b/.github/workflows/ragas.yml index f67ac660e5..5940aa05dc 100644 --- a/.github/workflows/ragas.yml +++ b/.github/workflows/ragas.yml @@ -10,29 +10,56 @@ on: - "integrations/ragas/**" - "!integrations/ragas/*.md" - ".github/workflows/ragas.yml" + push: + branches: + - main + paths: + - "integrations/ragas/**" + - "!integrations/ragas/*.md" + - ".github/workflows/ragas.yml" defaults: run: working-directory: integrations/ragas concurrency: - group: ragas-${{ github.head_ref }} + group: ragas-${{ github.head_ref || github.sha }} cancel-in-progress: true env: PYTHONUNBUFFERED: "1" FORCE_COLOR: "1" OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + TEST_MATRIX_OS: '["ubuntu-latest", "windows-latest", "macos-latest"]' + TEST_MATRIX_PYTHON: '["3.10", "3.14"]' jobs: + compute-test-matrix: + runs-on: ubuntu-slim + defaults: + run: + working-directory: . + outputs: + os: ${{ steps.set.outputs.os }} + python-version: ${{ steps.set.outputs.python-version }} + steps: + - id: set + run: | + echo 'os=${{ github.event_name == 'push' && '["ubuntu-latest"]' || env.TEST_MATRIX_OS }}' >> $GITHUB_OUTPUT + echo 'python-version=${{ github.event_name == 'push' && '["3.10"]' || env.TEST_MATRIX_PYTHON }}' >> $GITHUB_OUTPUT + run: name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} + needs: compute-test-matrix + permissions: + contents: write + pull-requests: write runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - python-version: ["3.10", "3.14"] + os: ${{ fromJSON(needs.compute-test-matrix.outputs.os) }} + python-version: ${{ fromJSON(needs.compute-test-matrix.outputs.python-version) }} steps: - name: Support longpaths @@ -54,10 +81,23 @@ jobs: if: matrix.python-version == '3.10' && runner.os == 'Linux' run: hatch run fmt-check && hatch run test:types - - name: Run tests - run: hatch run test:cov-retry + - name: Run unit tests + run: hatch run test:unit-cov-retry + + # On PR: generates coverage comment artifact. On push to main: stores coverage baseline on data branch. + - name: Store unit tests coverage + if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name != 'schedule' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/ragas + SUBPROJECT_ID: ragas + COMMENT_ARTIFACT_NAME: coverage-comment-ragas + + # No integration tests yet — add integration-cov-append-retry + combined coverage step when needed - name: Run unit tests with lowest direct dependencies + if: github.event_name != 'push' run: | hatch run uv pip compile pyproject.toml --resolution lowest-direct --output-file requirements_lowest_direct.txt hatch -e test env run -- uv pip install -r requirements_lowest_direct.txt diff --git a/.github/workflows/snowflake.yml b/.github/workflows/snowflake.yml index 6c172f2472..5d389ec002 100644 --- a/.github/workflows/snowflake.yml +++ b/.github/workflows/snowflake.yml @@ -10,28 +10,55 @@ on: - "integrations/snowflake/**" - "!integrations/snowflake/*.md" - ".github/workflows/snowflake.yml" + push: + branches: + - main + paths: + - "integrations/snowflake/**" + - "!integrations/snowflake/*.md" + - ".github/workflows/snowflake.yml" defaults: run: working-directory: integrations/snowflake concurrency: - group: snowflake-${{ github.head_ref }} + group: snowflake-${{ github.head_ref || github.sha }} cancel-in-progress: true env: PYTHONUNBUFFERED: "1" FORCE_COLOR: "1" + TEST_MATRIX_OS: '["ubuntu-latest", "windows-latest", "macos-latest"]' + TEST_MATRIX_PYTHON: '["3.10", "3.14"]' jobs: + compute-test-matrix: + runs-on: ubuntu-slim + defaults: + run: + working-directory: . + outputs: + os: ${{ steps.set.outputs.os }} + python-version: ${{ steps.set.outputs.python-version }} + steps: + - id: set + run: | + echo 'os=${{ github.event_name == 'push' && '["ubuntu-latest"]' || env.TEST_MATRIX_OS }}' >> $GITHUB_OUTPUT + echo 'python-version=${{ github.event_name == 'push' && '["3.10"]' || env.TEST_MATRIX_PYTHON }}' >> $GITHUB_OUTPUT + run: name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} + needs: compute-test-matrix + permissions: + contents: write + pull-requests: write runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - python-version: ["3.10", "3.14"] + os: ${{ fromJSON(needs.compute-test-matrix.outputs.os) }} + python-version: ${{ fromJSON(needs.compute-test-matrix.outputs.python-version) }} steps: - name: Support longpaths @@ -53,10 +80,23 @@ jobs: if: matrix.python-version == '3.10' && runner.os == 'Linux' run: hatch run fmt-check && hatch run test:types - - name: Run tests - run: hatch run test:cov-retry + - name: Run unit tests + run: hatch run test:unit-cov-retry + + # On PR: generates coverage comment artifact. On push to main: stores coverage baseline on data branch. + - name: Store unit tests coverage + if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name != 'schedule' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/snowflake + SUBPROJECT_ID: snowflake + COMMENT_ARTIFACT_NAME: coverage-comment-snowflake + + # No integration tests yet — add integration-cov-append-retry + combined coverage step when needed - name: Run unit tests with lowest direct dependencies + if: github.event_name != 'push' run: | hatch run uv pip compile pyproject.toml --resolution lowest-direct --output-file requirements_lowest_direct.txt hatch -e test env run -- uv pip install -r requirements_lowest_direct.txt diff --git a/.github/workflows/stackit.yml b/.github/workflows/stackit.yml index d6d8a62fa3..6cae613b3f 100644 --- a/.github/workflows/stackit.yml +++ b/.github/workflows/stackit.yml @@ -10,29 +10,56 @@ on: - "integrations/stackit/**" - "!integrations/stackit/*.md" - ".github/workflows/stackit.yml" + push: + branches: + - main + paths: + - "integrations/stackit/**" + - "!integrations/stackit/*.md" + - ".github/workflows/stackit.yml" defaults: run: working-directory: integrations/stackit concurrency: - group: stackit-${{ github.head_ref }} + group: stackit-${{ github.head_ref || github.sha }} cancel-in-progress: true env: PYTHONUNBUFFERED: "1" FORCE_COLOR: "1" STACKIT_API_KEY: ${{ secrets.STACKIT_API_KEY }} + TEST_MATRIX_OS: '["ubuntu-latest", "windows-latest", "macos-latest"]' + TEST_MATRIX_PYTHON: '["3.10", "3.14"]' jobs: + compute-test-matrix: + runs-on: ubuntu-slim + defaults: + run: + working-directory: . + outputs: + os: ${{ steps.set.outputs.os }} + python-version: ${{ steps.set.outputs.python-version }} + steps: + - id: set + run: | + echo 'os=${{ github.event_name == 'push' && '["ubuntu-latest"]' || env.TEST_MATRIX_OS }}' >> $GITHUB_OUTPUT + echo 'python-version=${{ github.event_name == 'push' && '["3.10"]' || env.TEST_MATRIX_PYTHON }}' >> $GITHUB_OUTPUT + run: name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} + needs: compute-test-matrix + permissions: + contents: write + pull-requests: write runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - python-version: ["3.10", "3.14"] + os: ${{ fromJSON(needs.compute-test-matrix.outputs.os) }} + python-version: ${{ fromJSON(needs.compute-test-matrix.outputs.python-version) }} steps: - name: Support longpaths @@ -53,10 +80,33 @@ jobs: if: matrix.python-version == '3.10' && runner.os == 'Linux' run: hatch run fmt-check && hatch run test:types - - name: Run tests - run: hatch run test:cov-retry + - name: Run unit tests + run: hatch run test:unit-cov-retry + + # On PR: generates coverage comment artifact. On push to main: stores coverage baseline on data branch. + - name: Store unit tests coverage + if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name != 'schedule' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/stackit + SUBPROJECT_ID: stackit + COMMENT_ARTIFACT_NAME: coverage-comment-stackit + + - name: Run integration tests + run: hatch run test:integration-cov-append-retry + + - name: Store combined coverage + if: github.event_name == 'push' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/stackit + SUBPROJECT_ID: stackit-combined + COMMENT_ARTIFACT_NAME: coverage-comment-stackit-combined - name: Run unit tests with lowest direct dependencies + if: github.event_name != 'push' run: | hatch run uv pip compile pyproject.toml --resolution lowest-direct --output-file requirements_lowest_direct.txt hatch -e test env run -- uv pip install -r requirements_lowest_direct.txt @@ -68,7 +118,8 @@ jobs: run: | hatch env prune hatch -e test env run -- uv pip install git+https://github.com/deepset-ai/haystack.git@main - hatch run test:cov-retry + hatch run test:unit-cov-retry + hatch run test:integration-cov-append-retry notify-slack-on-failure: needs: run diff --git a/.github/workflows/tavily.yml b/.github/workflows/tavily.yml index 7a01b422dc..7746594670 100644 --- a/.github/workflows/tavily.yml +++ b/.github/workflows/tavily.yml @@ -10,28 +10,55 @@ on: - "integrations/tavily/**" - "!integrations/tavily/*.md" - ".github/workflows/tavily.yml" + push: + branches: + - main + paths: + - "integrations/tavily/**" + - "!integrations/tavily/*.md" + - ".github/workflows/tavily.yml" defaults: run: working-directory: integrations/tavily concurrency: - group: tavily-${{ github.head_ref }} + group: tavily-${{ github.head_ref || github.sha }} cancel-in-progress: true env: PYTHONUNBUFFERED: "1" FORCE_COLOR: "1" + TEST_MATRIX_OS: '["ubuntu-latest", "windows-latest", "macos-latest"]' + TEST_MATRIX_PYTHON: '["3.10", "3.14"]' jobs: + compute-test-matrix: + runs-on: ubuntu-slim + defaults: + run: + working-directory: . + outputs: + os: ${{ steps.set.outputs.os }} + python-version: ${{ steps.set.outputs.python-version }} + steps: + - id: set + run: | + echo 'os=${{ github.event_name == 'push' && '["ubuntu-latest"]' || env.TEST_MATRIX_OS }}' >> $GITHUB_OUTPUT + echo 'python-version=${{ github.event_name == 'push' && '["3.10"]' || env.TEST_MATRIX_PYTHON }}' >> $GITHUB_OUTPUT + run: name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} + needs: compute-test-matrix + permissions: + contents: write + pull-requests: write runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - python-version: ["3.10", "3.14"] + os: ${{ fromJSON(needs.compute-test-matrix.outputs.os) }} + python-version: ${{ fromJSON(needs.compute-test-matrix.outputs.python-version) }} steps: - name: Support longpaths @@ -52,21 +79,44 @@ jobs: if: matrix.python-version == '3.10' && runner.os == 'Linux' run: hatch run fmt-check && hatch run test:types - - name: Run tests - run: hatch run test:cov-retry + - name: Run unit tests + run: hatch run test:unit-cov-retry + + # On PR: generates coverage comment artifact. On push to main: stores coverage baseline on data branch. + - name: Store unit tests coverage + if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name != 'schedule' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/tavily + SUBPROJECT_ID: tavily + COMMENT_ARTIFACT_NAME: coverage-comment-tavily + + - name: Run integration tests + run: hatch run test:integration-cov-append-retry + + - name: Store combined coverage + if: github.event_name == 'push' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/tavily + SUBPROJECT_ID: tavily-combined + COMMENT_ARTIFACT_NAME: coverage-comment-tavily-combined - name: Run unit tests with lowest direct dependencies + if: github.event_name != 'push' run: | hatch run uv pip compile pyproject.toml --resolution lowest-direct --output-file requirements_lowest_direct.txt hatch -e test env run -- uv pip install -r requirements_lowest_direct.txt hatch run test:unit - - name: Nightly - run tests with Haystack main branch + - name: Nightly - run unit tests with Haystack main branch if: github.event_name == 'schedule' run: | hatch env prune hatch -e test env run -- uv pip install git+https://github.com/deepset-ai/haystack.git@main - hatch run test:cov-retry + hatch run test:unit notify-slack-on-failure: diff --git a/.github/workflows/togetherai.yml b/.github/workflows/togetherai.yml index 32a7984f81..af14ae5882 100644 --- a/.github/workflows/togetherai.yml +++ b/.github/workflows/togetherai.yml @@ -10,29 +10,56 @@ on: - "integrations/togetherai/**" - "!integrations/togetherai/*.md" - ".github/workflows/togetherai.yml" + push: + branches: + - main + paths: + - "integrations/togetherai/**" + - "!integrations/togetherai/*.md" + - ".github/workflows/togetherai.yml" defaults: run: working-directory: integrations/togetherai concurrency: - group: togetherai-${{ github.head_ref }} + group: togetherai-${{ github.head_ref || github.sha }} cancel-in-progress: true env: PYTHONUNBUFFERED: "1" FORCE_COLOR: "1" TOGETHER_API_KEY: ${{ secrets.TOGETHER_AI_API_KEY }} + TEST_MATRIX_OS: '["ubuntu-latest", "windows-latest", "macos-latest"]' + TEST_MATRIX_PYTHON: '["3.10", "3.14"]' jobs: + compute-test-matrix: + runs-on: ubuntu-slim + defaults: + run: + working-directory: . + outputs: + os: ${{ steps.set.outputs.os }} + python-version: ${{ steps.set.outputs.python-version }} + steps: + - id: set + run: | + echo 'os=${{ github.event_name == 'push' && '["ubuntu-latest"]' || env.TEST_MATRIX_OS }}' >> $GITHUB_OUTPUT + echo 'python-version=${{ github.event_name == 'push' && '["3.10"]' || env.TEST_MATRIX_PYTHON }}' >> $GITHUB_OUTPUT + run: name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} + needs: compute-test-matrix + permissions: + contents: write + pull-requests: write runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - python-version: ["3.10", "3.14"] + os: ${{ fromJSON(needs.compute-test-matrix.outputs.os) }} + python-version: ${{ fromJSON(needs.compute-test-matrix.outputs.python-version) }} steps: - name: Support longpaths @@ -53,10 +80,33 @@ jobs: if: matrix.python-version == '3.10' && runner.os == 'Linux' run: hatch run fmt-check && hatch run test:types - - name: Run tests - run: hatch run test:cov-retry + - name: Run unit tests + run: hatch run test:unit-cov-retry + + # On PR: generates coverage comment artifact. On push to main: stores coverage baseline on data branch. + - name: Store unit tests coverage + if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name != 'schedule' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/togetherai + SUBPROJECT_ID: togetherai + COMMENT_ARTIFACT_NAME: coverage-comment-togetherai + + - name: Run integration tests + run: hatch run test:integration-cov-append-retry + + - name: Store combined coverage + if: github.event_name == 'push' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/togetherai + SUBPROJECT_ID: togetherai-combined + COMMENT_ARTIFACT_NAME: coverage-comment-togetherai-combined - name: Run unit tests with lowest direct dependencies + if: github.event_name != 'push' run: | hatch run uv pip compile pyproject.toml --resolution lowest-direct --output-file requirements_lowest_direct.txt hatch -e test env run -- uv pip install -r requirements_lowest_direct.txt @@ -68,7 +118,8 @@ jobs: run: | hatch env prune hatch -e test env run -- uv pip install git+https://github.com/deepset-ai/haystack.git@main - hatch run test:cov-retry + hatch run test:unit-cov-retry + hatch run test:integration-cov-append-retry notify-slack-on-failure: needs: run diff --git a/.github/workflows/unstructured.yml b/.github/workflows/unstructured.yml index 7a5edb9c79..5680a2bba1 100644 --- a/.github/workflows/unstructured.yml +++ b/.github/workflows/unstructured.yml @@ -10,34 +10,60 @@ on: - "integrations/unstructured/**" - ".github/workflows/unstructured.yml" - "!integrations/unstructured/*.md" + push: + branches: + - main + paths: + - "integrations/unstructured/**" + - ".github/workflows/unstructured.yml" + - "!integrations/unstructured/*.md" defaults: run: working-directory: integrations/unstructured concurrency: - group: unstructured-${{ github.head_ref }} + group: unstructured-${{ github.head_ref || github.sha }} cancel-in-progress: true env: PYTHONUNBUFFERED: "1" FORCE_COLOR: "1" + TEST_MATRIX_OS: '["ubuntu-latest"]' + TEST_MATRIX_PYTHON: '["3.10", "3.14"]' jobs: + compute-test-matrix: + runs-on: ubuntu-slim + defaults: + run: + working-directory: . + outputs: + os: ${{ steps.set.outputs.os }} + python-version: ${{ steps.set.outputs.python-version }} + steps: + - id: set + run: | + echo 'os=${{ github.event_name == 'push' && '["ubuntu-latest"]' || env.TEST_MATRIX_OS }}' >> $GITHUB_OUTPUT + echo 'python-version=${{ github.event_name == 'push' && '["3.10"]' || env.TEST_MATRIX_PYTHON }}' >> $GITHUB_OUTPUT + run: name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} + needs: compute-test-matrix + permissions: + contents: write + pull-requests: write runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-latest] # we run Unstructured using Docker, which is not available on MacOS and Windows GitHub Runners - python-version: ["3.10", "3.14"] + os: ${{ fromJSON(needs.compute-test-matrix.outputs.os) }} + python-version: ${{ fromJSON(needs.compute-test-matrix.outputs.python-version) }} steps: - name: Free up disk space working-directory: . run: | - sudo docker image prune --all --force sudo rm -rf /usr/share/dotnet /opt/ghc /usr/local/share/boost /usr/local/lib/android /opt/hostedtoolcache/CodeQL - name: Run Unstructured API (docker) @@ -66,10 +92,33 @@ jobs: if: matrix.python-version == '3.10' && runner.os == 'Linux' run: hatch run fmt-check && hatch run test:types - - name: Run tests - run: hatch run test:cov-retry + - name: Run unit tests + run: hatch run test:unit-cov-retry + + # On PR: generates coverage comment artifact. On push to main: stores coverage baseline on data branch. + - name: Store unit tests coverage + if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name != 'schedule' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/unstructured + SUBPROJECT_ID: unstructured + COMMENT_ARTIFACT_NAME: coverage-comment-unstructured + + - name: Run integration tests + run: hatch run test:integration-cov-append-retry + + - name: Store combined coverage + if: github.event_name == 'push' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/unstructured + SUBPROJECT_ID: unstructured-combined + COMMENT_ARTIFACT_NAME: coverage-comment-unstructured-combined - name: Run unit tests with lowest direct dependencies + if: github.event_name != 'push' run: | hatch run uv pip compile pyproject.toml --resolution lowest-direct --output-file requirements_lowest_direct.txt hatch -e test env run -- uv pip install -r requirements_lowest_direct.txt diff --git a/.github/workflows/valkey.yml b/.github/workflows/valkey.yml index a113f5c635..0bec7df2dc 100644 --- a/.github/workflows/valkey.yml +++ b/.github/workflows/valkey.yml @@ -10,28 +10,55 @@ on: - "integrations/valkey/**" - "!integrations/valkey/*.md" - ".github/workflows/valkey.yml" + push: + branches: + - main + paths: + - "integrations/valkey/**" + - "!integrations/valkey/*.md" + - ".github/workflows/valkey.yml" defaults: run: working-directory: integrations/valkey concurrency: - group: valkey-${{ github.head_ref }} + group: valkey-${{ github.head_ref || github.sha }} cancel-in-progress: true env: PYTHONUNBUFFERED: "1" FORCE_COLOR: "1" + TEST_MATRIX_OS: '["ubuntu-latest"]' + TEST_MATRIX_PYTHON: '["3.10", "3.14"]' jobs: + compute-test-matrix: + runs-on: ubuntu-slim + defaults: + run: + working-directory: . + outputs: + os: ${{ steps.set.outputs.os }} + python-version: ${{ steps.set.outputs.python-version }} + steps: + - id: set + run: | + echo 'os=${{ github.event_name == 'push' && '["ubuntu-latest"]' || env.TEST_MATRIX_OS }}' >> $GITHUB_OUTPUT + echo 'python-version=${{ github.event_name == 'push' && '["3.10"]' || env.TEST_MATRIX_PYTHON }}' >> $GITHUB_OUTPUT + run: name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} + needs: compute-test-matrix + permissions: + contents: write + pull-requests: write runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-latest] # Valkey service container only available on Linux - python-version: ["3.10", "3.14"] + os: ${{ fromJSON(needs.compute-test-matrix.outputs.os) }} + python-version: ${{ fromJSON(needs.compute-test-matrix.outputs.python-version) }} services: valkey: @@ -59,10 +86,33 @@ jobs: if: matrix.python-version == '3.10' && runner.os == 'Linux' run: hatch run fmt-check && hatch run test:types - - name: Run tests - run: hatch run test:cov-retry + - name: Run unit tests + run: hatch run test:unit-cov-retry + + # On PR: generates coverage comment artifact. On push to main: stores coverage baseline on data branch. + - name: Store unit tests coverage + if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name != 'schedule' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/valkey + SUBPROJECT_ID: valkey + COMMENT_ARTIFACT_NAME: coverage-comment-valkey + + - name: Run integration tests + run: hatch run test:integration-cov-append-retry + + - name: Store combined coverage + if: github.event_name == 'push' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/valkey + SUBPROJECT_ID: valkey-combined + COMMENT_ARTIFACT_NAME: coverage-comment-valkey-combined - name: Run unit tests with lowest direct dependencies + if: github.event_name != 'push' run: | hatch run uv pip compile pyproject.toml --resolution lowest-direct --output-file requirements_lowest_direct.txt hatch -e test env run -- uv pip install -r requirements_lowest_direct.txt diff --git a/.github/workflows/watsonx.yml b/.github/workflows/watsonx.yml index f56dbb9337..552422334f 100644 --- a/.github/workflows/watsonx.yml +++ b/.github/workflows/watsonx.yml @@ -10,13 +10,20 @@ on: - "integrations/watsonx/**" - "!integrations/watsonx/*.md" - ".github/workflows/watsonx.yml" + push: + branches: + - main + paths: + - "integrations/watsonx/**" + - "!integrations/watsonx/*.md" + - ".github/workflows/watsonx.yml" defaults: run: working-directory: integrations/watsonx concurrency: - group: watsonx-${{ github.head_ref }} + group: watsonx-${{ github.head_ref || github.sha }} cancel-in-progress: true env: @@ -24,16 +31,36 @@ env: FORCE_COLOR: "1" WATSONX_API_KEY: ${{ secrets.WATSONX_API_KEY }} WATSONX_PROJECT_ID: ${{ secrets.WATSONX_PROJECT_ID }} + TEST_MATRIX_OS: '["ubuntu-latest", "windows-latest", "macos-latest"]' + TEST_MATRIX_PYTHON: '["3.10", "3.13"]' jobs: + compute-test-matrix: + runs-on: ubuntu-slim + defaults: + run: + working-directory: . + outputs: + os: ${{ steps.set.outputs.os }} + python-version: ${{ steps.set.outputs.python-version }} + steps: + - id: set + run: | + echo 'os=${{ github.event_name == 'push' && '["ubuntu-latest"]' || env.TEST_MATRIX_OS }}' >> $GITHUB_OUTPUT + echo 'python-version=${{ github.event_name == 'push' && '["3.10"]' || env.TEST_MATRIX_PYTHON }}' >> $GITHUB_OUTPUT + run: name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} + needs: compute-test-matrix + permissions: + contents: write + pull-requests: write runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - python-version: ["3.10", "3.13"] + os: ${{ fromJSON(needs.compute-test-matrix.outputs.os) }} + python-version: ${{ fromJSON(needs.compute-test-matrix.outputs.python-version) }} steps: - name: Support longpaths @@ -55,10 +82,33 @@ jobs: if: matrix.python-version == '3.10' && runner.os == 'Linux' run: hatch run fmt-check && hatch run test:types - - name: Run tests - run: hatch run test:cov-retry + - name: Run unit tests + run: hatch run test:unit-cov-retry + + # On PR: generates coverage comment artifact. On push to main: stores coverage baseline on data branch. + - name: Store unit tests coverage + if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name != 'schedule' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/watsonx + SUBPROJECT_ID: watsonx + COMMENT_ARTIFACT_NAME: coverage-comment-watsonx + + - name: Run integration tests + run: hatch run test:integration-cov-append-retry + + - name: Store combined coverage + if: github.event_name == 'push' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/watsonx + SUBPROJECT_ID: watsonx-combined + COMMENT_ARTIFACT_NAME: coverage-comment-watsonx-combined - name: Run unit tests with lowest direct dependencies + if: github.event_name != 'push' run: | hatch run uv pip compile pyproject.toml --resolution lowest-direct --output-file requirements_lowest_direct.txt hatch -e test env run -- uv pip install -r requirements_lowest_direct.txt diff --git a/.github/workflows/weave.yml b/.github/workflows/weave.yml index 281090f5a2..b14d540832 100644 --- a/.github/workflows/weave.yml +++ b/.github/workflows/weave.yml @@ -10,30 +10,57 @@ on: - "integrations/weave/**" - ".github/workflows/weave.yml" - "!integrations/weave/*.md" + push: + branches: + - main + paths: + - "integrations/weave/**" + - ".github/workflows/weave.yml" + - "!integrations/weave/*.md" defaults: run: working-directory: integrations/weave concurrency: - group: weave-${{ github.head_ref }} + group: weave-${{ github.head_ref || github.sha }} cancel-in-progress: true env: PYTHONUNBUFFERED: "1" FORCE_COLOR: "1" WANDB_API_KEY: ${{ secrets.WANDB_API_KEY }} + TEST_MATRIX_OS: '["ubuntu-latest", "windows-latest", "macos-latest"]' + TEST_MATRIX_PYTHON: '["3.10", "3.14"]' jobs: + compute-test-matrix: + runs-on: ubuntu-slim + defaults: + run: + working-directory: . + outputs: + os: ${{ steps.set.outputs.os }} + python-version: ${{ steps.set.outputs.python-version }} + steps: + - id: set + run: | + echo 'os=${{ github.event_name == 'push' && '["ubuntu-latest"]' || env.TEST_MATRIX_OS }}' >> $GITHUB_OUTPUT + echo 'python-version=${{ github.event_name == 'push' && '["3.10"]' || env.TEST_MATRIX_PYTHON }}' >> $GITHUB_OUTPUT + run: name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} + needs: compute-test-matrix + permissions: + contents: write + pull-requests: write runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - python-version: ["3.10", "3.14"] + os: ${{ fromJSON(needs.compute-test-matrix.outputs.os) }} + python-version: ${{ fromJSON(needs.compute-test-matrix.outputs.python-version) }} steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 @@ -50,10 +77,33 @@ jobs: if: matrix.python-version == '3.10' && runner.os == 'Linux' run: hatch run fmt-check && hatch run test:types - - name: Run tests - run: hatch run test:cov-retry + - name: Run unit tests + run: hatch run test:unit-cov-retry + + # On PR: generates coverage comment artifact. On push to main: stores coverage baseline on data branch. + - name: Store unit tests coverage + if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name != 'schedule' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/weave + SUBPROJECT_ID: weave + COMMENT_ARTIFACT_NAME: coverage-comment-weave + + - name: Run integration tests + run: hatch run test:integration-cov-append-retry + + - name: Store combined coverage + if: github.event_name == 'push' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/weave + SUBPROJECT_ID: weave-combined + COMMENT_ARTIFACT_NAME: coverage-comment-weave-combined - name: Run unit tests with lowest direct dependencies + if: github.event_name != 'push' run: | hatch run uv pip compile pyproject.toml --resolution lowest-direct --output-file requirements_lowest_direct.txt hatch -e test env run -- uv pip install -r requirements_lowest_direct.txt diff --git a/.github/workflows/weaviate.yml b/.github/workflows/weaviate.yml index 165015a0fc..3f72d285e8 100644 --- a/.github/workflows/weaviate.yml +++ b/.github/workflows/weaviate.yml @@ -10,28 +10,55 @@ on: - "integrations/weaviate/**" - ".github/workflows/weaviate.yml" - "!integrations/weaviate/*.md" + push: + branches: + - main + paths: + - "integrations/weaviate/**" + - ".github/workflows/weaviate.yml" + - "!integrations/weaviate/*.md" defaults: run: working-directory: integrations/weaviate concurrency: - group: weaviate-${{ github.head_ref }} + group: weaviate-${{ github.head_ref || github.sha }} cancel-in-progress: true env: PYTHONUNBUFFERED: "1" FORCE_COLOR: "1" + TEST_MATRIX_OS: '["ubuntu-latest"]' + TEST_MATRIX_PYTHON: '["3.10", "3.14"]' jobs: + compute-test-matrix: + runs-on: ubuntu-slim + defaults: + run: + working-directory: . + outputs: + os: ${{ steps.set.outputs.os }} + python-version: ${{ steps.set.outputs.python-version }} + steps: + - id: set + run: | + echo 'os=${{ github.event_name == 'push' && '["ubuntu-latest"]' || env.TEST_MATRIX_OS }}' >> $GITHUB_OUTPUT + echo 'python-version=${{ github.event_name == 'push' && '["3.10"]' || env.TEST_MATRIX_PYTHON }}' >> $GITHUB_OUTPUT + run: name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} + needs: compute-test-matrix + permissions: + contents: write + pull-requests: write runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-latest] # we run Weaviate using Docker, which is not available on MacOS and Windows GitHub Runners - python-version: ["3.10", "3.14"] + os: ${{ fromJSON(needs.compute-test-matrix.outputs.os) }} + python-version: ${{ fromJSON(needs.compute-test-matrix.outputs.python-version) }} steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 @@ -51,10 +78,33 @@ jobs: - name: Run Weaviate container run: docker compose up -d - - name: Run tests - run: hatch run test:cov-retry + - name: Run unit tests + run: hatch run test:unit-cov-retry + + # On PR: generates coverage comment artifact. On push to main: stores coverage baseline on data branch. + - name: Store unit tests coverage + if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name != 'schedule' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/weaviate + SUBPROJECT_ID: weaviate + COMMENT_ARTIFACT_NAME: coverage-comment-weaviate + + - name: Run integration tests + run: hatch run test:integration-cov-append-retry + + - name: Store combined coverage + if: github.event_name == 'push' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/weaviate + SUBPROJECT_ID: weaviate-combined + COMMENT_ARTIFACT_NAME: coverage-comment-weaviate-combined - name: Run unit tests with lowest direct dependencies + if: github.event_name != 'push' run: | hatch run uv pip compile pyproject.toml --resolution lowest-direct --output-file requirements_lowest_direct.txt hatch -e test env run -- uv pip install -r requirements_lowest_direct.txt diff --git a/integrations/aimlapi/pyproject.toml b/integrations/aimlapi/pyproject.toml index ca171bb1c1..ac7825647e 100644 --- a/integrations/aimlapi/pyproject.toml +++ b/integrations/aimlapi/pyproject.toml @@ -64,7 +64,8 @@ dependencies = [ unit = 'pytest -m "not integration" {args:tests}' integration = 'pytest -m "integration" {args:tests}' all = 'pytest {args:tests}' -cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x {args:tests}' +unit-cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x -m "not integration" {args:tests}' +integration-cov-append-retry = 'pytest --cov=haystack_integrations --cov-append --reruns 3 --reruns-delay 30 -x -m "integration" {args:tests}' types = "mypy -p haystack_integrations.components.generators.aimlapi {args}" @@ -144,6 +145,7 @@ ban-relative-imports = "parents" [tool.coverage.run] source = ["haystack_integrations"] branch = true +relative_files = true parallel = false diff --git a/integrations/amazon_bedrock/pyproject.toml b/integrations/amazon_bedrock/pyproject.toml index 93754cc879..81fd65f544 100644 --- a/integrations/amazon_bedrock/pyproject.toml +++ b/integrations/amazon_bedrock/pyproject.toml @@ -66,7 +66,8 @@ dependencies = [ unit = 'pytest -m "not integration" {args:tests}' integration = 'pytest -m "integration" {args:tests}' all = 'pytest {args:tests}' -cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x {args:tests}' +unit-cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x -m "not integration" {args:tests}' +integration-cov-append-retry = 'pytest --cov=haystack_integrations --cov-append --reruns 3 --reruns-delay 30 -x -m "integration" {args:tests}' types = """mypy -p haystack_integrations.common.amazon_bedrock \ -p haystack_integrations.components.embedders.amazon_bedrock \ @@ -163,6 +164,7 @@ ban-relative-imports = "parents" [tool.coverage.run] source = ["haystack_integrations"] branch = true +relative_files = true parallel = true [tool.coverage.report] diff --git a/integrations/amazon_sagemaker/pyproject.toml b/integrations/amazon_sagemaker/pyproject.toml index 35d7c760c4..4465667852 100644 --- a/integrations/amazon_sagemaker/pyproject.toml +++ b/integrations/amazon_sagemaker/pyproject.toml @@ -66,7 +66,8 @@ dependencies = [ unit = 'pytest -m "not integration" {args:tests}' integration = 'pytest -m "integration" {args:tests}' all = 'pytest {args:tests}' -cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x {args:tests}' +unit-cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x -m "not integration" {args:tests}' +integration-cov-append-retry = 'pytest --cov=haystack_integrations --cov-append --reruns 3 --reruns-delay 30 -x -m "integration" {args:tests}' types = "mypy -p haystack_integrations.components.generators.amazon_sagemaker {args}" [tool.mypy] @@ -146,6 +147,7 @@ ban-relative-imports = "parents" [tool.coverage.run] source = ["haystack_integrations"] branch = true +relative_files = true parallel = true [tool.coverage.report] diff --git a/integrations/anthropic/pyproject.toml b/integrations/anthropic/pyproject.toml index 2fe2f490f5..e20cc8e0be 100644 --- a/integrations/anthropic/pyproject.toml +++ b/integrations/anthropic/pyproject.toml @@ -66,7 +66,8 @@ dependencies = [ unit = 'pytest -m "not integration" {args:tests}' integration = 'pytest -m "integration" {args:tests}' all = 'pytest {args:tests}' -cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x {args:tests}' +unit-cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x -m "not integration" {args:tests}' +integration-cov-append-retry = 'pytest --cov=haystack_integrations --cov-append --reruns 3 --reruns-delay 30 -x -m "integration" {args:tests}' types = "mypy -p haystack_integrations.components.generators.anthropic {args}" @@ -151,6 +152,7 @@ ban-relative-imports = "parents" [tool.coverage.run] source = ["haystack_integrations"] branch = true +relative_files = true parallel = true [tool.coverage.report] diff --git a/integrations/arcadedb/pyproject.toml b/integrations/arcadedb/pyproject.toml index ce55792adf..3a1dd006b8 100644 --- a/integrations/arcadedb/pyproject.toml +++ b/integrations/arcadedb/pyproject.toml @@ -66,7 +66,8 @@ dependencies = [ unit = 'pytest -m "not integration" {args:tests}' integration = 'pytest -m "integration" {args:tests}' all = 'pytest {args:tests}' -cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x {args:tests}' +unit-cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x -m "not integration" {args:tests}' +integration-cov-append-retry = 'pytest --cov=haystack_integrations --cov-append --reruns 3 --reruns-delay 30 -x -m "integration" {args:tests}' types = "mypy -p haystack_integrations.document_stores.arcadedb -p haystack_integrations.components.retrievers.arcadedb {args}" [tool.mypy] @@ -111,6 +112,7 @@ ban-relative-imports = "parents" [tool.coverage.run] source = ["haystack_integrations"] branch = true +relative_files = true parallel = false [tool.coverage.report] diff --git a/integrations/astra/pyproject.toml b/integrations/astra/pyproject.toml index 72e2acec5c..aec231f43a 100644 --- a/integrations/astra/pyproject.toml +++ b/integrations/astra/pyproject.toml @@ -68,7 +68,8 @@ dependencies = [ unit = 'pytest -m "not integration" {args:tests}' integration = 'pytest -m "integration" {args:tests}' all = 'pytest {args:tests}' -cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x {args:tests}' +unit-cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x -m "not integration" {args:tests}' +integration-cov-append-retry = 'pytest --cov=haystack_integrations --cov-append --reruns 3 --reruns-delay 30 -x -m "integration" {args:tests}' types = """mypy -p haystack_integrations.document_stores.astra \ -p haystack_integrations.components.retrievers.astra {args}""" @@ -148,6 +149,7 @@ ban-relative-imports = "parents" [tool.coverage.run] source = ["haystack_integrations"] branch = true +relative_files = true parallel = false diff --git a/integrations/azure_ai_search/pyproject.toml b/integrations/azure_ai_search/pyproject.toml index 066011bd31..0b4a2eef50 100644 --- a/integrations/azure_ai_search/pyproject.toml +++ b/integrations/azure_ai_search/pyproject.toml @@ -68,7 +68,8 @@ dependencies = [ unit = 'pytest -m "not integration" {args:tests}' integration = 'pytest -m "integration" {args:tests}' all = 'pytest {args:tests}' -cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x {args:tests}' +unit-cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x -m "not integration" {args:tests}' +integration-cov-append-retry = 'pytest --cov=haystack_integrations --cov-append --reruns 3 --reruns-delay 30 -x -m "integration" {args:tests}' types = """mypy -p haystack_integrations.document_stores.azure_ai_search \ -p haystack_integrations.components.retrievers.azure_ai_search {args}""" @@ -154,6 +155,7 @@ ban-relative-imports = "parents" [tool.coverage.run] source = ["haystack_integrations"] branch = true +relative_files = true parallel = false diff --git a/integrations/azure_doc_intelligence/pyproject.toml b/integrations/azure_doc_intelligence/pyproject.toml index 7949bfca73..edb5273b66 100644 --- a/integrations/azure_doc_intelligence/pyproject.toml +++ b/integrations/azure_doc_intelligence/pyproject.toml @@ -75,7 +75,8 @@ dependencies = [ unit = 'pytest -m "not integration" {args:tests}' integration = 'pytest -m "integration" {args:tests}' all = 'pytest {args:tests}' -cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x {args:tests}' +unit-cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x -m "not integration" {args:tests}' +integration-cov-append-retry = 'pytest --cov=haystack_integrations --cov-append --reruns 3 --reruns-delay 30 -x -m "integration" {args:tests}' types = "mypy -p haystack_integrations.components.converters.azure_doc_intelligence {args}" [tool.mypy] @@ -153,6 +154,7 @@ ban-relative-imports = "parents" [tool.coverage.run] source = ["haystack_integrations"] branch = true +relative_files = true parallel = false [tool.coverage.report] diff --git a/integrations/chroma/pyproject.toml b/integrations/chroma/pyproject.toml index 8d4076d92c..579628c054 100644 --- a/integrations/chroma/pyproject.toml +++ b/integrations/chroma/pyproject.toml @@ -67,7 +67,8 @@ dependencies = [ unit = 'pytest -m "not integration" {args:tests}' integration = 'pytest -m "integration" {args:tests}' all = 'pytest {args:tests}' -cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x {args:tests}' +unit-cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x -m "not integration" {args:tests}' +integration-cov-append-retry = 'pytest --cov=haystack_integrations --cov-append --reruns 3 --reruns-delay 30 -x -m "integration" {args:tests}' types = "mypy -p haystack_integrations.components.retrievers.chroma -p haystack_integrations.document_stores.chroma {args}" @@ -155,6 +156,7 @@ ban-relative-imports = "parents" [tool.coverage.run] source = ["haystack_integrations"] branch = true +relative_files = true parallel = false diff --git a/integrations/cohere/pyproject.toml b/integrations/cohere/pyproject.toml index e3291a9bce..c362075f6e 100644 --- a/integrations/cohere/pyproject.toml +++ b/integrations/cohere/pyproject.toml @@ -67,7 +67,8 @@ dependencies = [ unit = 'pytest -m "not integration" {args:tests}' integration = 'pytest -m "integration" {args:tests}' all = 'pytest {args:tests}' -cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x {args:tests}' +unit-cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x -m "not integration" {args:tests}' +integration-cov-append-retry = 'pytest --cov=haystack_integrations --cov-append --reruns 3 --reruns-delay 30 -x -m "integration" {args:tests}' types = """mypy -p haystack_integrations.components.embedders.cohere \ -p haystack_integrations.components.generators.cohere \ @@ -150,6 +151,7 @@ ban-relative-imports = "parents" [tool.coverage.run] source = ["haystack_integrations"] branch = true +relative_files = true parallel = false diff --git a/integrations/cometapi/pyproject.toml b/integrations/cometapi/pyproject.toml index a35c838121..07f273020d 100644 --- a/integrations/cometapi/pyproject.toml +++ b/integrations/cometapi/pyproject.toml @@ -68,7 +68,8 @@ dependencies = [ unit = 'pytest -m "not integration" {args:tests}' integration = 'pytest -m "integration" {args:tests}' all = 'pytest {args:tests}' -cov-retry = 'all --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x' +unit-cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x -m "not integration" {args:tests}' +integration-cov-append-retry = 'pytest --cov=haystack_integrations --cov-append --reruns 3 --reruns-delay 30 -x -m "integration" {args:tests}' types = "mypy -p haystack_integrations.components.generators.cometapi {args}" @@ -157,6 +158,7 @@ ban-relative-imports = "parents" [tool.coverage.run] source = ["haystack_integrations"] branch = true +relative_files = true parallel = true [tool.coverage.report] diff --git a/integrations/deepeval/pyproject.toml b/integrations/deepeval/pyproject.toml index 352ae62d5e..2522223cb4 100644 --- a/integrations/deepeval/pyproject.toml +++ b/integrations/deepeval/pyproject.toml @@ -63,7 +63,8 @@ dependencies = [ unit = 'pytest -m "not integration" {args:tests}' integration = 'pytest -m "integration" {args:tests}' all = 'pytest {args:tests}' -cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x {args:tests}' +unit-cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x -m "not integration" {args:tests}' +integration-cov-append-retry = 'pytest --cov=haystack_integrations --cov-append --reruns 3 --reruns-delay 30 -x -m "integration" {args:tests}' types = "mypy -p haystack_integrations.components.evaluators.deepeval {args}" [tool.mypy] @@ -154,6 +155,7 @@ ban-relative-imports = "all" [tool.coverage.run] source = ["haystack_integrations"] branch = true +relative_files = true parallel = false diff --git a/integrations/elasticsearch/pyproject.toml b/integrations/elasticsearch/pyproject.toml index 1d3a2ec1e2..7c5c35e52b 100644 --- a/integrations/elasticsearch/pyproject.toml +++ b/integrations/elasticsearch/pyproject.toml @@ -68,7 +68,8 @@ dependencies = [ unit = 'pytest -m "not integration" {args:tests}' integration = 'pytest -m "integration" {args:tests}' all = 'pytest {args:tests}' -cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x {args:tests}' +unit-cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x -m "not integration" {args:tests}' +integration-cov-append-retry = 'pytest --cov=haystack_integrations --cov-append --reruns 3 --reruns-delay 30 -x -m "integration" {args:tests}' types = """mypy -p haystack_integrations.document_stores.elasticsearch \ -p haystack_integrations.components.retrievers.elasticsearch {args}""" @@ -151,6 +152,7 @@ ban-relative-imports = "parents" [tool.coverage.run] source = ["haystack_integrations"] branch = true +relative_files = true parallel = false diff --git a/integrations/faiss/pyproject.toml b/integrations/faiss/pyproject.toml index 239663fc4a..a529b5b704 100644 --- a/integrations/faiss/pyproject.toml +++ b/integrations/faiss/pyproject.toml @@ -68,7 +68,8 @@ dependencies = [ unit = 'pytest -m "not integration" {args:tests}' integration = 'pytest -m "integration" {args:tests}' all = 'pytest {args:tests}' -cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x {args:tests}' +unit-cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x -m "not integration" {args:tests}' +integration-cov-append-retry = 'pytest --cov=haystack_integrations --cov-append --reruns 3 --reruns-delay 30 -x -m "integration" {args:tests}' types = "mypy -p haystack_integrations.document_stores.faiss -p haystack_integrations.components.retrievers.faiss {args}" @@ -162,6 +163,7 @@ ban-relative-imports = "parents" [tool.coverage.run] source = ["haystack_integrations"] branch = true +relative_files = true parallel = false diff --git a/integrations/fastembed/pyproject.toml b/integrations/fastembed/pyproject.toml index c457328fe2..0d3c0a7563 100644 --- a/integrations/fastembed/pyproject.toml +++ b/integrations/fastembed/pyproject.toml @@ -63,7 +63,8 @@ dependencies = [ unit = 'pytest -m "not integration" {args:tests}' integration = 'pytest -m "integration" {args:tests}' all = 'pytest {args:tests}' -cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x {args:tests}' +unit-cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x -m "not integration" {args:tests}' +integration-cov-append-retry = 'pytest --cov=haystack_integrations --cov-append --reruns 3 --reruns-delay 30 -x -m "integration" {args:tests}' types = """mypy -p haystack_integrations.components.embedders.fastembed \ -p haystack_integrations.components.rankers.fastembed {args}""" @@ -148,6 +149,7 @@ ban-relative-imports = "parents" [tool.coverage.run] source = ["haystack_integrations"] branch = true +relative_files = true parallel = false [tool.coverage.report] diff --git a/integrations/firecrawl/pyproject.toml b/integrations/firecrawl/pyproject.toml index 0b75c56cea..a37e4a3bca 100644 --- a/integrations/firecrawl/pyproject.toml +++ b/integrations/firecrawl/pyproject.toml @@ -74,7 +74,8 @@ dependencies = [ unit = 'pytest -m "not integration" {args:tests}' integration = 'pytest -m "integration" {args:tests}' all = 'pytest {args:tests}' -cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x {args:tests}' +unit-cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x -m "not integration" {args:tests}' +integration-cov-append-retry = 'pytest --cov=haystack_integrations --cov-append --reruns 3 --reruns-delay 30 -x -m "integration" {args:tests}' types = "mypy -p haystack_integrations.components.fetchers.firecrawl -p haystack_integrations.components.websearch.firecrawl {args}" [tool.mypy] @@ -159,6 +160,7 @@ ban-relative-imports = "parents" [tool.coverage.run] source = ["haystack_integrations"] branch = true +relative_files = true parallel = false [tool.coverage.report] diff --git a/integrations/github/pyproject.toml b/integrations/github/pyproject.toml index 6cf95b2a1f..b7e6211425 100644 --- a/integrations/github/pyproject.toml +++ b/integrations/github/pyproject.toml @@ -64,7 +64,8 @@ dependencies = [ unit = 'pytest -m "not integration" {args:tests}' integration = 'pytest -m "integration" {args:tests}' all = 'pytest {args:tests}' -cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x {args:tests}' +unit-cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x -m "not integration" {args:tests}' +integration-cov-append-retry = 'pytest --cov=haystack_integrations --cov-append --reruns 3 --reruns-delay 30 -x -m "integration" {args:tests}' types = """mypy -p haystack_integrations.components.connectors.github \ -p haystack_integrations.prompts.github \ @@ -149,6 +150,7 @@ ban-relative-imports = "parents" [tool.coverage.run] source = ["haystack_integrations"] branch = true +relative_files = true parallel = false diff --git a/integrations/google_genai/pyproject.toml b/integrations/google_genai/pyproject.toml index b3b514ca21..87fbb06ca0 100644 --- a/integrations/google_genai/pyproject.toml +++ b/integrations/google_genai/pyproject.toml @@ -68,7 +68,8 @@ dependencies = [ unit = 'pytest -m "not integration" {args:tests}' integration = 'pytest -m "integration" {args:tests}' all = 'pytest {args:tests}' -cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x {args:tests}' +unit-cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x -m "not integration" {args:tests}' +integration-cov-append-retry = 'pytest --cov=haystack_integrations --cov-append --reruns 3 --reruns-delay 30 -x -m "integration" {args:tests}' types = """mypy -p haystack_integrations.components.generators.google_genai \ -p haystack_integrations.components.embedders.google_genai \ @@ -165,6 +166,7 @@ ban-relative-imports = "parents" [tool.coverage.run] source = ["haystack_integrations"] branch = true +relative_files = true parallel = true [tool.coverage.report] diff --git a/integrations/hanlp/pyproject.toml b/integrations/hanlp/pyproject.toml index 44694c00cc..327f29a9e5 100644 --- a/integrations/hanlp/pyproject.toml +++ b/integrations/hanlp/pyproject.toml @@ -71,7 +71,8 @@ dependencies = [ unit = 'pytest -m "not integration" {args:tests}' integration = 'pytest -m "integration" {args:tests}' all = 'pytest {args:tests}' -cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x {args:tests}' +unit-cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x -m "not integration" {args:tests}' +integration-cov-append-retry = 'pytest --cov=haystack_integrations --cov-append --reruns 3 --reruns-delay 30 -x -m "integration" {args:tests}' types = """mypy -p haystack_integrations.components.preprocessors.hanlp {args}""" [tool.mypy] @@ -165,6 +166,7 @@ ban-relative-imports = "parents" [tool.coverage.run] source = ["haystack_integrations"] branch = true +relative_files = true parallel = false [tool.coverage.report] diff --git a/integrations/jina/pyproject.toml b/integrations/jina/pyproject.toml index ee887ee2ef..01e8ae72ba 100644 --- a/integrations/jina/pyproject.toml +++ b/integrations/jina/pyproject.toml @@ -68,7 +68,8 @@ dependencies = [ unit = 'pytest -m "not integration" {args:tests}' integration = 'pytest -m "integration" {args:tests}' all = 'pytest {args:tests}' -cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x {args:tests}' +unit-cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x -m "not integration" {args:tests}' +integration-cov-append-retry = 'pytest --cov=haystack_integrations --cov-append --reruns 3 --reruns-delay 30 -x -m "integration" {args:tests}' types = """mypy -p haystack_integrations.components.connectors.jina \ -p haystack_integrations.components.embedders.jina {args}""" @@ -149,6 +150,7 @@ ban-relative-imports = "parents" [tool.coverage.run] source = ["haystack_integrations"] branch = true +relative_files = true parallel = false [tool.coverage.report] diff --git a/integrations/langfuse/pyproject.toml b/integrations/langfuse/pyproject.toml index 7bb9be404c..a186328302 100644 --- a/integrations/langfuse/pyproject.toml +++ b/integrations/langfuse/pyproject.toml @@ -66,7 +66,8 @@ dependencies = [ unit = 'pytest -m "not integration" {args:tests}' integration = 'pytest -m "integration" {args:tests}' all = 'pytest {args:tests}' -cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x {args:tests}' +unit-cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x -m "not integration" {args:tests}' +integration-cov-append-retry = 'pytest --cov=haystack_integrations --cov-append --reruns 3 --reruns-delay 30 -x -m "integration" {args:tests}' types = "mypy -p haystack_integrations.components.connectors.langfuse -p haystack_integrations.tracing.langfuse {args}" @@ -152,6 +153,7 @@ ban-relative-imports = "parents" [tool.coverage.run] source = ["haystack_integrations"] branch = true +relative_files = true parallel = false @@ -159,6 +161,8 @@ parallel = false omit = ["*/tests/*", "*/__init__.py"] show_missing = true exclude_lines = ["no cov", "if __name__ == .__main__.:", "if TYPE_CHECKING:"] +# coverage automatically detects some of the test dependencies but cannot find the source, so we ignore the errors +ignore_errors = true [tool.pytest.ini_options] addopts = "--strict-markers" diff --git a/integrations/lara/pyproject.toml b/integrations/lara/pyproject.toml index cdd6bd31f9..6a4262567e 100644 --- a/integrations/lara/pyproject.toml +++ b/integrations/lara/pyproject.toml @@ -70,7 +70,8 @@ dependencies = [ unit = 'pytest -m "not integration" {args:tests}' integration = 'pytest -m "integration" {args:tests}' all = 'pytest {args:tests}' -cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x {args:tests}' +unit-cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x -m "not integration" {args:tests}' +integration-cov-append-retry = 'pytest --cov=haystack_integrations --cov-append --reruns 3 --reruns-delay 30 -x -m "integration" {args:tests}' types = 'mypy -p haystack_integrations.components.translators.lara {args}' [tool.mypy] @@ -161,6 +162,7 @@ ban-relative-imports = "parents" [tool.coverage.run] source = ["haystack_integrations"] branch = true +relative_files = true parallel = false [tool.coverage.report] diff --git a/integrations/libreoffice/pyproject.toml b/integrations/libreoffice/pyproject.toml index 7bb96b0b19..66584a3d63 100644 --- a/integrations/libreoffice/pyproject.toml +++ b/integrations/libreoffice/pyproject.toml @@ -64,7 +64,8 @@ dependencies = [ unit = 'pytest -m "not integration" {args:tests}' integration = 'pytest -m "integration" {args:tests}' all = 'pytest {args:tests}' -cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x {args:tests}' +unit-cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x -m "not integration" {args:tests}' +integration-cov-append-retry = 'pytest --cov=haystack_integrations --cov-append --reruns 3 --reruns-delay 30 -x -m "integration" {args:tests}' types = "mypy -p haystack_integrations.components.converters.libreoffice {args}" [tool.mypy] @@ -143,6 +144,7 @@ ban-relative-imports = "parents" [tool.coverage.run] source = ["haystack_integrations"] branch = true +relative_files = true parallel = false [tool.coverage.report] diff --git a/integrations/llama_cpp/pyproject.toml b/integrations/llama_cpp/pyproject.toml index f7870caf85..31d2d215b2 100644 --- a/integrations/llama_cpp/pyproject.toml +++ b/integrations/llama_cpp/pyproject.toml @@ -75,7 +75,8 @@ dependencies = [ unit = 'pytest -m "not integration" {args:tests}' integration = 'pytest -m "integration" {args:tests}' all = 'pytest {args:tests}' -cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x {args:tests}' +unit-cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x -m "not integration" {args:tests}' +integration-cov-append-retry = 'pytest --cov=haystack_integrations --cov-append --reruns 3 --reruns-delay 30 -x -m "integration" {args:tests}' types = "mypy -p haystack_integrations.components.generators.llama_cpp {args}" [tool.mypy] @@ -157,6 +158,7 @@ ban-relative-imports = "parents" [tool.coverage.run] source = ["haystack_integrations"] branch = true +relative_files = true parallel = false diff --git a/integrations/llama_stack/pyproject.toml b/integrations/llama_stack/pyproject.toml index 6a38f85ecc..928100e538 100644 --- a/integrations/llama_stack/pyproject.toml +++ b/integrations/llama_stack/pyproject.toml @@ -62,7 +62,8 @@ dependencies = [ unit = 'pytest -m "not integration" {args:tests}' integration = 'pytest -m "integration" {args:tests}' all = 'pytest {args:tests}' -cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x {args:tests}' +unit-cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x -m "not integration" {args:tests}' +integration-cov-append-retry = 'pytest --cov=haystack_integrations --cov-append --reruns 3 --reruns-delay 30 -x -m "integration" {args:tests}' types = "mypy -p haystack_integrations.components.generators.llama_stack {args}" @@ -151,6 +152,7 @@ ban-relative-imports = "parents" [tool.coverage.run] source = ["haystack_integrations"] branch = true +relative_files = true parallel = false diff --git a/integrations/markitdown/pyproject.toml b/integrations/markitdown/pyproject.toml index 066583efdb..eae5165f4d 100644 --- a/integrations/markitdown/pyproject.toml +++ b/integrations/markitdown/pyproject.toml @@ -64,7 +64,8 @@ dependencies = [ unit = 'pytest -m "not integration" {args:tests}' integration = 'pytest -m "integration" {args:tests}' all = 'pytest {args:tests}' -cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x {args:tests}' +unit-cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x -m "not integration" {args:tests}' +integration-cov-append-retry = 'pytest --cov=haystack_integrations --cov-append --reruns 3 --reruns-delay 30 -x -m "integration" {args:tests}' types = "mypy -p haystack_integrations.components.converters.markitdown {args}" [tool.mypy] @@ -147,6 +148,7 @@ ban-relative-imports = "parents" [tool.coverage.run] source = ["haystack_integrations"] branch = true +relative_files = true parallel = false [tool.coverage.report] diff --git a/integrations/mcp/pyproject.toml b/integrations/mcp/pyproject.toml index 3dee9bfaa4..7ebd86c4e4 100644 --- a/integrations/mcp/pyproject.toml +++ b/integrations/mcp/pyproject.toml @@ -78,7 +78,8 @@ dependencies = [ unit = 'pytest -m "not integration" {args:tests}' integration = 'pytest -m "integration" {args:tests}' all = 'pytest {args:tests}' -cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x {args:tests}' +unit-cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x -m "not integration" {args:tests}' +integration-cov-append-retry = 'pytest --cov=haystack_integrations --cov-append --reruns 3 --reruns-delay 30 -x -m "integration" {args:tests}' types = """mypy -p haystack_integrations.tools.mcp {args}""" [tool.mypy] @@ -166,6 +167,7 @@ ban-relative-imports = "parents" [tool.coverage.run] source = ["haystack_integrations"] branch = true +relative_files = true parallel = false [tool.coverage.report] diff --git a/integrations/meta_llama/pyproject.toml b/integrations/meta_llama/pyproject.toml index c7829c8a24..a578892ea7 100644 --- a/integrations/meta_llama/pyproject.toml +++ b/integrations/meta_llama/pyproject.toml @@ -64,7 +64,8 @@ dependencies = [ unit = 'pytest -m "not integration" {args:tests}' integration = 'pytest -m "integration" {args:tests}' all = 'pytest {args:tests}' -cov-retry = 'pytest --cov="haystack_integrations" --reruns 3 --reruns-delay 30 -x {args:tests}' +unit-cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x -m "not integration" {args:tests}' +integration-cov-append-retry = 'pytest --cov=haystack_integrations --cov-append --reruns 3 --reruns-delay 30 -x -m "integration" {args:tests}' types = "mypy -p haystack_integrations.components.generators.meta_llama {args}" @@ -145,6 +146,7 @@ ban-relative-imports = "parents" [tool.coverage.run] source = ["haystack_integrations"] branch = true +relative_files = true parallel = false diff --git a/integrations/mistral/pyproject.toml b/integrations/mistral/pyproject.toml index aa86633158..2dcb388027 100644 --- a/integrations/mistral/pyproject.toml +++ b/integrations/mistral/pyproject.toml @@ -65,7 +65,8 @@ dependencies = [ unit = 'pytest -m "not integration" {args:tests}' integration = 'pytest -m "integration" {args:tests}' all = 'pytest {args:tests}' -cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x {args:tests}' +unit-cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x -m "not integration" {args:tests}' +integration-cov-append-retry = 'pytest --cov=haystack_integrations --cov-append --reruns 3 --reruns-delay 30 -x -m "integration" {args:tests}' types = """mypy -p haystack_integrations.components.embedders.mistral \ -p haystack_integrations.components.generators.mistral \ @@ -148,6 +149,7 @@ ban-relative-imports = "parents" [tool.coverage.run] source = ["haystack_integrations"] branch = true +relative_files = true parallel = false diff --git a/integrations/mongodb_atlas/pyproject.toml b/integrations/mongodb_atlas/pyproject.toml index 34fabc1ac6..fea96e99a4 100644 --- a/integrations/mongodb_atlas/pyproject.toml +++ b/integrations/mongodb_atlas/pyproject.toml @@ -67,7 +67,8 @@ dependencies = [ unit = 'pytest -m "not integration" {args:tests}' integration = 'pytest -m "integration" {args:tests}' all = 'pytest {args:tests}' -cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x {args:tests}' +unit-cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x -m "not integration" {args:tests}' +integration-cov-append-retry = 'pytest --cov=haystack_integrations --cov-append --reruns 3 --reruns-delay 30 -x -m "integration" {args:tests}' types = """mypy -p haystack_integrations.components.retrievers.mongodb_atlas \ -p haystack_integrations.document_stores.mongodb_atlas {args}""" @@ -154,6 +155,7 @@ ban-relative-imports = "parents" [tool.coverage.run] source = ["haystack_integrations"] branch = true +relative_files = true parallel = false diff --git a/integrations/nvidia/pyproject.toml b/integrations/nvidia/pyproject.toml index 8e844b3af0..9d81bf1a21 100644 --- a/integrations/nvidia/pyproject.toml +++ b/integrations/nvidia/pyproject.toml @@ -66,7 +66,8 @@ dependencies = [ unit = 'pytest -m "not integration" {args:tests}' integration = 'pytest -m "integration" {args:tests}' all = 'pytest {args:tests}' -cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x {args:tests}' +unit-cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x -m "not integration" {args:tests}' +integration-cov-append-retry = 'pytest --cov=haystack_integrations --cov-append --reruns 3 --reruns-delay 30 -x -m "integration" {args:tests}' types = """mypy -p haystack_integrations.components.embedders.nvidia \ -p haystack_integrations.components.generators.nvidia \ @@ -152,6 +153,7 @@ ban-relative-imports = "parents" [tool.coverage.run] source = ["haystack_integrations"] branch = true +relative_files = true parallel = false diff --git a/integrations/ollama/pyproject.toml b/integrations/ollama/pyproject.toml index ab38cb6ceb..06f66cd7b4 100644 --- a/integrations/ollama/pyproject.toml +++ b/integrations/ollama/pyproject.toml @@ -69,7 +69,8 @@ dependencies = [ unit = 'pytest -m "not integration" {args:tests}' integration = 'pytest -m "integration" {args:tests}' all = 'pytest {args:tests}' -cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x {args:tests}' +unit-cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x -m "not integration" {args:tests}' +integration-cov-append-retry = 'pytest --cov=haystack_integrations --cov-append --reruns 3 --reruns-delay 30 -x -m "integration" {args:tests}' types = """mypy -p haystack_integrations.components.embedders.ollama \ -p haystack_integrations.components.generators.ollama {args}""" @@ -153,6 +154,7 @@ ban-relative-imports = "parents" [tool.coverage.run] source = ["haystack_integrations"] branch = true +relative_files = true parallel = false [tool.coverage.report] diff --git a/integrations/openrouter/pyproject.toml b/integrations/openrouter/pyproject.toml index 70cdc9343d..62b4613863 100644 --- a/integrations/openrouter/pyproject.toml +++ b/integrations/openrouter/pyproject.toml @@ -64,7 +64,8 @@ dependencies = [ unit = 'pytest -m "not integration" {args:tests}' integration = 'pytest -m "integration" {args:tests}' all = 'pytest {args:tests}' -cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x {args:tests}' +unit-cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x -m "not integration" {args:tests}' +integration-cov-append-retry = 'pytest --cov=haystack_integrations --cov-append --reruns 3 --reruns-delay 30 -x -m "integration" {args:tests}' types = "mypy -p haystack_integrations.components.generators.openrouter {args}" @@ -148,6 +149,7 @@ ban-relative-imports = "parents" [tool.coverage.run] source = ["haystack_integrations"] branch = true +relative_files = true parallel = false diff --git a/integrations/opensearch/pyproject.toml b/integrations/opensearch/pyproject.toml index 7181ea18f4..6c7ebfd190 100644 --- a/integrations/opensearch/pyproject.toml +++ b/integrations/opensearch/pyproject.toml @@ -71,7 +71,8 @@ dependencies = [ unit = 'pytest -m "not integration" {args:tests}' integration = 'pytest -m "integration" {args:tests}' all = 'pytest {args:tests}' -cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x {args:tests}' +unit-cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x -m "not integration" {args:tests}' +integration-cov-append-retry = 'pytest --cov=haystack_integrations --cov-append --reruns 3 --reruns-delay 30 -x -m "integration" {args:tests}' types = """mypy -p haystack_integrations.document_stores.opensearch \ -p haystack_integrations.components.retrievers.opensearch {args}""" @@ -157,6 +158,7 @@ ban-relative-imports = "parents" [tool.coverage.run] source = ["haystack_integrations"] branch = true +relative_files = true parallel = false diff --git a/integrations/optimum/pyproject.toml b/integrations/optimum/pyproject.toml index 0f778fcb6c..7225debed1 100644 --- a/integrations/optimum/pyproject.toml +++ b/integrations/optimum/pyproject.toml @@ -78,7 +78,8 @@ dependencies = [ unit = 'pytest -m "not integration" {args:tests}' integration = 'pytest -m "integration" {args:tests}' all = 'pytest {args:tests}' -cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x {args:tests}' +unit-cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x -m "not integration" {args:tests}' +integration-cov-append-retry = 'pytest --cov=haystack_integrations --cov-append --reruns 3 --reruns-delay 30 -x -m "integration" {args:tests}' types = "mypy -p haystack_integrations.components.embedders.optimum {args}" @@ -168,6 +169,7 @@ ban-relative-imports = "parents" [tool.coverage.run] source = ["haystack_integrations"] branch = true +relative_files = true parallel = false diff --git a/integrations/paddleocr/pyproject.toml b/integrations/paddleocr/pyproject.toml index 3f0ccd33d1..491abe54b7 100644 --- a/integrations/paddleocr/pyproject.toml +++ b/integrations/paddleocr/pyproject.toml @@ -69,7 +69,8 @@ dependencies = [ unit = 'pytest -m "not integration" {args:tests}' integration = 'pytest -m "integration" {args:tests}' all = 'pytest {args:tests}' -cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x {args:tests}' +unit-cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x -m "not integration" {args:tests}' +integration-cov-append-retry = 'pytest --cov=haystack_integrations --cov-append --reruns 3 --reruns-delay 30 -x -m "integration" {args:tests}' types = "mypy -p haystack_integrations.components.converters.paddleocr {args}" [tool.mypy] @@ -149,6 +150,7 @@ ban-relative-imports = "parents" [tool.coverage.run] source = ["haystack_integrations"] branch = true +relative_files = true parallel = false [tool.coverage.report] diff --git a/integrations/pgvector/pyproject.toml b/integrations/pgvector/pyproject.toml index 2857d38e4c..a011115755 100644 --- a/integrations/pgvector/pyproject.toml +++ b/integrations/pgvector/pyproject.toml @@ -68,7 +68,8 @@ dependencies = [ unit = 'pytest -m "not integration" {args:tests}' integration = 'pytest -m "integration" {args:tests}' all = 'pytest {args:tests}' -cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x {args:tests}' +unit-cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x -m "not integration" {args:tests}' +integration-cov-append-retry = 'pytest --cov=haystack_integrations --cov-append --reruns 3 --reruns-delay 30 -x -m "integration" {args:tests}' types = "mypy -p haystack_integrations.document_stores.pgvector -p haystack_integrations.components.retrievers.pgvector {args}" @@ -164,6 +165,7 @@ ban-relative-imports = "parents" [tool.coverage.run] source = ["haystack_integrations"] branch = true +relative_files = true parallel = false [tool.coverage.report] diff --git a/integrations/pinecone/pyproject.toml b/integrations/pinecone/pyproject.toml index 574a6a2b67..a440804ba7 100644 --- a/integrations/pinecone/pyproject.toml +++ b/integrations/pinecone/pyproject.toml @@ -70,9 +70,8 @@ unit = 'pytest -m "not integration" {args:tests}' integration = 'pytest -m "integration" {args:tests}' all = 'pytest {args:tests}' -# Pinecone tests are slow (require HTTP requests), so we run them in parallel -# with pytest-xdist (https://pytest-xdist.readthedocs.io/en/stable/distribution.html) -cov-retry = 'pytest -n auto --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x {args:tests}' +unit-cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x -m "not integration" {args:tests}' +integration-cov-append-retry = 'pytest --cov=haystack_integrations --cov-append --reruns 3 --reruns-delay 30 -x -m "integration" {args:tests}' types = """mypy -p haystack_integrations.components.retrievers.pinecone \ -p haystack_integrations.document_stores.pinecone {args}""" @@ -160,6 +159,7 @@ ban-relative-imports = "parents" [tool.coverage.run] source = ["haystack_integrations"] branch = true +relative_files = true parallel = false diff --git a/integrations/pyversity/pyproject.toml b/integrations/pyversity/pyproject.toml index cf1e368570..4075db43ae 100644 --- a/integrations/pyversity/pyproject.toml +++ b/integrations/pyversity/pyproject.toml @@ -70,7 +70,8 @@ dependencies = [ unit = 'pytest -m "not integration" {args:tests}' integration = 'pytest -m "integration" {args:tests}' all = 'pytest {args:tests}' -cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x {args:tests}' +unit-cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x -m "not integration" {args:tests}' +integration-cov-append-retry = 'pytest --cov=haystack_integrations --cov-append --reruns 3 --reruns-delay 30 -x -m "integration" {args:tests}' types = "mypy -p haystack_integrations.components.rankers.pyversity {args}" [tool.mypy] @@ -152,6 +153,7 @@ ban-relative-imports = "parents" [tool.coverage.run] source = ["haystack_integrations"] branch = true +relative_files = true parallel = false [tool.coverage.report] diff --git a/integrations/qdrant/pyproject.toml b/integrations/qdrant/pyproject.toml index 1d1102ecff..a876fdf5ff 100644 --- a/integrations/qdrant/pyproject.toml +++ b/integrations/qdrant/pyproject.toml @@ -71,7 +71,8 @@ dependencies = [ unit = 'pytest -m "not integration" {args:tests}' integration = 'pytest -m "integration" {args:tests}' all = 'pytest {args:tests}' -cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x {args:tests}' +unit-cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x -m "not integration" {args:tests}' +integration-cov-append-retry = 'pytest --cov=haystack_integrations --cov-append --reruns 3 --reruns-delay 30 -x -m "integration" {args:tests}' types = """mypy -p haystack_integrations.document_stores.qdrant \ -p haystack_integrations.components.retrievers.qdrant {args}""" @@ -159,6 +160,7 @@ ban-relative-imports = "parents" [tool.coverage.run] source = ["haystack_integrations"] branch = true +relative_files = true parallel = false diff --git a/integrations/ragas/pyproject.toml b/integrations/ragas/pyproject.toml index 3af402e0de..cfe2c9c0e7 100644 --- a/integrations/ragas/pyproject.toml +++ b/integrations/ragas/pyproject.toml @@ -64,7 +64,8 @@ dependencies = [ unit = 'pytest -m "not integration" {args:tests}' integration = 'pytest -m "integration" {args:tests}' all = 'pytest {args:tests}' -cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x {args:tests}' +unit-cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x -m "not integration" {args:tests}' +integration-cov-append-retry = 'pytest --cov=haystack_integrations --cov-append --reruns 3 --reruns-delay 30 -x -m "integration" {args:tests}' types = "mypy -p haystack_integrations.components.evaluators.ragas {args}" @@ -155,6 +156,7 @@ ban-relative-imports = "all" [tool.coverage.run] source = ["haystack_integrations"] branch = true +relative_files = true parallel = false diff --git a/integrations/snowflake/pyproject.toml b/integrations/snowflake/pyproject.toml index 11263d737a..fc924604d4 100644 --- a/integrations/snowflake/pyproject.toml +++ b/integrations/snowflake/pyproject.toml @@ -71,7 +71,8 @@ dependencies = [ unit = 'pytest -m "not integration" {args:tests}' integration = 'pytest -m "integration" {args:tests}' all = 'pytest {args:tests}' -cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x {args:tests}' +unit-cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x -m "not integration" {args:tests}' +integration-cov-append-retry = 'pytest --cov=haystack_integrations --cov-append --reruns 3 --reruns-delay 30 -x -m "integration" {args:tests}' types = "mypy -p haystack_integrations.components.retrievers.snowflake {args}" @@ -153,6 +154,7 @@ ban-relative-imports = "parents" [tool.coverage.run] source = ["haystack_integrations"] branch = true +relative_files = true parallel = false diff --git a/integrations/stackit/pyproject.toml b/integrations/stackit/pyproject.toml index 2f614b1169..2fbbda6cc6 100644 --- a/integrations/stackit/pyproject.toml +++ b/integrations/stackit/pyproject.toml @@ -64,7 +64,8 @@ dependencies = [ unit = 'pytest -m "not integration" {args:tests}' integration = 'pytest -m "integration" {args:tests}' all = 'pytest {args:tests}' -cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x {args:tests}' +unit-cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x -m "not integration" {args:tests}' +integration-cov-append-retry = 'pytest --cov=haystack_integrations --cov-append --reruns 3 --reruns-delay 30 -x -m "integration" {args:tests}' types = """mypy -p haystack_integrations.components.embedders.stackit \ -p haystack_integrations.components.generators.stackit {args}""" @@ -144,6 +145,7 @@ ban-relative-imports = "parents" [tool.coverage.run] source = ["haystack_integrations"] branch = true +relative_files = true parallel = false diff --git a/integrations/tavily/pyproject.toml b/integrations/tavily/pyproject.toml index 9a0312d8d2..7da0c562c4 100644 --- a/integrations/tavily/pyproject.toml +++ b/integrations/tavily/pyproject.toml @@ -64,7 +64,8 @@ dependencies = [ unit = 'pytest -m "not integration" {args:tests}' integration = 'pytest -m "integration" {args:tests}' all = 'pytest {args:tests}' -cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x {args:tests}' +unit-cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x -m "not integration" {args:tests}' +integration-cov-append-retry = 'pytest --cov=haystack_integrations --cov-append --reruns 3 --reruns-delay 30 -x -m "integration" {args:tests}' types = "mypy -p haystack_integrations.components.websearch.tavily {args}" [tool.mypy] @@ -147,6 +148,7 @@ ban-relative-imports = "parents" [tool.coverage.run] source = ["haystack_integrations"] branch = true +relative_files = true parallel = false [tool.coverage.report] diff --git a/integrations/togetherai/pyproject.toml b/integrations/togetherai/pyproject.toml index ee510cc003..cc5e4a9d83 100644 --- a/integrations/togetherai/pyproject.toml +++ b/integrations/togetherai/pyproject.toml @@ -66,7 +66,8 @@ dependencies = [ unit = 'pytest -m "not integration" {args:tests}' integration = 'pytest -m "integration" {args:tests}' all = 'pytest {args:tests}' -cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x {args:tests}' +unit-cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x -m "not integration" {args:tests}' +integration-cov-append-retry = 'pytest --cov=haystack_integrations --cov-append --reruns 3 --reruns-delay 30 -x -m "integration" {args:tests}' types = """mypy -p haystack_integrations.components.generators.togetherai {args}""" @@ -152,6 +153,7 @@ ban-relative-imports = "parents" [tool.coverage.run] source = ["haystack_integrations"] branch = true +relative_files = true parallel = false [tool.coverage.report] diff --git a/integrations/unstructured/pyproject.toml b/integrations/unstructured/pyproject.toml index bafa0df13a..be59e37ef8 100644 --- a/integrations/unstructured/pyproject.toml +++ b/integrations/unstructured/pyproject.toml @@ -69,7 +69,8 @@ dependencies = [ unit = 'pytest -m "not integration" {args:tests}' integration = 'pytest -m "integration" {args:tests}' all = 'pytest {args:tests}' -cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x {args:tests}' +unit-cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x -m "not integration" {args:tests}' +integration-cov-append-retry = 'pytest --cov=haystack_integrations --cov-append --reruns 3 --reruns-delay 30 -x -m "integration" {args:tests}' types = "mypy -p haystack_integrations.components.converters.unstructured {args}" @@ -151,6 +152,7 @@ ban-relative-imports = "parents" [tool.coverage.run] source = ["haystack_integrations"] branch = true +relative_files = true parallel = true [tool.coverage.report] diff --git a/integrations/valkey/pyproject.toml b/integrations/valkey/pyproject.toml index 17ff58c3d4..dc065662ad 100644 --- a/integrations/valkey/pyproject.toml +++ b/integrations/valkey/pyproject.toml @@ -67,7 +67,8 @@ dependencies = [ unit = 'pytest -m "not integration" {args:tests}' integration = 'pytest -m "integration" {args:tests}' all = 'pytest {args:tests}' -cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x {args:tests}' +unit-cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x -m "not integration" {args:tests}' +integration-cov-append-retry = 'pytest --cov=haystack_integrations --cov-append --reruns 3 --reruns-delay 30 -x -m "integration" {args:tests}' types = "mypy -p haystack_integrations.components.retrievers.valkey -p haystack_integrations.document_stores.valkey {args}" @@ -159,6 +160,7 @@ ban-relative-imports = "parents" [tool.coverage.run] source = ["haystack_integrations"] branch = true +relative_files = true parallel = false diff --git a/integrations/watsonx/pyproject.toml b/integrations/watsonx/pyproject.toml index f6a7cb9238..275d0d95d1 100644 --- a/integrations/watsonx/pyproject.toml +++ b/integrations/watsonx/pyproject.toml @@ -66,7 +66,8 @@ dependencies = [ unit = 'pytest -m "not integration" {args:tests}' integration = 'pytest -m "integration" {args:tests}' all = 'pytest {args:tests}' -cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x {args:tests}' +unit-cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x -m "not integration" {args:tests}' +integration-cov-append-retry = 'pytest --cov=haystack_integrations --cov-append --reruns 3 --reruns-delay 30 -x -m "integration" {args:tests}' types = """mypy -p haystack_integrations.components.generators.watsonx \ -p haystack_integrations.components.embedders.watsonx {args}""" @@ -160,6 +161,7 @@ ban-relative-imports = "parents" [tool.coverage.run] source = ["haystack_integrations"] branch = true +relative_files = true parallel = true [tool.coverage.report] diff --git a/integrations/weave/pyproject.toml b/integrations/weave/pyproject.toml index bf96356829..d118357f5d 100644 --- a/integrations/weave/pyproject.toml +++ b/integrations/weave/pyproject.toml @@ -63,7 +63,8 @@ dependencies = [ unit = 'pytest -m "not integration" {args:tests}' integration = 'pytest -m "integration" {args:tests}' all = 'pytest {args:tests}' -cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x {args:tests}' +unit-cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x -m "not integration" {args:tests}' +integration-cov-append-retry = 'pytest --cov=haystack_integrations --cov-append --reruns 3 --reruns-delay 30 -x -m "integration" {args:tests}' types = """mypy -p haystack_integrations.components.connectors.weave \ -p haystack_integrations.tracing.weave {args}""" @@ -144,6 +145,7 @@ ban-relative-imports = "parents" [tool.coverage.run] source = ["haystack_integrations"] branch = true +relative_files = true parallel = false diff --git a/integrations/weaviate/pyproject.toml b/integrations/weaviate/pyproject.toml index fd3ded6751..248822deff 100644 --- a/integrations/weaviate/pyproject.toml +++ b/integrations/weaviate/pyproject.toml @@ -68,7 +68,8 @@ dependencies = [ unit = 'pytest -m "not integration" {args:tests}' integration = 'pytest -m "integration" {args:tests}' all = 'pytest {args:tests}' -cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x {args:tests}' +unit-cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x -m "not integration" {args:tests}' +integration-cov-append-retry = 'pytest --cov=haystack_integrations --cov-append --reruns 3 --reruns-delay 30 -x -m "integration" {args:tests}' types = """mypy -p haystack_integrations.document_stores.weaviate \ -p haystack_integrations.components.retrievers.weaviate {args}""" @@ -150,6 +151,7 @@ ban-relative-imports = "parents" [tool.coverage.run] source = ["haystack_integrations"] branch = true +relative_files = true parallel = false diff --git a/scripts/utils/templates/pyproject.toml b/scripts/utils/templates/pyproject.toml index e5e5320708..e887226617 100644 --- a/scripts/utils/templates/pyproject.toml +++ b/scripts/utils/templates/pyproject.toml @@ -64,7 +64,8 @@ dependencies = [ unit = 'pytest -m "not integration" {args:tests}' integration = 'pytest -m "integration" {args:tests}' all = 'pytest {args:tests}' -cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x {args:tests}' +unit-cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x -m "not integration" {args:tests}' +integration-cov-append-retry = 'pytest --cov=haystack_integrations --cov-append --reruns 3 --reruns-delay 30 -x -m "integration" {args:tests}' types = "mypy -p $mod {args}" [tool.mypy] @@ -144,6 +145,7 @@ ban-relative-imports = "parents" source = ["haystack_integrations"] branch = true parallel = false +relative_files = true [tool.coverage.report] omit = ["*/tests/*", "*/__init__.py"] diff --git a/scripts/utils/templates/workflow.yml b/scripts/utils/templates/workflow.yml index bfc0587c90..ac003c0d31 100644 --- a/scripts/utils/templates/workflow.yml +++ b/scripts/utils/templates/workflow.yml @@ -10,28 +10,55 @@ on: - "integrations/$name/**" - "!integrations/$name/*.md" - ".github/workflows/$name.yml" + push: + branches: + - main + paths: + - "integrations/$name/**" + - "!integrations/$name/*.md" + - ".github/workflows/$name.yml" defaults: run: working-directory: integrations/$name concurrency: - group: $name-${{ github.head_ref }} + group: $name-${{ github.head_ref || github.sha }} cancel-in-progress: true env: PYTHONUNBUFFERED: "1" FORCE_COLOR: "1" + TEST_MATRIX_OS: '["ubuntu-latest", "windows-latest", "macos-latest"]' + TEST_MATRIX_PYTHON: '["3.10", "3.14"]' jobs: + compute-test-matrix: + runs-on: ubuntu-slim + defaults: + run: + working-directory: . + outputs: + os: ${{ steps.set.outputs.os }} + python-version: ${{ steps.set.outputs.python-version }} + steps: + - id: set + run: | + echo 'os=${{ github.event_name == 'push' && '["ubuntu-latest"]' || env.TEST_MATRIX_OS }}' >> $GITHUB_OUTPUT + echo 'python-version=${{ github.event_name == 'push' && '["3.10"]' || env.TEST_MATRIX_PYTHON }}' >> $GITHUB_OUTPUT + run: name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} + needs: compute-test-matrix + permissions: + contents: write + pull-requests: write runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - python-version: ["3.10", "3.14"] + os: ${{ fromJSON(needs.compute-test-matrix.outputs.os) }} + python-version: ${{ fromJSON(needs.compute-test-matrix.outputs.python-version) }} steps: - name: Support longpaths @@ -52,21 +79,44 @@ jobs: if: matrix.python-version == '3.10' && runner.os == 'Linux' run: hatch run fmt-check && hatch run test:types - - name: Run tests - run: hatch run test:cov-retry + - name: Run unit tests + run: hatch run test:unit-cov-retry + + # On PR: generates coverage comment artifact. On push to main: stores coverage baseline on data branch. + - name: Store unit tests coverage + if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name != 'schedule' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/$name + SUBPROJECT_ID: $name + COMMENT_ARTIFACT_NAME: coverage-comment-$name + + - name: Run integration tests + run: hatch run test:integration-cov-append-retry + + - name: Store combined coverage + if: github.event_name == 'push' + uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_PATH: integrations/$name + SUBPROJECT_ID: $name-combined + COMMENT_ARTIFACT_NAME: coverage-comment-$name-combined - name: Run unit tests with lowest direct dependencies + if: github.event_name != 'push' run: | hatch run uv pip compile pyproject.toml --resolution lowest-direct --output-file requirements_lowest_direct.txt hatch -e test env run -- uv pip install -r requirements_lowest_direct.txt hatch run test:unit - - name: Nightly - run tests with Haystack main branch + - name: Nightly - run unit tests with Haystack main branch if: github.event_name == 'schedule' run: | hatch env prune hatch -e test env run -- uv pip install git+https://github.com/deepset-ai/haystack.git@main - hatch run test:cov-retry + hatch run test:unit notify-slack-on-failure: