Skip to content

Commit

Permalink
ci: more platform
Browse files Browse the repository at this point in the history
  • Loading branch information
shuai132 committed Jun 17, 2024
1 parent 556a2b2 commit 456f59b
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 39 deletions.
118 changes: 80 additions & 38 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,50 @@ on:
paths-ignore:
- '**.md'


jobs:
Linux:
runs-on: ubuntu-latest
build-and-test:

name: ${{ matrix.toolchain }}-${{ matrix.configuration }}
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false

matrix:
toolchain:
- linux-gcc
- macos-clang
- windows-msvc
- windows-mingw

configuration:
- Debug
- Release

include:
- toolchain: linux-gcc
os: ubuntu-latest
compiler: gcc
env:
CMAKE_OPTIONS: "-DASIO_NET_ENABLE_SSL=ON"

- toolchain: macos-clang
os: macos-latest
compiler: clang
env:
CMAKE_OPTIONS: "-DASIO_NET_ENABLE_SSL=ON"

- toolchain: windows-msvc
os: windows-latest
compiler: msvc

- toolchain: windows-mingw
os: windows-latest
compiler: mingw
env:
CMAKE_OPTIONS: "-G \"MinGW Makefiles\""

steps:
- uses: actions/checkout@v3
with:
Expand All @@ -20,66 +61,67 @@ jobs:
run: |
git clone https://github.com/chriskohlhoff/asio.git -b asio-1-24-0 --depth=1
- name: CMake Build
- name: Configure (${{ matrix.configuration }})
env:
ASIO_PATH: asio/asio/include
run: |
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Debug -DASIO_NET_DISABLE_ON_DATA_PRINT=ON -DASIO_NET_ENABLE_SSL=ON ..
make -j2
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=${{ matrix.configuration }} ${{ matrix.env.CMAKE_OPTIONS }} -DASIO_NET_DISABLE_ON_DATA_PRINT=ON

- name: Build with ${{ matrix.compiler }}
run: cmake --build build --config ${{ matrix.configuration }}

- name: Test TCP
run: |
cd build
./asio_net_test_tcp
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
working-directory: build
run: ./asio_net_test_tcp

- name: Test TCP (big data)
run: |
cd build
./asio_net_test_tcp_bigdata
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
working-directory: build
run: ./asio_net_test_tcp_bigdata

- name: Test TCP (reconnect)
run: |
cd build
./asio_net_test_tcp_reconnect
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
working-directory: build
run: ./asio_net_test_tcp_reconnect

- name: Test UDP
run: |
cd build
./asio_net_test_udp
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
working-directory: build
run: ./asio_net_test_udp

- name: Test RPC
run: |
cd build
./asio_net_test_rpc
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
working-directory: build
run: ./asio_net_test_rpc

- name: Test RPC (rpc_config)
run: |
cd build
./asio_net_test_rpc_config
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
working-directory: build
run: ./asio_net_test_rpc_config

- name: Test RPC (reconnect)
run: |
cd build
./asio_net_test_rpc_reconnect
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
working-directory: build
run: ./asio_net_test_rpc_reconnect

- name: Test RPC (ssl)
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
working-directory: build
run: |
cd build
#./asio_net_test_rpc_ssl
echo "skip for avoid wait too long"
- name: Test Domain TCP
run: |
cd build
./asio_net_test_domain_tcp
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
working-directory: build
run: ./asio_net_test_domain_tcp

- name: Test Domain UDP
run: |
cd build
./asio_net_test_domain_udp
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
working-directory: build
run: ./asio_net_test_domain_udp

- name: Test Domain RPC
run: |
cd build
./asio_net_test_domain_rpc
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
working-directory: build
run: ./asio_net_test_domain_rpc
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ else ()
add_compile_options(-Wall -Wunused-parameter)
endif ()

if (MINGW)
add_compile_options(-D_WIN32_WINNT=0x0601)
link_libraries(ws2_32 wsock32)
endif ()

add_library(${PROJECT_NAME} INTERFACE)
target_include_directories(${PROJECT_NAME} INTERFACE
include
Expand Down
2 changes: 1 addition & 1 deletion include/asio_net/rpc_core

0 comments on commit 456f59b

Please sign in to comment.