-
Notifications
You must be signed in to change notification settings - Fork 2.5k
52 lines (44 loc) · 1.42 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
name: Unit tests
on:
push:
branches:
- master
- v*-release
pull_request:
branches:
- master
workflow_dispatch:
jobs:
test_sampling:
name: Run unit tests
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
os: [ubuntu-latest, windows-latest]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Python environment
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Try to load cached dependencies
uses: actions/cache@v3
id: restore-cache
with:
path: ${{ env.pythonLocation }}
key: python-dependencies-${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('setup.py') }}-${{ hashFiles('requirements.txt') }}-${{ env.pythonLocation }}
- name: Install external dependencies on cache miss
run: |
python -m pip install --no-cache-dir --upgrade pip
python -m pip install --no-cache-dir -r requirements.txt
python -m pip install --no-cache-dir pytest
if: steps.restore-cache.outputs.cache-hit != 'true'
- name: Install the checked-out sentence-transformers
run: python -m pip install .
- name: Run unit tests
shell: bash
run: |
pytest --durations 20 -sv tests/