-
Notifications
You must be signed in to change notification settings - Fork 69
81 lines (71 loc) · 2.26 KB
/
ci_serving.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
74
75
76
77
78
79
80
81
name: CI-Serving
on:
push:
branches:
- master
pull_request:
branches:
- master
# Manual run
workflow_dispatch:
jobs:
testing:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04]
python-version: [3.9, '3.10', '3.11']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install dependencies
run: |
python -m pip install -U pip wheel setuptools
python -m pip install numpy>=1.19.5
python -m pip install "scipy>=1.2.1,<1.13.0"
python -m pip install pandas>=1.0.0
python -m pip install scikit-learn>=0.20.0
python -m pip install "tensorflow>=1.15.0,<2.16.0"
python -m pip install torch>=1.10.0
python -m pip install gensim>=4.0.0
python -m pip install tqdm
python -m pip install recfarm
python -m pip install -r requirements-serving.txt
python -m pip install -e .
- name: Set up Redis
uses: shogo82148/actions-setup-redis@v1
with:
redis-version: '7.x'
- name: Test Redis
run: redis-cli ping
- name: Test
run: |
python -m pip install pytest
python -m pytest tests/serving
if: matrix.python-version != '3.10'
- name: Test with coverage
run: |
python -m pip install pytest coverage
bash tests/serving/setup_coverage.sh
coverage --version && coverage erase
coverage run -m pytest tests/serving
coverage combine && coverage report
coverage xml
if: matrix.python-version == '3.10'
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
flags: CI
name: python${{ matrix.python-version }}-serving
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
verbose: true
if: matrix.python-version == '3.10'