From 042e71704080c13fbafce1be174e6b999d3033fe Mon Sep 17 00:00:00 2001 From: liushuai <770722922@qq.com> Date: Tue, 18 Jun 2024 21:06:17 +0800 Subject: [PATCH] ci: msvc unittest --- .github/workflows/{build.yml => ci.yml} | 60 +++++++++---------------- include/asio_net/rpc_core | 2 +- 2 files changed, 23 insertions(+), 39 deletions(-) rename .github/workflows/{build.yml => ci.yml} (54%) diff --git a/.github/workflows/build.yml b/.github/workflows/ci.yml similarity index 54% rename from .github/workflows/build.yml rename to .github/workflows/ci.yml index 172b174..d0dda93 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: build +name: CI on: push: @@ -8,7 +8,6 @@ on: paths-ignore: - '**.md' - jobs: build-and-test: @@ -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: @@ -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 }} diff --git a/include/asio_net/rpc_core b/include/asio_net/rpc_core index 992c1d0..43baf6b 160000 --- a/include/asio_net/rpc_core +++ b/include/asio_net/rpc_core @@ -1 +1 @@ -Subproject commit 992c1d059332cc0b63ddc964f43c8ca7d9f266b2 +Subproject commit 43baf6b2c6c60b69d578b65e292413532adf4407