This repository has been archived by the owner on Aug 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 84
120 lines (117 loc) · 3.79 KB
/
ut.yaml
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
name: Unit Test
# This workflow is triggered on pushes or pull request to the repository.
on:
push:
branches:
- main
pull_request:
# File paths to consider in the event. Optional; defaults to all.
paths:
- "include/**"
- "python/**"
- "src/**"
- "thirdparty/**"
- "benchmark/**"
- "cmake/**"
- ".github/workflows/ut.yaml"
- "CMakeLists.txt"
- "!**.md"
- "tests/**"
jobs:
ut:
name: ut on ubuntu-20.04
runs-on: ubuntu-20.04
timeout-minutes: 60
strategy:
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive
- name: Install Dependency
run: |
sudo apt update \
&& sudo apt install -y cmake g++ gcc libopenblas-dev libcurl4-openssl-dev libaio-dev libevent-dev python3 python3-pip lcov \
&& pip3 install conan==1.58.0 \
&& conan remote add default-conan-local https://milvus01.jfrog.io/artifactory/api/conan/default-conan-local
- name: Build & Run
run: |
mkdir build && cd build \
&& conan install .. --build=missing -s build_type=Release -o with_ut=True -o with_diskann=True -o with_asan=True -o with_coverage=True \
&& conan build .. \
&& cd .. \
&& ./scripts/run_codecov.sh
- name: Archive result
uses: actions/upload-artifact@v3
with:
name: codecov-result
path: |
./lcov_output.info
*.info
*.out
codecov:
name: Upload Code Coverage
needs: [ut]
runs-on: ubuntu-20.04
timeout-minutes: 5
steps:
- name: Download code coverage results
uses: actions/[email protected]
with:
name: codecov-result
- name: Display structure of code coverage results
run: |
ls -lah
- name: Upload coverage to Codecov
if: "github.repository == 'milvus-io/knowhere'"
uses: codecov/[email protected]
id: upload_cov
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./lcov_output.info
name: ubuntu-20.04-unittests
fail_ci_if_error: true
- name: Retry Upload coverage to Codecov
if: "${{ failure() }} && github.repository == 'milvus-io/knowhere'"
uses: codecov/[email protected]
id: retry_upload_cov
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./lcov_output.info
name: ubuntu-${{ matrix.ubuntu }}-unittests
fail_ci_if_error: true
swig-build:
name: python3 wheel
runs-on: ubuntu-20.04
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: "3.8"
- name: Install Dependency
run: |
sudo apt update \
&& sudo apt install -y cmake g++ gcc libopenblas-dev libaio-dev libcurl4-openssl-dev libevent-dev libgflags-dev python3 python3-pip python3-setuptools \
&& pip3 install conan==1.58.0 pytest faiss-cpu numpy wheel \
&& conan remote add default-conan-local https://milvus01.jfrog.io/artifactory/api/conan/default-conan-local
- name: Build
run: |
mkdir build \
&& cd build \
&& conan install .. --build=missing -o with_diskann=True -s compiler.libcxx=libstdc++11 -s build_type=Release \
&& conan build ..
- name: Swig Build
run: |
cd python && python3 setup.py bdist_wheel
- name: Install pips
run: |
cd python && pip3 install dist/*.whl
- name: Test
run: |
pytest tests/python/test_index_with_random.py