forked from UKPLab/sentence-transformers
-
Notifications
You must be signed in to change notification settings - Fork 1
68 lines (60 loc) · 1.81 KB
/
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
name: Unit tests
on:
push:
branches:
- master
- v*-release
pull_request:
branches:
- master
- v*-release
workflow_dispatch:
jobs:
test_sampling:
name: Run unit tests
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
os: [ubuntu-latest, windows-latest]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Remove unnecessary files
run: |
df -h /
# Remove software and language runtimes we're not using
sudo rm -rf \
"$AGENT_TOOLSDIRECTORY" \
/opt/google/chrome \
/opt/microsoft/msedge \
/opt/microsoft/powershell \
/opt/pipx \
/usr/lib/mono \
/usr/local/julia* \
/usr/local/lib/android \
/usr/local/lib/node_modules \
/usr/local/share/chromium \
/usr/local/share/powershell \
/usr/share/dotnet \
/usr/share/swift
df -h /
if: runner.os == 'Linux'
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Python environment
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Try to load cached dependencies
uses: actions/cache@v4
id: restore-cache
with:
path: ${{ env.pythonLocation }}
key: python-dependencies-${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}-${{ env.pythonLocation }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install '.[train, onnx, openvino, dev]'
- name: Run unit tests
run: |
python -m pytest --durations 20 -sv tests/