-
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (51 loc) · 1.74 KB
/
test.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
name: CI
on: [push, pull_request]
jobs:
tests:
strategy:
fail-fast: false
matrix:
python-version: [3.9, '3.10', '3.11', '3.12']
os: [ubuntu-latest, macos-13, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: abatilo/[email protected]
with:
poetry-version: 1.8.3
- name: Get Poetry cache directory
id: poetry-cache
run: |
echo "dir=$(poetry config cache-dir)" >> $GITHUB_OUTPUT
- name: Cache Poetry dependencies
uses: actions/cache@v4
with:
path: ${{ steps.poetry-cache.outputs.dir }}
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-
- name: Get model cache directory
id: model-cache-dir
shell: python
run: |
from platformdirs import PlatformDirs
import os
cache_dir = PlatformDirs(appname='iscc-sct', appauthor='iscc').user_data_dir
print(f"dir={cache_dir}")
with open(os.environ['GITHUB_OUTPUT'], 'a') as fh:
print(f"dir={cache_dir}", file=fh)
- name: Cache ONNX model
uses: actions/cache@v4
with:
path: ${{ steps.model-cache-dir.outputs.dir }}
key: ${{ runner.os }}-onnx-model-${{ hashFiles('**/utils.py') }}
restore-keys: |
${{ runner.os }}-onnx-model-
- name: Install Dependencies
run: poetry install
- name: Run Tests
run: poetry run pytest --cov=iscc_sci --cov-report=xml -v tests