1010 - " integrations/kreuzberg/**"
1111 - " !integrations/kreuzberg/*.md"
1212 - " .github/workflows/kreuzberg.yml"
13+ push :
14+ branches :
15+ - main
16+ paths :
17+ - " integrations/kreuzberg/**"
18+ - " !integrations/kreuzberg/*.md"
19+ - " .github/workflows/kreuzberg.yml"
1320
1421defaults :
1522 run :
1623 working-directory : integrations/kreuzberg
1724
1825concurrency :
19- group : kreuzberg-${{ github.head_ref }}
26+ group : kreuzberg-${{ github.head_ref || github.sha }}
2027 cancel-in-progress : true
2128
2229env :
2330 PYTHONUNBUFFERED : " 1"
2431 FORCE_COLOR : " 1"
32+ TEST_MATRIX_OS : ' ["ubuntu-latest", "windows-latest", "macos-latest"]'
33+ TEST_MATRIX_PYTHON : ' ["3.10", "3.14"]'
2534
2635jobs :
36+ compute-test-matrix :
37+ runs-on : ubuntu-slim
38+ defaults :
39+ run :
40+ working-directory : .
41+ outputs :
42+ os : ${{ steps.set.outputs.os }}
43+ python-version : ${{ steps.set.outputs.python-version }}
44+ steps :
45+ - id : set
46+ run : |
47+ echo "os=${{ github.event_name == 'push' && '["ubuntu-latest"]' || env.TEST_MATRIX_OS }}" >> $GITHUB_OUTPUT
48+ echo "python-version=${{ github.event_name == 'push' && '["3.10"]' || env.TEST_MATRIX_PYTHON }}" >> $GITHUB_OUTPUT
49+
2750 run :
2851 name : Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }}
52+ needs : compute-test-matrix
2953 runs-on : ${{ matrix.os }}
54+ permissions :
55+ contents : write
56+ pull-requests : write
3057 strategy :
3158 fail-fast : false
3259 matrix :
33- os : [ubuntu-latest, windows-latest, macos-latest]
34- python-version : ["3.10", "3.14"]
60+ os : ${{ fromJSON(needs.compute-test-matrix.outputs.os) }}
61+ python-version : ${{ fromJSON(needs.compute-test-matrix.outputs.python-version) }}
3562
3663 steps :
3764 - name : Support longpaths
@@ -50,13 +77,36 @@ jobs:
5077 run : pip install hatch
5178
5279 - name : Lint
53- if : matrix.python-version == '3.10' && runner.os == 'Linux'
80+ if : github.event_name != 'push' && matrix.python-version == '3.10' && runner.os == 'Linux'
5481 run : hatch run fmt-check && hatch run test:types
5582
56- - name : Run tests
57- run : hatch run test:cov-retry
83+ - name : Run unit tests
84+ run : hatch run test:unit-cov-retry
85+
86+ # On PR: generates coverage comment artifact. On push to main: stores coverage baseline on data branch.
87+ - name : Store unit tests coverage
88+ if : matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name != 'schedule'
89+ uses : py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40
90+ with :
91+ GITHUB_TOKEN : ${{ github.token }}
92+ COVERAGE_PATH : integrations/kreuzberg
93+ SUBPROJECT_ID : kreuzberg
94+ COMMENT_ARTIFACT_NAME : coverage-comment-kreuzberg
95+
96+ - name : Run integration tests
97+ run : hatch run test:integration-cov-append-retry
98+
99+ - name : Store combined coverage
100+ if : github.event_name == 'push'
101+ uses : py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40
102+ with :
103+ GITHUB_TOKEN : ${{ github.token }}
104+ COVERAGE_PATH : integrations/kreuzberg
105+ SUBPROJECT_ID : kreuzberg-combined
106+ COMMENT_ARTIFACT_NAME : coverage-comment-kreuzberg-combined
58107
59108 - name : Run unit tests with lowest direct dependencies
109+ if : github.event_name != 'push'
60110 run : |
61111 hatch run uv pip compile pyproject.toml --resolution lowest-direct --output-file requirements_lowest_direct.txt
62112 hatch -e test env run -- uv pip install -r requirements_lowest_direct.txt
69119 hatch -e test env run -- uv pip install git+https://github.com/deepset-ai/haystack.git@main
70120 hatch run test:unit
71121
72-
73122 notify-slack-on-failure :
74123 needs : run
75124 if : failure() && github.event_name == 'schedule'
0 commit comments