Feature/ci windows (#163)
* win only * disable ixcrypto mbedtls search on windows * ws cmakefile do not search for openssl * ci builds files on top of cmaking * ci builds files on top of cmaking / syntax tweak * use gha-setup-vsdevenv syntax * build fix and hacks * try to run unittest on win * try to run unittest on win (syntax error) * unittest wip * wip * wip again * wip again (working-directory) * cleanup * dumb compile error
This commit is contained in:
parent
44f599747e
commit
0bb5462504
45
.github/workflows/ccpp.yml
vendored
45
.github/workflows/ccpp.yml
vendored
@ -1,12 +1,9 @@
|
||||
name: unittest
|
||||
|
||||
on: [push]
|
||||
|
||||
# fake comment to trigger an action 1
|
||||
jobs:
|
||||
linux:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: make test
|
||||
@ -14,38 +11,22 @@ jobs:
|
||||
|
||||
mac:
|
||||
runs-on: macOS-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: make test
|
||||
run: make test
|
||||
|
||||
# We don't need to have redis running anymore, as we have our fake limited one
|
||||
# - name: install redis
|
||||
# run: brew install redis
|
||||
#
|
||||
# - name: start redis server
|
||||
# run: brew services start redis
|
||||
win:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- uses: seanmiddleditch/gha-setup-vsdevenv@master
|
||||
- run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DCMAKE_CXX_COMPILER=cl.exe -DUSE_WS=1 -DUSE_TEST=1 ..
|
||||
- run: cmake --build build
|
||||
|
||||
# # Windows does not work yet, I'm stuck at getting CMake to run + finding vcpkg
|
||||
# win:
|
||||
# runs-on: windows-2016
|
||||
#
|
||||
# steps:
|
||||
# - uses: actions/checkout@v1
|
||||
#
|
||||
# - name: run cmake
|
||||
# run: |
|
||||
# "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
|
||||
# mkdir build
|
||||
# cd build
|
||||
# cmake -DCMAKE_TOOLCHAIN_FILE=%VCPKG_INSTALLATION_ROOT%\scripts\buildsystems\vcpkg.cmake -DUSE_WS=1 -DUSE_TEST=1 -DUSE_TLS=1 -G"NMake Makefiles" ..
|
||||
# - name: build
|
||||
# run: |
|
||||
# "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
|
||||
# cd build
|
||||
# nmake
|
||||
# - name: run tests
|
||||
# run:
|
||||
# cd test
|
||||
# ..\build\test\ixwebsocket_unittest.exe
|
||||
# Running the unittest does not work
|
||||
#- run: ../build/test/ixwebsocket_unittest.exe
|
||||
# working-directory: test
|
||||
|
@ -31,10 +31,6 @@ target_include_directories( ixcrypto PUBLIC ${IXCRYPTO_INCLUDE_DIRS} )
|
||||
|
||||
# hmac computation needs a crypto library
|
||||
|
||||
if (WIN32)
|
||||
set(USE_MBED_TLS TRUE)
|
||||
endif()
|
||||
|
||||
target_compile_definitions(ixcrypto PUBLIC IXCRYPTO_USE_TLS)
|
||||
if (USE_MBED_TLS)
|
||||
find_package(MbedTLS REQUIRED)
|
||||
|
@ -14,7 +14,7 @@
|
||||
#elif defined(IXCRYPTO_USE_OPEN_SSL)
|
||||
# include <openssl/hmac.h>
|
||||
#else
|
||||
# error "Unsupported configuration"
|
||||
# include <assert.h>
|
||||
#endif
|
||||
|
||||
namespace ix
|
||||
@ -40,7 +40,7 @@ namespace ix
|
||||
(unsigned char *) data.c_str(), (int) data.size(),
|
||||
(unsigned char *) hash, nullptr);
|
||||
#else
|
||||
# error "Unsupported configuration"
|
||||
assert(false && "hmac not implemented on this platform");
|
||||
#endif
|
||||
|
||||
std::string hashString(reinterpret_cast<char*>(hash), hashSize);
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include <atomic>
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
namespace ix
|
||||
{
|
||||
|
@ -50,19 +50,21 @@ set (SOURCES
|
||||
IXHttpServerTest.cpp
|
||||
IXUnityBuildsTest.cpp
|
||||
IXHttpTest.cpp
|
||||
IXCobraChatTest.cpp
|
||||
IXCobraMetricsPublisherTest.cpp
|
||||
IXDNSLookupTest.cpp
|
||||
IXWebSocketSubProtocolTest.cpp
|
||||
IXSentryClientTest.cpp
|
||||
IXWebSocketChatTest.cpp
|
||||
IXCobraToSentryBotTest.cpp
|
||||
)
|
||||
|
||||
# Some unittest don't work on windows yet
|
||||
if (UNIX)
|
||||
list(APPEND SOURCES
|
||||
IXWebSocketCloseTest.cpp
|
||||
|
||||
# Windows without TLS does not have hmac yet
|
||||
IXCobraChatTest.cpp
|
||||
IXCobraMetricsPublisherTest.cpp
|
||||
IXCobraToSentryBotTest.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
|
@ -76,14 +76,6 @@ target_link_libraries(ws ixbots)
|
||||
|
||||
target_link_libraries(ws spdlog)
|
||||
|
||||
if(NOT APPLE AND NOT USE_MBED_TLS)
|
||||
find_package(OpenSSL REQUIRED)
|
||||
add_definitions(${OPENSSL_DEFINITIONS})
|
||||
message(STATUS "OpenSSL: " ${OPENSSL_VERSION})
|
||||
include_directories(${OPENSSL_INCLUDE_DIR})
|
||||
target_link_libraries(ws ${OPENSSL_LIBRARIES})
|
||||
endif()
|
||||
|
||||
if (JSONCPP_FOUND)
|
||||
target_include_directories(ws PUBLIC ${JSONCPP_INCLUDE_DIRS})
|
||||
target_link_libraries(ws ${JSONCPP_LIBRARIES})
|
||||
|
Loading…
Reference in New Issue
Block a user