Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -247,12 +247,28 @@ jobs:
- name: Run tests
working-directory: build
run: .\tests\client_test.exe
- name: Install Cygwin Action

windows-cygwin:
name: Windows (Cygwin)
runs-on: windows-latest
steps:
- name: Prepare
run: |
git config --global core.autocrlf input
choco install -y memurai-developer
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Install Cygwin
uses: cygwin/cygwin-install-action@f61179d72284ceddc397ed07ddb444d82bf9e559 # v5
with:
packages: make gcc-core
- name: Build in Cygwin
run: make clean && make
packages: make gcc-core cmake libssl-devel
- name: Build with CMake using Cygwin
run: |
mkdir build && cd build
cmake -DENABLE_TLS=ON -DENABLE_EXAMPLES=ON ..
make install
- name: Run tests
working-directory: build
run: .\tests\client_test.exe

windows-mingw64:
name: Windows (MinGW64)
Expand Down
8 changes: 5 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ set_target_properties(valkey PROPERTIES EXPORT_NAME ${valkey_export_name})

SET_TARGET_PROPERTIES(valkey
PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE
SOVERSION "${LIBVALKEY_SONAME}"
VERSION "${LIBVALKEY_SONAME}")
IF(MSVC)
SET_TARGET_PROPERTIES(valkey
Expand Down Expand Up @@ -193,15 +194,16 @@ IF(ENABLE_TLS)
SET_TARGET_PROPERTIES(valkey_tls
PROPERTIES
WINDOWS_EXPORT_ALL_SYMBOLS TRUE
SOVERSION "${LIBVALKEY_SONAME}"
VERSION "${LIBVALKEY_SONAME}")
IF(MSVC)
SET_TARGET_PROPERTIES(valkey_tls
PROPERTIES COMPILE_FLAGS /Z7)
ENDIF()
TARGET_LINK_LIBRARIES(valkey_tls PRIVATE OpenSSL::SSL)
IF(WIN32)
TARGET_LINK_LIBRARIES(valkey_tls PRIVATE valkey)
ENDIF()
if(WIN32 OR CYGWIN)
target_link_libraries(valkey_tls PRIVATE valkey)
endif()
CONFIGURE_FILE(valkey_tls.pc.in valkey_tls.pc @ONLY)

INSTALL(TARGETS valkey_tls
Expand Down
6 changes: 6 additions & 0 deletions tests/client_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -1069,8 +1069,14 @@ static void test_blocking_connection_errors(void) {
opt.command_timeout = opt.connect_timeout = &tv;
VALKEY_OPTIONS_SET_TCP(&opt, "localhost", 10337);
c = valkeyConnectWithOptions(&opt);
#ifdef __CYGWIN__
/* Cygwin's socket layer will poll until timeout. */
test_cond(c->err == VALKEY_ERR_IO &&
strcmp(c->errstr, "Connection timed out") == 0);
#else
test_cond(c->err == VALKEY_ERR_IO &&
strcmp(c->errstr, "Connection refused") == 0);
#endif
valkeyFree(c);

test("Returns error when the unix_sock socket path doesn't accept connections: ");
Expand Down