Skip to content

Commit

Permalink
ci: msvc unittest
Browse files Browse the repository at this point in the history
  • Loading branch information
shuai132 committed Jun 19, 2024
1 parent e25bb51 commit 042e717
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 39 deletions.
60 changes: 22 additions & 38 deletions .github/workflows/build.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: build
name: CI

on:
push:
Expand All @@ -8,7 +8,6 @@ on:
paths-ignore:
- '**.md'


jobs:
build-and-test:

Expand Down Expand Up @@ -45,11 +44,14 @@ jobs:
- toolchain: windows-msvc
os: windows-latest
compiler: msvc
env:
BIN_SUFFIX: ".exe"

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

steps:
Expand All @@ -58,81 +60,63 @@ jobs:
submodules: true

- name: Init ASIO
run: |
git clone https://github.com/chriskohlhoff/asio.git -b asio-1-30-2 --depth=1
run: git clone https://github.com/chriskohlhoff/asio.git -b asio-1-30-2 --depth=1

- name: Configure (${{ matrix.configuration }})
env:
ASIO_PATH: asio/asio/include
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=${{ matrix.configuration }} ${{ matrix.env.CMAKE_OPTIONS }} -DASIO_NET_DISABLE_ON_DATA_PRINT=ON
run: cmake -S . -B build -DCMAKE_VERBOSE_MAKEFILE=ON -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: Windows-MSVC Compatible
if: matrix.os == 'windows-latest' && matrix.compiler == 'msvc'
working-directory: build
run: Move-Item -Path .\${{ matrix.configuration }}\* -Destination .\

- name: Test TCP
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
continue-on-error: true
working-directory: build
run: ./asio_net_test_tcp
run: ./asio_net_test_tcp${{ matrix.env.BIN_SUFFIX }}

- name: Test TCP (big data)
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
continue-on-error: true
working-directory: build
run: ./asio_net_test_tcp_bigdata
run: ./asio_net_test_tcp_bigdata${{ matrix.env.BIN_SUFFIX }}

- name: Test TCP (reconnect)
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
continue-on-error: true
working-directory: build
run: ./asio_net_test_tcp_reconnect
run: ./asio_net_test_tcp_reconnect${{ matrix.env.BIN_SUFFIX }}

- name: Test UDP
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
continue-on-error: true
working-directory: build
run: ./asio_net_test_udp
run: ./asio_net_test_udp${{ matrix.env.BIN_SUFFIX }}

- name: Test RPC
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
continue-on-error: true
working-directory: build
run: ./asio_net_test_rpc
run: ./asio_net_test_rpc${{ matrix.env.BIN_SUFFIX }}

- name: Test RPC (rpc_config)
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
continue-on-error: true
working-directory: build
run: ./asio_net_test_rpc_config
run: ./asio_net_test_rpc_config${{ matrix.env.BIN_SUFFIX }}

- name: Test RPC (reconnect)
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
continue-on-error: true
working-directory: build
run: ./asio_net_test_rpc_reconnect
run: ./asio_net_test_rpc_reconnect${{ matrix.env.BIN_SUFFIX }}

- name: Test RPC (ssl)
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
continue-on-error: true
working-directory: build
run: |
#./asio_net_test_rpc_ssl
#./asio_net_test_rpc_ssl${{ matrix.env.BIN_SUFFIX }}
echo "skip for avoid wait too long"
- name: Test Domain TCP
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
continue-on-error: true
working-directory: build
run: ./asio_net_test_domain_tcp
run: ./asio_net_test_domain_tcp${{ matrix.env.BIN_SUFFIX }}

- name: Test Domain UDP
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
continue-on-error: true
working-directory: build
run: ./asio_net_test_domain_udp
run: ./asio_net_test_domain_udp${{ matrix.env.BIN_SUFFIX }}

- name: Test Domain RPC
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
continue-on-error: true
working-directory: build
run: ./asio_net_test_domain_rpc
run: ./asio_net_test_domain_rpc${{ matrix.env.BIN_SUFFIX }}

0 comments on commit 042e717

Please sign in to comment.