Skip to content

Commit 0f5756b

Browse files
authored
ci: refactor some workflows (#3074)
1 parent 111cf58 commit 0f5756b

File tree

5 files changed

+18
-22
lines changed

5 files changed

+18
-22
lines changed

.github/workflows/langfuse.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,6 @@ jobs:
8181
- name: Install Hatch
8282
run: pip install hatch
8383

84-
# TODO: Once this integration is properly typed, use hatch run test:types
85-
# https://github.com/deepset-ai/haystack-core-integrations/issues/1771
8684
- name: Lint
8785
if: matrix.python-version == '3.10' && runner.os == 'Linux'
8886
run: hatch run fmt-check && hatch run test:types

.github/workflows/pinecone.yml

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ env:
3030
PYTHONUNBUFFERED: "1"
3131
FORCE_COLOR: "1"
3232
PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }}
33-
TEST_MATRIX_OS: '["ubuntu-latest"]'
34-
TEST_MATRIX_PYTHON: '["3.10", "3.14"]'
3533

3634
jobs:
3735
compute-test-matrix:
@@ -40,13 +38,20 @@ jobs:
4038
run:
4139
working-directory: .
4240
outputs:
43-
os: ${{ steps.set.outputs.os }}
44-
python-version: ${{ steps.set.outputs.python-version }}
41+
matrix: ${{ steps.set.outputs.matrix }}
4542
steps:
4643
- id: set
4744
run: |
48-
echo 'os=${{ github.event_name == 'push' && '["ubuntu-latest"]' || env.TEST_MATRIX_OS }}' >> "$GITHUB_OUTPUT"
49-
echo 'python-version=${{ github.event_name == 'push' && '["3.10"]' || env.TEST_MATRIX_PYTHON }}' >> "$GITHUB_OUTPUT"
45+
if [ "${{ github.event_name }}" = "push" ]; then
46+
echo 'matrix=[{"os":"ubuntu-latest","python-version":"3.10","INDEX_NAME":"index-310"}]' >> "$GITHUB_OUTPUT"
47+
else
48+
MATRIX='['
49+
# Pinecone tests are time expensive, so only test on Ubuntu
50+
MATRIX+='{"os":"ubuntu-latest","python-version":"3.10","INDEX_NAME":"index-310"},'
51+
MATRIX+='{"os":"ubuntu-latest","python-version":"3.14","INDEX_NAME":"index-313"}'
52+
MATRIX+=']'
53+
echo "matrix=$MATRIX" >> "$GITHUB_OUTPUT"
54+
fi
5055
5156
run:
5257
name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }}
@@ -58,14 +63,7 @@ jobs:
5863
strategy:
5964
fail-fast: false
6065
matrix:
61-
# Pinecone tests are time expensive, so only test on Ubuntu
62-
os: ${{ fromJSON(needs.compute-test-matrix.outputs.os) }}
63-
python-version: ${{ fromJSON(needs.compute-test-matrix.outputs.python-version) }}
64-
include:
65-
- python-version: "3.10"
66-
INDEX_NAME: "index-310"
67-
- python-version: "3.14"
68-
INDEX_NAME: "index-313"
66+
include: ${{ fromJSON(needs.compute-test-matrix.outputs.matrix) }}
6967

7068
steps:
7169
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
@@ -78,8 +76,6 @@ jobs:
7876
- name: Install Hatch
7977
run: pip install hatch
8078

81-
# TODO: Once this integration is properly typed, use hatch run test:types
82-
# https://github.com/deepset-ai/haystack-core-integrations/issues/1771
8379
- name: Lint
8480
if: matrix.python-version == '3.10' && runner.os == 'Linux'
8581
run: hatch run fmt-check && hatch run test:types

integrations/llama_cpp/tests/models/.gitignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

integrations/llama_cpp/tests/test_chat_generator.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@
3434

3535
@pytest.fixture
3636
def model_path():
37-
return Path(__file__).parent / "models"
37+
path = Path.home() / ".cache" / "haystack_llama_cpp_tests"
38+
path.mkdir(parents=True, exist_ok=True)
39+
return path
3840

3941

4042
def get_current_temperature(location: Annotated[str, "The city and state, e.g. San Francisco, CA"]):

integrations/llama_cpp/tests/test_generator.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919

2020
@pytest.fixture
2121
def model_path():
22-
return Path(__file__).parent / "models"
22+
path = Path.home() / ".cache" / "haystack_llama_cpp_tests"
23+
path.mkdir(parents=True, exist_ok=True)
24+
return path
2325

2426

2527
def download_file(file_link, filename, capsys):

0 commit comments

Comments
 (0)