From 99923dd1267e5865dc53b70aec3bb1b0c84525a9 Mon Sep 17 00:00:00 2001 From: Rafael Kitover Date: Sat, 28 Oct 2023 14:44:02 +0000 Subject: [PATCH] ci: add Visual Studio workflow Add a Visual Studio build workflow to the CI, test building using ninja (msbuild support needs to be fixed) for both 64 and 32 bit. Signed-off-by: Rafael Kitover --- .github/workflows/visual-studio-build.yml | 36 +++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/visual-studio-build.yml diff --git a/.github/workflows/visual-studio-build.yml b/.github/workflows/visual-studio-build.yml new file mode 100644 index 00000000..f512e194 --- /dev/null +++ b/.github/workflows/visual-studio-build.yml @@ -0,0 +1,36 @@ +name: Visual Studio Build +on: [push, pull_request] + +jobs: + build: + strategy: + matrix: + msvc_arch: ['x64', 'x64_x86'] + cmake_generator: ['Ninja'] +# cmake_generator: ['Ninja', '"Visual Studio 17 2022"'] + cmake_build: ['-DCMAKE_BUILD_TYPE=Release', '-DCMAKE_BUILD_TYPE=Debug'] + cmake_options: ['', '-DENABLE_LINK=OFF', '-DENABLE_SDL=ON'] + runs-on: windows-latest + steps: + - name: Checkout the code + uses: actions/checkout@v2 + with: + submodules: recursive + + - name: Prepare Visual Studio environment + uses: ilammy/msvc-dev-cmd@v1.12.0 + with: + arch: ${{ matrix.msvc_arch }} + + - name: Configure (x64) + if: matrix.msvc_arch == 'x64' + run: >- + cmake -B build -G ${{ matrix.cmake_generator }} -DVCPKG_TARGET_TRIPLET=x64-windows-static ${{ matrix.cmake_build }} ${{ matrix.cmake_options }} + + - name: Configure (x86) + if: matrix.msvc_arch == 'x64_x86' + run: >- + cmake -B build -G ${{ matrix.cmake_generator }} -DVCPKG_TARGET_TRIPLET=x86-windows-static ${{ matrix.cmake_build }} ${{ matrix.cmake_options }} + + - name: Build + run: cmake --build build