1
1
name : Tests
2
2
3
3
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
+
7
8
8
9
env :
9
10
CARGO_TERM_COLOR : always
@@ -14,15 +15,15 @@ jobs:
14
15
strategy :
15
16
matrix :
16
17
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'
21
22
- ' 3.13.x'
22
23
os :
23
- # - ubuntu-latest
24
+ - ubuntu-latest
24
25
- macos-latest
25
- # - windows-latest
26
+ - windows-latest
26
27
27
28
runs-on : ${{ matrix.os }}
28
29
@@ -34,48 +35,12 @@ jobs:
34
35
uses : actions/setup-python@v5
35
36
with :
36
37
python-version : ${{ matrix.python-version }}
37
-
38
38
- name : Install dependencies
39
39
run : |
40
40
python -m pip install poetry
41
41
poetry config virtualenvs.create false
42
42
poetry install --no-interaction --no-ansi --without dev,docs
43
43
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
-
66
44
- name : Run pytest
67
45
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