From 4b5c6e77c24664b3df15350bc094083788bcfa58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Svensson?= Date: Tue, 25 Jun 2024 19:49:44 +0200 Subject: [PATCH] Correcting CI to match current CMake changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Björn Svensson --- .github/workflows/build.yml | 6 +++--- .github/workflows/ci.yml | 9 +++------ .github/workflows/db-compatibility.yml | 19 ++++++++++++------- tests/CMakeLists.txt | 6 ++++++ 4 files changed, 24 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f5679216..8ca0ffa0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,7 +21,7 @@ jobs: - name: Build using cmake env: - EXTRA_CMAKE_OPTS: -DENABLE_EXAMPLES:BOOL=ON -DENABLE_SSL:BOOL=ON -DENABLE_SSL_TESTS:BOOL=ON -DENABLE_ASYNC_TESTS:BOOL=ON + EXTRA_CMAKE_OPTS: -DENABLE_EXAMPLES:BOOL=ON -DENABLE_SSL:BOOL=ON CFLAGS: -Werror CXXFLAGS: -Werror run: mkdir build && cd build && cmake .. && make @@ -62,7 +62,7 @@ jobs: - name: Build using cmake env: - EXTRA_CMAKE_OPTS: -DENABLE_EXAMPLES:BOOL=ON -DENABLE_SSL:BOOL=ON -DENABLE_SSL_TESTS:BOOL=ON -DENABLE_ASYNC_TESTS:BOOL=ON + EXTRA_CMAKE_OPTS: -DENABLE_EXAMPLES:BOOL=ON -DENABLE_SSL:BOOL=ON CFLAGS: -Werror CXXFLAGS: -Werror run: mkdir build && cd build && cmake3 .. && make @@ -107,7 +107,7 @@ jobs: - name: Build using cmake env: - EXTRA_CMAKE_OPTS: -DENABLE_EXAMPLES:BOOL=ON -DENABLE_SSL:BOOL=ON -DENABLE_SSL_TESTS:BOOL=ON -DENABLE_ASYNC_TESTS:BOOL=ON + EXTRA_CMAKE_OPTS: -DENABLE_EXAMPLES:BOOL=ON -DENABLE_SSL:BOOL=ON CFLAGS: -Werror CXXFLAGS: -Werror run: mkdir build && cd build && cmake .. && make diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 429da711..173c88d1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,13 +48,10 @@ jobs: with: packages: libevent-dev libuv1-dev libev-dev libglib2.0-dev ${{ matrix.compiler }} version: 1.0 - - name: Install hiredis - env: - VERSION: 1.2.0 + - name: Install Valkey for non-cluster tests run: | - curl -L https://github.com/redis/hiredis/archive/v${VERSION}.tar.gz | tar -xz - cmake -S hiredis-${VERSION} -B hiredis-build -DENABLE_SSL=ON - sudo make -C hiredis-build install + git clone --depth 1 --branch 7.2.5 https://github.com/valkey-io/valkey.git + cd valkey && BUILD_TLS=yes make install - name: Setup cmake uses: jwlawson/actions-setup-cmake@802fa1a2c4e212495c05bf94dba2704a92a472be # v2.0.2 with: diff --git a/.github/workflows/db-compatibility.yml b/.github/workflows/db-compatibility.yml index b2c8d57b..d26f802e 100644 --- a/.github/workflows/db-compatibility.yml +++ b/.github/workflows/db-compatibility.yml @@ -13,13 +13,17 @@ jobs: fail-fast: false matrix: include: - - valkey-version: 7.2.5 + - valkey-version: '7.2.5' steps: - name: Prepare uses: awalsh128/cache-apt-pkgs-action@a6c3917cc929dd0345bfb2d3feaf9101823370ad # v1.4.2 with: packages: libevent-dev version: 1.0 + - name: Install Valkey for non-cluster tests + run: | + git clone --depth 1 --branch ${{ matrix.valkey-version }} https://github.com/valkey-io/valkey.git + cd valkey && BUILD_TLS=yes make install - uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5 - name: Create build folder run: cmake -E make_directory build @@ -55,18 +59,19 @@ jobs: fail-fast: false matrix: include: - - redis-version: 7.2.4 - - redis-version: 7.0.15 - - redis-version: 6.2.14 - - redis-version: 6.0.20 - - redis-version: 5.0.14 + - redis-version: '7.2.4' + - redis-version: '7.0.15' + - redis-version: '6.2.14' steps: - name: Prepare uses: awalsh128/cache-apt-pkgs-action@a6c3917cc929dd0345bfb2d3feaf9101823370ad # v1.4.2 with: packages: libevent-dev version: 1.0 - + - name: Install Redis for non-cluster tests + run: | + git clone --depth 1 --branch ${{ matrix.redis-version }} https://github.com/redis/redis.git + cd redis && BUILD_TLS=yes make install - uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5 - name: Create build folder diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 823ed1f7..62eb68be 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -69,6 +69,12 @@ if(LIBEVENT_LIBRARY) endif() target_link_libraries(client_test valkey ${SSL_LIBRARY} ${LIBEVENT_LIBRARY}) add_test(NAME client_test COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/test.sh") +if(TEST_WITH_REDIS_VERSION) + set_property(TEST client_test PROPERTY ENVIRONMENT "VALKEY_SERVER=redis-server") +endif() +if(SSL_LIBRARY) + set_property(TEST client_test PROPERTY ENVIRONMENT "TEST_SSL=1") +endif() # Add cluster tests