-
Notifications
You must be signed in to change notification settings - Fork 82
181 lines (178 loc) · 5.95 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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
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/**"
- "!cmake/libs/libcardinal.cmake"
- ".github/workflows/ut.yaml"
- "CMakeLists.txt"
- "!**.md"
- "tests/**"
jobs:
ut:
name: ut on ubuntu-22.04
runs-on: ubuntu-22.04
timeout-minutes: 90
strategy:
fail-fast: true
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: 'none'
- name: Install Dependency
run: |
sudo apt update \
&& sudo apt install -y cmake g++ gcc libopenblas-openmp-dev libcurl4-openssl-dev libaio-dev libevent-dev python3 python3-pip lcov \
&& pip3 install conan==1.61.0 \
&& conan remote add default-conan-local https://milvus01.jfrog.io/artifactory/api/conan/default-conan-local
- name: Download Conan Artifact
uses: actions/download-artifact@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
# this run-id is got from a successful "Upload Conan Artifact" workflow run on 2024/09/02,
# it will be valid till 2024/11/30
run-id: 10662401212
name: conan-asan
path: downloaded
continue-on-error: true
- name: Unpack Conan Data
run: |
if [ -f downloaded/conan.tar.gz ]; then
echo "download conan.tar.gz successfully"
cd downloaded \
&& tar xfz conan.tar.gz \
&& rm -rf conan.tar.gz /home/runner/.conan \
&& mv ./.conan /home/runner/.conan
else
echo "download conan.tar.gz fail"
fi
- name: Build
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 ..
# - name: Pack Conan Data
# run: |
# cd /home/runner && tar cfz conan.tar.gz .conan/
# - name: Upload Conan Artifact
# uses: actions/upload-artifact@v4
# with:
# name: conan-asan
# path: /home/runner/conan.tar.gz
- name: Run
run: |
./scripts/run_codecov.sh
- name: Archive result
uses: actions/upload-artifact@v4
with:
name: codecov-result
path: |
./lcov_output.info
*.info
*.out
codecov:
name: Upload Code Coverage
needs: [ut]
runs-on: ubuntu-22.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 == 'zilliztech/knowhere'"
uses: codecov/codecov-action@v4
id: upload_cov
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./lcov_output.info
name: ubuntu-22.04-unittests
fail_ci_if_error: true
- name: Retry Upload coverage to Codecov
if: "${{ failure() }} && github.repository == 'zilliztech/knowhere'"
uses: codecov/codecov-action@v4
id: retry_upload_cov
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./lcov_output.info
name: ubuntu-22.04-unittests
fail_ci_if_error: true
swig-build:
name: python3 wheel
runs-on: ubuntu-22.04
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: 'none'
- 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-openmp-dev libaio-dev libcurl4-openssl-dev libevent-dev libgflags-dev python3 python3-pip python3-setuptools \
&& pip3 install conan==1.61.0 pytest faiss-cpu numpy wheel \
&& pip3 install bfloat16 \
&& conan remote add default-conan-local https://milvus01.jfrog.io/artifactory/api/conan/default-conan-local
- name: Download Conan Artifact
uses: actions/download-artifact@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
# this run-id is got from a successful "Upload Conan Artifact" workflow run on 2024/09/02,
# it will be valid till 2024/11/30
run-id: 10662401212
name: conan-wheel
path: downloaded
continue-on-error: true
- name: Unpack Conan Data
run: |
if [ -f downloaded/conan.tar.gz ]; then
echo "download conan.tar.gz successfully"
cd downloaded \
&& tar xfz conan.tar.gz \
&& rm -rf conan.tar.gz /home/runner/.conan \
&& mv ./.conan /home/runner/.conan
else
echo "download conan.tar.gz fail"
fi
- 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: Pack Conan Data
# run: |
# cd /home/runner && tar cfz conan.tar.gz .conan/
# - name: Upload Conan Artifact
# uses: actions/upload-artifact@v4
# with:
# name: conan-wheel
# path: /home/runner/conan.tar.gz
- 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