try matrix for win ci

This commit is contained in:
gabime 2024-11-02 09:41:44 +02:00
parent 12f7e4e72d
commit ece7a131ef

View File

@ -3,6 +3,9 @@ name: ci
on: [push, pull_request] on: [push, pull_request]
jobs: jobs:
# -----------------------------------------------------------------------
# Linux build matrix
# -----------------------------------------------------------------------
build_linux: build_linux:
runs-on: ubuntu-latest runs-on: ubuntu-latest
defaults: defaults:
@ -56,6 +59,9 @@ jobs:
make -j2 make -j2
ctest -j2 --output-on-failure ctest -j2 --output-on-failure
# -----------------------------------------------------------------------
# OS X build matrix
# -----------------------------------------------------------------------
build_osx: build_osx:
runs-on: macOS-latest runs-on: macOS-latest
name: "OS X Clang (C++11, Release)" name: "OS X Clang (C++11, Release)"
@ -77,13 +83,16 @@ jobs:
make -j2 make -j2
ctest -j2 --output-on-failure ctest -j2 --output-on-failure
# -----------------------------------------------------------------------
# Windows build matrix
# -----------------------------------------------------------------------
build_windows: build_windows:
runs-on: windows-latest runs-on: windows-latest
strategy: strategy:
matrix: matrix:
config: config:
- GENERATOR: '"Visual Studio 15 2017 Win64"' - GENERATOR: "Visual Studio 16 2019"
ARCH: "-A x64"
BUILD_TYPE: Debug BUILD_TYPE: Debug
BUILD_SHARED: 'OFF' BUILD_SHARED: 'OFF'
FATAL_ERRORS: 'OFF' FATAL_ERRORS: 'OFF'
@ -92,7 +101,8 @@ jobs:
BUILD_EXAMPLE: 'ON' BUILD_EXAMPLE: 'ON'
USE_STD_FORMAT: 'OFF' USE_STD_FORMAT: 'OFF'
CXX_STANDARD: 11 CXX_STANDARD: 11
- GENERATOR: '"Visual Studio 15 2017 Win64"' - GENERATOR: "Visual Studio 16 2019"
ARCH: "-A x64"
BUILD_TYPE: Release BUILD_TYPE: Release
BUILD_SHARED: 'OFF' BUILD_SHARED: 'OFF'
FATAL_ERRORS: 'OFF' FATAL_ERRORS: 'OFF'
@ -101,7 +111,8 @@ jobs:
BUILD_EXAMPLE: 'ON' BUILD_EXAMPLE: 'ON'
USE_STD_FORMAT: 'OFF' USE_STD_FORMAT: 'OFF'
CXX_STANDARD: 11 CXX_STANDARD: 11
- GENERATOR: '"Visual Studio 15 2017" -A x64' - GENERATOR: "Visual Studio 16 2019"
ARCH: "-A x64"
BUILD_TYPE: Release BUILD_TYPE: Release
BUILD_SHARED: 'ON' BUILD_SHARED: 'ON'
FATAL_ERRORS: 'OFF' FATAL_ERRORS: 'OFF'
@ -110,16 +121,8 @@ jobs:
BUILD_EXAMPLE: 'ON' BUILD_EXAMPLE: 'ON'
USE_STD_FORMAT: 'OFF' USE_STD_FORMAT: 'OFF'
CXX_STANDARD: 11 CXX_STANDARD: 11
- GENERATOR: '"Visual Studio 15 2017" -A x64' - GENERATOR: "Visual Studio 16 2019"
BUILD_TYPE: Release ARCH: "-A x64"
BUILD_SHARED: 'ON'
FATAL_ERRORS: 'OFF'
WCHAR: 'ON'
WCHAR_FILES: 'ON'
BUILD_EXAMPLE: 'OFF'
USE_STD_FORMAT: 'OFF'
CXX_STANDARD: 11
- GENERATOR: '"Visual Studio 16 2019" -A x64'
BUILD_TYPE: Release BUILD_TYPE: Release
BUILD_SHARED: 'ON' BUILD_SHARED: 'ON'
FATAL_ERRORS: 'ON' FATAL_ERRORS: 'ON'
@ -128,7 +131,8 @@ jobs:
BUILD_EXAMPLE: 'OFF' BUILD_EXAMPLE: 'OFF'
USE_STD_FORMAT: 'OFF' USE_STD_FORMAT: 'OFF'
CXX_STANDARD: 17 CXX_STANDARD: 17
- GENERATOR: '"Visual Studio 17 2022" -A x64' - GENERATOR: "Visual Studio 17 2022"
ARCH: "-A x64"
BUILD_TYPE: Release BUILD_TYPE: Release
BUILD_SHARED: 'ON' BUILD_SHARED: 'ON'
FATAL_ERRORS: 'ON' FATAL_ERRORS: 'ON'
@ -137,7 +141,8 @@ jobs:
BUILD_EXAMPLE: 'OFF' BUILD_EXAMPLE: 'OFF'
USE_STD_FORMAT: 'ON' USE_STD_FORMAT: 'ON'
CXX_STANDARD: 20 CXX_STANDARD: 20
- GENERATOR: '"Visual Studio 17 2022" -A x64' - GENERATOR: "Visual Studio 17 2022"
ARCH: "-A x64"
BUILD_TYPE: Release BUILD_TYPE: Release
BUILD_SHARED: 'ON' BUILD_SHARED: 'ON'
FATAL_ERRORS: 'ON' FATAL_ERRORS: 'ON'
@ -155,10 +160,11 @@ jobs:
uses: jwlawson/actions-setup-cmake@v1 uses: jwlawson/actions-setup-cmake@v1
- name: Configure CMake - name: Configure CMake
shell: pwsh
run: | run: |
mkdir build mkdir build
cd build cd build
cmake -G ${{ matrix.config.GENERATOR }} ` cmake -G "${{ matrix.config.GENERATOR }}" ${{ matrix.config.ARCH }} `
-D CMAKE_BUILD_TYPE=${{ matrix.config.BUILD_TYPE }} ` -D CMAKE_BUILD_TYPE=${{ matrix.config.BUILD_TYPE }} `
-D BUILD_SHARED_LIBS=${{ matrix.config.BUILD_SHARED }} ` -D BUILD_SHARED_LIBS=${{ matrix.config.BUILD_SHARED }} `
-D SPDLOG_WCHAR_SUPPORT=${{ matrix.config.WCHAR }} ` -D SPDLOG_WCHAR_SUPPORT=${{ matrix.config.WCHAR }} `
@ -172,13 +178,14 @@ jobs:
-D CMAKE_CXX_STANDARD=${{ matrix.config.CXX_STANDARD }} .. -D CMAKE_CXX_STANDARD=${{ matrix.config.CXX_STANDARD }} ..
- name: Build - name: Build
shell: pwsh
run: | run: |
cd build cd build
cmake --build . --config ${{ matrix.config.BUILD_TYPE }} cmake --build . --config ${{ matrix.config.BUILD_TYPE }}
- name: Run tests - name: Run tests
shell: pwsh
env: env:
PATH: ${{ env.PATH }};${{ github.workspace }}\build\_deps\catch2-build\src\${{ matrix.config.BUILD_TYPE }};${{ github.workspace }}\build\${{ matrix.config.BUILD_TYPE }} PATH: ${{ env.PATH }};${{ github.workspace }}\build\_deps\catch2-build\src\${{ matrix.config.BUILD_TYPE }};${{ github.workspace }}\build\${{ matrix.config.BUILD_TYPE }}
run: | run: |
build\tests\${{ matrix.config.BUILD_TYPE }}\spdlog-utests.exe build\tests\${{ matrix.config.BUILD_TYPE }}\spdlog-utests.exe