Skip to content

Commit 0fcf2ef

Browse files
new: Added on workflow dispatch
1 parent 678928e commit 0fcf2ef

File tree

1 file changed

+11
-46
lines changed

1 file changed

+11
-46
lines changed

.github/workflows/python-tests.yml

+11-46
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
name: Tests
22

33
on:
4-
push:
5-
branches: [ speedup-ci ] # master, main, gpu
6-
# pull_request:
4+
pull_request:
5+
branches: [ master, main, gpu ]
6+
workflow_dispatch:
7+
78

89
env:
910
CARGO_TERM_COLOR: always
@@ -14,15 +15,15 @@ jobs:
1415
strategy:
1516
matrix:
1617
python-version:
17-
# - '3.9.x'
18-
# - '3.10.x'
19-
# - '3.11.x'
20-
# - '3.12.x'
18+
- '3.9.x'
19+
- '3.10.x'
20+
- '3.11.x'
21+
- '3.12.x'
2122
- '3.13.x'
2223
os:
23-
# - ubuntu-latest
24+
- ubuntu-latest
2425
- macos-latest
25-
# - windows-latest
26+
- windows-latest
2627

2728
runs-on: ${{ matrix.os }}
2829

@@ -34,48 +35,12 @@ jobs:
3435
uses: actions/setup-python@v5
3536
with:
3637
python-version: ${{ matrix.python-version }}
37-
3838
- name: Install dependencies
3939
run: |
4040
python -m pip install poetry
4141
poetry config virtualenvs.create false
4242
poetry install --no-interaction --no-ansi --without dev,docs
4343
44-
- name: Compute Model Cache Key
45-
id: model_cache_key
46-
run: echo "MODEL_HASH=$(python tests/get_all_model_hash.py)" >> $GITHUB_ENV
47-
48-
- name: Set Model Cache Directory
49-
run: |
50-
if [[ "$RUNNER_OS" == "Windows" ]]; then
51-
echo "MODEL_CACHE_DIR=$TEMP/fastembed_cache" >> $GITHUB_ENV
52-
else
53-
echo "MODEL_CACHE_DIR=/tmp/fastembed_cache" >> $GITHUB_ENV
54-
fi
55-
shell: bash
56-
57-
- name: Cache Model Files
58-
uses: actions/cache@v4
59-
with:
60-
path: "${{ env.MODEL_CACHE_DIR }}"
61-
key: ml-models-cache-${{ env.MODEL_HASH }}"
62-
restore-keys: |
63-
ml-models-cache-
64-
enableCrossOsArchive: true
65-
6644
- name: Run pytest
6745
run: |
68-
poetry run pytest tests/test_sparse_embeddings.py
69-
70-
- name: List Cached Models (Linux)
71-
if: runner.os == 'Linux'
72-
run: ls -lah /tmp/fastembed_cache
73-
shell: bash
74-
- name: List Cached Models (Windows)
75-
if: runner.os == 'Windows'
76-
run: ls -la "$TEMP/fastembed_cache"
77-
shell: bash
78-
- name: List Cached Models (MacOS) tmp
79-
if: runner.os == 'MacOS'
80-
run: ls -lah /tmp/fastembed_cache
81-
shell: bash
46+
poetry run pytest

0 commit comments

Comments
 (0)