diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 0128eef..3212a65 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -7,7 +7,7 @@ on: branches: [ master ] jobs: - build: + build-ubuntu: runs-on: ubuntu-latest @@ -34,3 +34,79 @@ jobs: - name: run tests run: cd tests/build && ./p2pool_tests + + build-windows-msys2: + + runs-on: windows-latest + + defaults: + run: + shell: msys2 {0} + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + with: + submodules: recursive + + - name: Setup MSYS2 + uses: eine/setup-msys2@v2 + with: + update: true + install: mingw-w64-x86_64-toolchain make mingw-w64-x86_64-cmake mingw-w64-x86_64-zeromq mingw-w64-x86_64-libsodium mingw-w64-x86_64-libuv + + - name: Build p2pool + run: | + mkdir build + cd build + cmake .. -G "Unix Makefiles" + make + + - name: Build tests + run: | + cd tests + mkdir build + cd build + cmake .. -G "Unix Makefiles" + make + + - name: Run tests + run: | + cd tests/build + ./p2pool_tests.exe + + build-windows-msbuild: + + runs-on: windows-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + with: + submodules: recursive + + - name: Setup cmake + uses: lukka/get-cmake@latest + + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v1.0.3 + + - name: Build p2pool + run: | + mkdir build + cd build + cmake .. -G "Visual Studio 16 2019" + msbuild /m /p:Configuration=Release p2pool.vcxproj + + - name: Build tests + run: | + cd tests + mkdir build + cd build + cmake .. -G "Visual Studio 16 2019" + msbuild /m /p:Configuration=Release p2pool_tests.vcxproj + + - name: Run tests + run: | + cd tests/build/Release + ./p2pool_tests.exe diff --git a/external/src/cryptonote/crypto-ops-data.c b/external/src/cryptonote/crypto-ops-data.c index d16fd94..45bc23e 100644 --- a/external/src/cryptonote/crypto-ops-data.c +++ b/external/src/cryptonote/crypto-ops-data.c @@ -28,6 +28,10 @@ // // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers +#ifdef _MSC_VER +#pragma warning(disable: 4146 4242 4244 4668 4710 4711 5045) +#endif + #include #include "crypto-ops.h" diff --git a/external/src/cryptonote/crypto-ops.c b/external/src/cryptonote/crypto-ops.c index ad0a793..7ad465b 100644 --- a/external/src/cryptonote/crypto-ops.c +++ b/external/src/cryptonote/crypto-ops.c @@ -28,15 +28,15 @@ // // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers +#ifdef _MSC_VER +#pragma warning(disable: 4146 4242 4244 4668 4710 4711 5045) +#endif + #include #include #include "crypto-ops.h" -#ifdef _MSC_VER -#pragma warning(disable: 4146 4242 4244 4711 5045) -#endif - /* Predeclarations */ static void fe_mul(fe, const fe, const fe); diff --git a/external/src/llhttp/api.c b/external/src/llhttp/api.c index 891ab93..4d68b4c 100644 --- a/external/src/llhttp/api.c +++ b/external/src/llhttp/api.c @@ -1,13 +1,13 @@ -#include -#include -#include - #ifdef _MSC_VER -#pragma warning(disable : 4100 4710 4711 4820) +#pragma warning(disable : 4100 4668 4710 4711 4820) #elif defined __GNUC__ #pragma GCC diagnostic ignored "-Wunused-parameter" #endif +#include +#include +#include + #include "llhttp.h" #define CALLBACK_MAYBE(PARSER, NAME) \ diff --git a/external/src/llhttp/http.c b/external/src/llhttp/http.c index 09c0dc4..dd406af 100644 --- a/external/src/llhttp/http.c +++ b/external/src/llhttp/http.c @@ -1,5 +1,5 @@ #ifdef _MSC_VER -#pragma warning(disable : 4100 4711 4820) +#pragma warning(disable : 4100 4668 4710 4711 4820) #elif defined __GNUC__ #pragma GCC diagnostic ignored "-Wunused-parameter" #endif diff --git a/external/src/llhttp/llhttp.c b/external/src/llhttp/llhttp.c index fe10574..b025b02 100644 --- a/external/src/llhttp/llhttp.c +++ b/external/src/llhttp/llhttp.c @@ -1,5 +1,5 @@ #ifdef _MSC_VER -#pragma warning(disable : 4061 4065 4100 4152 4242 4244 4668 4702 4820 5045) +#pragma warning(disable : 4061 4065 4100 4152 4242 4244 4668 4702 4710 4711 4820 5045) #elif defined __GNUC__ #pragma GCC diagnostic ignored "-Wunused-parameter" #endif diff --git a/src/p2pool_api.cpp b/src/p2pool_api.cpp index 7b20848..e8a88b1 100644 --- a/src/p2pool_api.cpp +++ b/src/p2pool_api.cpp @@ -75,7 +75,11 @@ void p2pool_api::create_dir(const std::string& path) #ifdef _MSC_VER int result = _mkdir(path.c_str()); #else - int result = mkdir(path.c_str(), 0775); + int result = mkdir(path.c_str() +#ifndef _WIN32 + , 0775 +#endif + ); #endif if (result < 0) { diff --git a/tests/src/keccak_tests.cpp b/tests/src/keccak_tests.cpp index 4f22cca..36e4071 100644 --- a/tests/src/keccak_tests.cpp +++ b/tests/src/keccak_tests.cpp @@ -38,7 +38,7 @@ TEST(keccak, hashing) memset(buf, 0, sizeof(buf)); s.m_pos = 0; - keccak_custom([data](int offset) { return data[offset]; }, size, output.h, HASH_SIZE); + keccak_custom([data](int offset) { return data[offset]; }, len, output.h, HASH_SIZE); s << output; ASSERT_EQ(memcmp(buf, expected_output, HASH_SIZE * 2), 0); };