-
Notifications
You must be signed in to change notification settings - Fork 304
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add a github workflow for re-enabling CI (#398)
Summary: Re-enable CI for gloo. 1. Disable libuv build in CI for windows as there are linker errors. Will resolve this later. 2. Remove tls_tcp_test.cc as this file does not exist anymore. 3. Put back win.cc and win.h files that were erroneously deleted. Pull Request resolved: #398 Reviewed By: d4l3k Differential Revision: D66522118 Pulled By: c-p-i-o fbshipit-source-id: b2b65a1ad50471059cb30fac2b019eda9c99c8fe
- Loading branch information
1 parent
aeca183
commit accd654
Showing
6 changed files
with
131 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
name: CI | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
windows_build: | ||
runs-on: windows-latest | ||
env: | ||
gtest_lib_path: c:/googletest | ||
libuv_path: c:/libuv | ||
steps: | ||
- uses: conda-incubator/setup-miniconda@v3 | ||
with: | ||
miniconda-version: "latest" | ||
- name: Add msbuild to PATH | ||
uses: microsoft/setup-msbuild@v2 | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: '3.10' | ||
- name: Add conda to system path | ||
run: | | ||
# $CONDA is an environment variable pointing to the root of the miniconda directory | ||
echo $CONDA/bin >> $GITHUB_PATH | ||
- name: Conda info | ||
shell: bash -l {0} | ||
run: conda info | ||
- name: Setup build environment | ||
run: | | ||
conda create -n py376_build python=3.7.6 | ||
conda activate py376_build | ||
conda install cmake | ||
- name: Install libuv | ||
run: | | ||
conda activate py376_build | ||
curl https://dist.libuv.org/dist/v1.38.0/libuv-v1.38.0.tar.gz --output libuv-v1.38.0.tar.gz | ||
tar xzvf libuv-v1.38.0.tar.gz | ||
cd libuv-v1.38.0 | ||
mkdir -p build | ||
cd build | ||
mkdir -p ${{ env.gtest_lib_path }} | ||
cmake .. -DCMAKE_INSTALL_PREFIX=${{ env.libuv_path }} | ||
msbuild INSTALL.vcxproj | ||
- name: Install googletest | ||
run: | | ||
conda activate py376_build | ||
curl https://codeload.github.com/google/googletest/tar.gz/release-1.10.0 --output googletest-release-1.10.0.tar.gz | ||
tar xzvf googletest-release-1.10.0.tar.gz | ||
cd googletest-release-1.10.0 | ||
mkdir -p build | ||
cd build | ||
if (Test-Path -Path ${{ env.gtest_lib_path }}) { | ||
echo "Directory already exists" | ||
} else { | ||
mkdir ${{ env.gtest_lib_path }} | ||
} | ||
cmake .. -DCMAKE_INSTALL_PREFIX=${{ env.gtest_lib_path }} -Dgtest_force_shared_crt=ON | ||
msbuild INSTALL.vcxproj | ||
- name: Build | ||
run: | | ||
conda activate py376_build | ||
git submodule sync | ||
git submodule update --init --recursive | ||
mkdir -p build | ||
cd build | ||
cmake .. -DBUILD_TEST=ON -Dlibuv_ROOT=${{ env.libuv_path }} -DGTEST_LIBRARY=${{ env.gtest_lib_path }}/lib/gtestd.lib -DGTEST_INCLUDE_DIR=${{ env.gtest_lib_path }}/include -DGTEST_MAIN_LIBRARY=${{ env.gtest_lib_path }}/lib/gtest_maind.lib | ||
msbuild ALL_BUILD.vcxproj | ||
- name: Test | ||
run: | | ||
build/gloo/test/Debug/gloo_test.exe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/** | ||
* Copyright (c) 2017-present, Facebook, Inc. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
#include "gloo/common/win.h" | ||
#include "gloo/common/logging.h" | ||
|
||
#include <mutex> | ||
|
||
namespace gloo { | ||
|
||
static std::once_flag init_flag; | ||
|
||
// The WSAStartup function must be the first Windows Sockets function | ||
// called by an application or DLL. | ||
// https://docs.microsoft.com/ru-ru/windows/win32/api/winsock/nf-winsock-wsastartup | ||
|
||
void init_winsock() { | ||
std::call_once(init_flag, []() { | ||
WSADATA wsa_data; | ||
int res; | ||
res = WSAStartup(MAKEWORD(2, 2), &wsa_data); | ||
if (res != 0) { | ||
GLOO_ENFORCE(false, "WSAStartup failed: ", res); | ||
} | ||
}); | ||
} | ||
|
||
} // namespace gloo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/** | ||
* Copyright (c) 2017-present, Facebook, Inc. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <winsock2.h> | ||
|
||
#pragma comment(lib, "Ws2_32.lib") | ||
|
||
namespace gloo { | ||
|
||
void init_winsock(); | ||
|
||
} // namespace gloo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters