3535 - name : make
3636 # Fail build if there are warnings
3737 # build with TLS just for compilation coverage
38- run : make -j4 all-with-unit-tests SERVER_CFLAGS='-Werror' BUILD_TLS=yes USE_FAST_FLOAT=yes USE_LIBBACKTRACE=yes
38+ run : |
39+ sudo apt-get install pkg-config libgtest-dev libgmock-dev
40+ make -j4 all-with-unit-tests SERVER_CFLAGS='-Werror' BUILD_TLS=yes USE_FAST_FLOAT=yes USE_LIBBACKTRACE=yes
3941 - name : test
4042 run : |
4143 sudo apt-get install tcl8.6 tclx
5052 if [[ ! -z "$dirty" ]]; then echo "$dirty"; exit 1; fi
5153 - name : unit tests
5254 run : |
53- ./src/valkey-unit-tests
55+ ./src/unit/ valkey-unit-gtests
5456
5557 test-ubuntu-latest-compatibility :
5658 runs-on : ubuntu-latest
6264 - {version: "8.0.6", file: "valkey-8.0.6-noble-x86_64.tar.gz"}
6365 - {version: "8.1.4", file: "valkey-8.1.4-noble-x86_64.tar.gz"}
6466 steps :
67+ - name : Install gtest
68+ run : |
69+ sudo apt-get install pkg-config libgtest-dev libgmock-dev
6570 - name : Install libbacktrace
6671 uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
6772 with :
@@ -103,7 +108,7 @@ jobs:
103108 sudo apt-get install -y cmake libssl-dev
104109 mkdir -p build-release
105110 cd build-release
106- cmake -DCMAKE_BUILD_TYPE=Release .. -DBUILD_TLS=yes -DBUILD_UNIT_TESTS =yes
111+ cmake -DCMAKE_BUILD_TYPE=Release .. -DBUILD_TLS=yes -DBUILD_UNIT_GTESTS =yes
107112 make -j$(nproc)
108113 - name : test
109114 run : |
@@ -112,7 +117,7 @@ jobs:
112117 ./build-release/runtest --verbose --tags -slow --dump-logs --tls
113118 - name : unit tests
114119 run : |
115- ./build-release/bin/valkey-unit-tests
120+ ./build-release/bin/valkey-unit-gtests
116121
117122 test-sanitizer-address :
118123 runs-on : ubuntu-latest
@@ -128,15 +133,18 @@ jobs:
128133 uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
129134 - name : make
130135 # build with TLS module just for compilation coverage
131- run : make -j4 all-with-unit-tests SANITIZER=address SERVER_CFLAGS='-Werror' BUILD_TLS=module USE_LIBBACKTRACE=yes
136+ run : |
137+ sudo apt-get install pkg-config libgtest-dev libgmock-dev
138+ make -j4 all-with-unit-tests SANITIZER=address SERVER_CFLAGS='-Werror' BUILD_TLS=module USE_LIBBACKTRACE=yes
132139 - name : testprep
133140 run : sudo apt-get install tcl8.6 tclx -y
134141 - name : test
135142 run : ./runtest --verbose --tags -slow --dump-logs
136143 - name : module api test
137144 run : CFLAGS='-Werror' ./runtest-moduleapi --verbose --dump-logs
138145 - name : unit tests
139- run : ./src/valkey-unit-tests
146+ run : |
147+ ./src/unit/valkey-unit-gtests
140148
141149 test-rdma :
142150 runs-on : ubuntu-latest
@@ -220,9 +228,15 @@ jobs:
220228 - run : cd libbacktrace && ./configure && make && sudo make install
221229 - name : Checkout Valkey
222230 uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
231+ - name : Install build dependencies
232+ run : brew install llvm googletest
223233 - name : make
224234 # Build with additional upcoming features
225- run : make -j3 all-with-unit-tests SERVER_CFLAGS='-Werror' USE_FAST_FLOAT=yes USE_LIBBACKTRACE=yes
235+ run : |
236+ export PATH="/opt/homebrew/opt/llvm/bin:$PATH"
237+ export CC=/opt/homebrew/opt/llvm/bin/clang
238+ export CXX=/opt/homebrew/opt/llvm/bin/clang++
239+ make -j3 all-with-unit-tests SERVER_CFLAGS='-Werror' USE_FAST_FLOAT=yes USE_LIBBACKTRACE=yes LIBBACKTRACE_PREFIX=/usr/local
226240
227241 build-32bit :
228242 runs-on : ubuntu-latest
@@ -240,16 +254,34 @@ jobs:
240254 cd libbacktrace && ./configure CFLAGS="-m32" --prefix=/usr/local/libbacktrace32 && make && sudo make install
241255 - name : Checkout Valkey
242256 uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
257+ - name : Install gtest
258+ run : |
259+ sudo apt-get update
260+ sudo apt-get install libgtest-dev
261+ mkdir -p /tmp/gtest32
262+ cd /tmp/gtest32
263+ cmake -B build32 \
264+ -DCMAKE_BUILD_TYPE=Release \
265+ -DCMAKE_C_FLAGS="-m32" \
266+ -DCMAKE_CXX_FLAGS="-m32" \
267+ -DCMAKE_EXE_LINKER_FLAGS="-m32" \
268+ /usr/src/googletest
269+ cmake --build build32 --parallel
270+ sudo cp build32/lib/*.a /usr/lib32/
271+ cd $GITHUB_WORKSPACE
243272 - name : make
244273 # Fast float requires C++ 32-bit libraries to compile on 64-bit ubuntu
245274 # machine i.e. "-cross" suffixed version. Cross-compiling c++ to 32-bit
246275 # also requires multilib support for g++ compiler i.e. "-multilib"
247276 # suffixed version of g++. g++-multilib generally includes libstdc++.
248277 # *cross version as well, but it is also added explicitly just in case.
249- run : make -j4 SERVER_CFLAGS='-Werror' 32bit USE_FAST_FLOAT=yes USE_LIBBACKTRACE=yes LIBBACKTRACE_PREFIX=/usr/local/libbacktrace32
278+ run : |
279+ make -j4 SERVER_CFLAGS='-Werror' 32bit USE_FAST_FLOAT=yes USE_LIBBACKTRACE=yes LIBBACKTRACE_PREFIX=/usr/local/libbacktrace32 \
280+ GTEST_CFLAGS="-I/usr/src/googletest/googletest/include -I/usr/src/googletest/googlemock/include" \
281+ GTEST_LIBS="/usr/lib32/libgtest.a /usr/lib32/libgmock.a"
250282 - name : unit tests
251283 run : |
252- ./src/valkey-unit-tests
284+ ./src/unit/ valkey-unit-gtests
253285
254286 build-libc-malloc :
255287 runs-on : ubuntu-latest
@@ -278,7 +310,7 @@ jobs:
278310 path : libbacktrace
279311 - name : Build libbacktrace
280312 run : |
281- dnf -y install epel-release gcc gcc-c++ make procps-ng which
313+ dnf -y install epel-release gcc gcc-c++ make procps-ng which git cmake
282314 cd libbacktrace && ./configure && make && make install
283315 - name : Checkout Valkey
284316 uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
0 commit comments