2022-02-28 07:50:37 -07:00
|
|
|
name: Build (MSVC)
|
|
|
|
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
Build:
|
|
|
|
name: ${{ matrix.platform.name }}
|
|
|
|
runs-on: windows-latest
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
platform:
|
2022-02-28 08:47:59 -07:00
|
|
|
- { name: Windows (x64), flags: -A x64, project: VisualC/SDL.sln, projectflags: '/p:Platform=x64' }
|
|
|
|
- { name: Windows (x86), flags: -A Win32, project: VisualC/SDL.sln, projectflags: '/p:Platform=Win32' }
|
2022-05-07 06:57:17 -06:00
|
|
|
- { name: Windows static VCRT (x64), flags: -A x64 -DSDL_FORCE_STATIC_VCRT=ON }
|
|
|
|
- { name: Windows static VCRT (x86), flags: -A Win32 -DSDL_FORCE_STATIC_VCRT=ON }
|
2022-02-28 07:50:37 -07:00
|
|
|
- { name: Windows (clang-cl x64), flags: -T ClangCL -A x64 }
|
|
|
|
- { name: Windows (clang-cl x86), flags: -T ClangCL -A Win32 }
|
2022-05-08 08:53:43 -06:00
|
|
|
- { name: Windows (ARM), flags: -A ARM }
|
2022-02-28 07:50:37 -07:00
|
|
|
- { name: Windows (ARM64), flags: -A ARM64 }
|
2022-06-03 11:24:20 -06:00
|
|
|
- { name: UWP (x64), flags: -A x64 -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION="10.0" -DSDL_TESTS=OFF,
|
|
|
|
project: VisualC-WinRT/SDL-UWP.sln, projectflags: '/p:Platform=x64 /p:WindowsTargetPlatformVersion=10.0.17763.0' }
|
2022-02-28 07:50:37 -07:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Configure CMake
|
2022-06-03 11:24:20 -06:00
|
|
|
run: cmake -S . -B build `
|
|
|
|
-DSDL_TESTS=ON `
|
2022-05-08 10:08:41 -06:00
|
|
|
-DSDL_INSTALL_TESTS=ON `
|
2022-06-03 11:24:20 -06:00
|
|
|
${{ matrix.platform.flags }} `
|
|
|
|
-DCMAKE_INSTALL_PREFIX=prefix
|
2022-02-28 07:50:37 -07:00
|
|
|
- name: Build CMake
|
2022-05-04 11:14:22 -06:00
|
|
|
run: cmake --build build/ --config Release --parallel
|
2022-05-08 10:08:41 -06:00
|
|
|
- name: Run build-time tests
|
|
|
|
if: "! contains(matrix.platform.name, 'ARM')"
|
|
|
|
run: |
|
|
|
|
$env:SDL_TESTS_QUICK=1
|
|
|
|
ctest -VV --test-dir build/ -C Release
|
2022-06-03 11:24:20 -06:00
|
|
|
- name: Install CMake
|
|
|
|
run: |
|
|
|
|
echo "SDL2_DIR=$Env:GITHUB_WORKSPACE/prefix" >> $Env:GITHUB_ENV
|
|
|
|
cmake --install build/
|
|
|
|
- name: Verify CMake configuration files
|
|
|
|
if: ${{ !contains(matrix.platform.name, 'UWP') }} # FIXME: cmake/test/CMakeLists.txt should support UWP
|
|
|
|
run: |
|
|
|
|
cmake -S cmake/test -B cmake_config_build `
|
|
|
|
-DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }} `
|
|
|
|
${{ matrix.platform.flags }}
|
|
|
|
cmake --build cmake_config_build --config Release
|
2022-02-28 07:50:37 -07:00
|
|
|
|
2022-02-28 08:47:59 -07:00
|
|
|
- name: Add msbuild to PATH
|
|
|
|
if: ${{ matrix.platform.project != '' }}
|
|
|
|
uses: microsoft/setup-msbuild@v1.0.2
|
|
|
|
- name: Build msbuild
|
|
|
|
if: ${{ matrix.platform.project != '' }}
|
|
|
|
run: msbuild ${{ matrix.platform.project }} /m /p:BuildInParallel=true /p:Configuration=Release ${{ matrix.platform.projectflags }}
|