-
Notifications
You must be signed in to change notification settings - Fork 64
247 lines (241 loc) · 7.99 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
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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
name: build
on: push
jobs:
build-windows-latest:
runs-on: windows-latest
strategy:
matrix:
compiler: ["Visual Studio 17 2022"]
fail-fast: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build Reindexer
run: |
mkdir build && cd build
cmake -G "${{matrix.compiler}}" .. -Ax64
cmake --build . --config Release
cmake --build . --config Release --target face
cmake --build . --config Release --target swagger
cpack
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: windows-latest
path: build/*.exe
if-no-files-found: error
build-windows-2019:
runs-on: windows-2019
strategy:
matrix:
compiler: ["Visual Studio 16 2019", "MinGW Makefiles"]
fail-fast: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build Reindexer
run: |
mkdir build && cd build
cmake -G "${{matrix.compiler}}" ..
cmake --build . --config Release
cmake --build . --config Release --target face
cmake --build . --config Release --target swagger
cpack
build:
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04, macos-13]
include:
- os: ubuntu-latest
sanitizer: ASAN
cc: gcc-10
cxx: g++-10
- os: ubuntu-latest
sanitizer: TSAN
cc: gcc-12
cxx: g++-12
fail-fast: false
runs-on: ${{matrix.os}}
env:
OS: ${{matrix.os}}
CC: ${{matrix.cc}}
CXX: ${{matrix.cxx}}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Prepare Environment
run: |
./.github/workflows/install_gtest.sh
./.github/workflows/install_gtest_parallel.sh
if [[ $OS == ubuntu* ]]; then
sudo ./dependencies.sh
./.github/workflows/install_grpc.sh
./.github/workflows/install_gbench.sh
else
./dependencies.sh
fi
- name: Build Reindexer
run: |
export CPLUS_INCLUDE_PATH=$GITHUB_WORKSPACE/grpc/third_party/abseil-cpp
mkdir build && cd build
if [[ $OS == ubuntu-latest ]]; then
cmake -DENABLE_GRPC=ON -DWITH_${{matrix.sanitizer}}=On ..
elif [[ $OS == macos* ]]; then
cmake -DGH_CI_OSX=ON ..
else
cmake -DENABLE_GRPC=ON ..
fi
make -j4
STRIP=/bin/true cpack
- name: 'C++ tests'
if: ${{ matrix.os == 'macos-13' }}
run: |
echo "Running C++ directly in this job due to Action's problem with artifacts transition for macos-11 and macos-12 runners"
cd build
ctest --verbose -R gtests
- name: 'Tar Artifacts'
run: |
find ./build/ -name CMakeFiles | xargs -n1 rm -rf
rm -rf ./build/_CPack_Packages ./build/cpp_src/server/reindexer_server_resources
tar -cvf artifacts.tar build/ bindings/builtin/builtin_posix.go bindings/builtinserver/builtinserver_posix.go dependencies.sh
- name: Archive Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{matrix.os}}${{matrix.sanitizer}}
path: artifacts.tar
if-no-files-found: error
test:
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04, macos-13]
test: ['C++', 'GO']
include:
- os: ubuntu-latest
sanitizer: ASAN
cc: gcc-10
cxx: g++-10
test: 'C++'
- os: ubuntu-latest
sanitizer: ASAN
test: 'GO'
# - os: ubuntu-latest
# sanitizer: TSAN
# cc: gcc-12
# cxx: g++-12
# test: 'C++'
- os: ubuntu-latest
sanitizer: TSAN
test: 'GO'
fail-fast: false
runs-on: ${{matrix.os}}
needs: build
if: always()
env:
CC: ${{matrix.cc}}
CXX: ${{matrix.cxx}}
TEST: ${{matrix.test}}
SANITIZER: ${{matrix.sanitizer}}
steps:
- name: Checkout repository
if: ${{ matrix.os != 'macos-13' || matrix.test == 'GO' }}
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
if: ${{ matrix.os == 'macos-13' && matrix.test == 'GO' }}
with:
go-version: '1.22.x'
check-latest: true
- name: Download ${{matrix.os}}${{matrix.sanitizer}} Artifacts
if: ${{ matrix.os != 'macos-13' || matrix.test == 'GO' }}
uses: actions/download-artifact@v4
with:
name: ${{matrix.os}}${{matrix.sanitizer}}
- name: 'Untar Artifacts'
if: ${{ matrix.os != 'macos-13' || matrix.test == 'GO' }}
run: tar -xvf artifacts.tar
- name: Prepare Environment
if: ${{ matrix.os != 'macos-13' || matrix.test == 'GO' }}
env:
OS: ${{matrix.os}}
run: |
if [[ $OS == ubuntu* ]]; then
sudo ./dependencies.sh
else
./dependencies.sh
fi
if [[ $TEST == 'GO' ]]; then
go mod download
elif [[ $OS == ubuntu* ]]; then
./.github/workflows/install_gtest_parallel.sh
fi
- name: Tests
if: ${{ matrix.os != 'macos-13' || matrix.test == 'GO' }}
run: |
if [[ $TEST == 'GO' ]]; then
if [[ $SANITIZER == 'ASAN' ]]; then
export REINDEXER_GH_CI_ASAN=true
fi
if [[ -z "$SANITIZER" ]]; then
go test -timeout 15m ./test/... -bench . -benchmem -benchtime 100ms -seedcount 50000
else
go test -timeout 35m ./test/... -bench . -benchmem -benchtime 100ms -seedcount 50000
fi
else
cd build
ctest --verbose
fi
test-pyreindexer:
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
fail-fast: false
runs-on: ${{matrix.os}}
needs: build
if: always()
env:
OS: ${{matrix.os}}
steps:
- name: Download ${{matrix.os}} Artifacts
uses: actions/download-artifact@v4
with:
name: ${{matrix.os}}
- name: 'Untar Artifacts'
run: tar -xvf artifacts.tar
- name: Prepare Environment
run: |
if [[ $OS == ubuntu* ]]; then
sudo ./dependencies.sh
python3 -m pip install setuptools
else
./dependencies.sh
fi
- name: Install Reindexer
run: |
cd build
if [[ $OS == ubuntu* ]]; then
sudo dpkg -i reindexer-4-dev*.deb
sudo apt-get install -f
sudo dpkg -i reindexer-4-server*.deb
sudo apt-get install -f
else
for f in reindexer-*.tar.gz; do tar -xvzf "$f"; done
cp -R ./usr/local/include/reindexer /usr/local/include/reindexer
cp -R ./usr/local/lib/reindexer /usr/local/lib/reindexer
cp ./usr/local/lib/libreindexer.a /usr/local/lib/libreindexer.a
cp ./usr/local/lib/libreindexer_server_library.a /usr/local/lib/libreindexer_server_library.a
cp ./usr/local/lib/libreindexer_server_resources.a /usr/local/lib/libreindexer_server_resources.a
cp ./usr/local/lib/pkgconfig/libreindexer.pc /usr/local/lib/pkgconfig/libreindexer.pc
cp ./usr/local/lib/pkgconfig/libreindexer_server.pc /usr/local/lib/pkgconfig/libreindexer_server.pc
cp ./usr/local/bin/reindexer_server /usr/local/bin/reindexer_server
cp ./usr/local/etc/reindexer.conf.pkg /usr/local/etc/reindexer.conf.pkg
fi
- name: Clone PyReindexer
uses: actions/checkout@v4
with:
repository: restream/reindexer-py
- name: Install PyReindexer
run: sudo python3 setup.py install
- name: Test PyReindexer
run: |
cd pyreindexer
../.github/workflows/test.sh