-
Notifications
You must be signed in to change notification settings - Fork 21
195 lines (193 loc) · 5.24 KB
/
main.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
182
183
184
185
186
187
188
189
190
191
192
193
194
name: Build and test
on:
push:
# file paths to consider in the event. Optional; defaults to all.
paths:
- 'cmake/**'
- 'examples/**'
- 'scripts/**'
- 'src/**'
- 'test/**'
- 'thirdparty/**'
- '.github/workflows/main.yaml'
- '!**.md'
- '.clang-format'
- '.clang-tidy'
pull_request:
# file paths to consider in the event. Optional; defaults to all.
paths:
- 'cmake/**'
- 'examples/**'
- 'scripts/**'
- 'src/**'
- 'test/**'
- 'thirdparty/**'
- '.github/workflows/main.yaml'
- '!**.md'
- '.clang-format'
- '.clang-tidy'
jobs:
linux:
name: Build and test AMD64 ${{ matrix.os.distro }} ${{ matrix.os.version }}
runs-on: ubuntu-latest
container: ${{ matrix.os.image }}
timeout-minutes: 75
strategy:
fail-fast: false
matrix:
os:
- distro: Ubuntu
version: 18.04
image: ubuntu:18.04
key: u1804
- distro: Ubuntu
version: 22.04
image: ubuntu:22.04
key: u2204
- distro: CentOS
version: 7
image: centos:7
key: c7
- distro: Fedora
version: 38
image: fedora:38
key: fc38
- distro: Fedora
version: 39
image: fedora:39
key: fc39
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_COMPILERCHECK: content
CCACHE_COMPRESS: 1
CCACHE_COMPRESSLEVEL: 5
CCACHE_MAXSIZE: 2G
steps:
- name: Env
run: echo "${HOME}/.local/bin" >> $GITHUB_PATH
- name: Checkout
uses: actions/checkout@v3
- name: Cache ccache
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/.ccache
key: linux-${{ matrix.os.key }}-ccache-${{ github.sha }}
restore-keys: linux-${{ matrix.os.key }}-ccache-
- name: Prepare
run: |
sh scripts/install_deps.sh
- name: Lint
if: ${{ matrix.os.distro == 'Ubuntu' }}
run: |
make lint
- name: Uint Testing
run: |
make test
st-ubuntu:
name: Test all with coverage
runs-on: ubuntu-${{ matrix.ubuntu }}
timeout-minutes: 75
strategy:
fail-fast: false
matrix:
ubuntu: [22.04]
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_COMPILERCHECK: content
CCACHE_COMPRESS: 1
CCACHE_COMPRESSLEVEL: 5
CCACHE_MAXSIZE: 2G
steps:
- name: Env
run: echo "${HOME}/.local/bin" >> $GITHUB_PATH
- name: Checkout
uses: actions/checkout@v3
- name: Cache ccache
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/.ccache
key: ubuntu-${{ matrix.ubuntu }}-ccache-${{ github.sha }}
restore-keys: ubuntu-${{ matrix.ubuntu }}-ccache-
- uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Prepare
run: |
sh scripts/install_deps.sh
- name: Testing With Coverage
run: |
make coverage
- name: Upload coverage
uses: codecov/codecov-action@v3
with:
files: ./code_coverage/lcov_output.info
name: ubuntu-${{ matrix.ubuntu }}-coverage
macos:
name: Build and test macOS ${{ matrix.macos }}
runs-on: macos-${{ matrix.macos }}
timeout-minutes: 75
strategy:
fail-fast: false
matrix:
macos: [11]
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_COMPILERCHECK: content
CCACHE_COMPRESS: 1
CCACHE_CPP2: true
CCACHE_COMPRESSLEVEL: 5
CCACHE_MAXSIZE: 2G
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cache ccache
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/.ccache
key: macos-${{ matrix.macos }}-ccache-${{ github.sha }}
restore-keys: macos-${{ matrix.macos }}-ccache-
- name: Prepare
run: |
sh scripts/install_deps.sh
- name: Uint Testing
run: |
make test
windows:
name: Build and test windows
runs-on: windows-2022
timeout-minutes: 75
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_COMPILERCHECK: content
CCACHE_COMPRESS: 1
CCACHE_COMPRESSLEVEL: 5
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cache ccache
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/.ccache
key: windows-ccache-${{ github.sha }}
restore-keys: windows-ccache-
- name: Install dependencies on windows
shell: cmd
run: |
choco install cmake ninja ccache
cmake --version
ninja --version
- name: Build
shell: cmd
run: |
call "%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
cmake -S . -B build -DMILVUS_BUILD_TEST=YES -G Ninja
cmake --build build
- name: Uint Testing
shell: cmd
run: |
build\test\testing-ut
build\test\testing-it