-
Notifications
You must be signed in to change notification settings - Fork 127
73 lines (60 loc) · 1.83 KB
/
python-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Tests
on:
push:
branches: [ speedup-ci ] # master, main, gpu
# pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
test:
strategy:
matrix:
python-version:
- '3.9.x'
- '3.10.x'
- '3.11.x'
- '3.12.x'
- '3.13.x'
os:
- ubuntu-latest
# - macos-latest
- windows-latest
runs-on: ${{ matrix.os }}
name: Python ${{ matrix.python-version }} on ${{ matrix.os }} test
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install poetry
poetry config virtualenvs.create false
poetry install --no-interaction --no-ansi --without dev,docs
- name: Set Model Cache Directory
run: |
if [[ "$RUNNER_OS" == "Windows" ]]; then
echo "MODEL_CACHE_DIR=%TEMP%\\fastembed_cache" >> $GITHUB_ENV
else
echo "MODEL_CACHE_DIR=/tmp/fastembed_cache" >> $GITHUB_ENV
fi
shell: bash
- name: Cache Model Files
uses: actions/cache@v3
with:
path: ${{ env.MODEL_CACHE_DIR }}
key: ml-models-cache-${{ hashFiles('**/test_*.py') }}
restore-keys: |
ml-models-cache-
- name: Run pytest
run: |
poetry run pytest tests/test_image_onnx_embeddings.py
- name: List Cached Models (Windows)
if: runner.os == 'Windows'
run: dir C:\Users\runneradmin\AppData\Local\Temp\fastembed_cache
shell: cmd
- name: List Cached Models (Linux/macOS) - /tmp
if: runner.os != 'Windows'
run: ls -lah /tmp/fastembed_cache
shell: bash