🛠️🐜 Antkeeper superbuild with dependencies included https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

74 lines
3.1 KiB

  1. name: Build (MSVC)
  2. on: [push, pull_request]
  3. jobs:
  4. Build:
  5. name: ${{ matrix.platform.name }}
  6. runs-on: windows-latest
  7. strategy:
  8. fail-fast: false
  9. matrix:
  10. platform:
  11. - { name: Windows (x64), flags: -A x64, project: VisualC/SDL.sln, projectflags: '/p:Platform=x64' }
  12. - { name: Windows (x86), flags: -A Win32, project: VisualC/SDL.sln, projectflags: '/p:Platform=Win32' }
  13. - { name: Windows static VCRT (x64), flags: -A x64 -DSDL_FORCE_STATIC_VCRT=ON }
  14. - { name: Windows static VCRT (x86), flags: -A Win32 -DSDL_FORCE_STATIC_VCRT=ON }
  15. - { name: Windows (clang-cl x64), flags: -T ClangCL -A x64 }
  16. - { name: Windows (clang-cl x86), flags: -T ClangCL -A Win32 }
  17. - { name: Windows (ARM), flags: -A ARM }
  18. - { name: Windows (ARM64), flags: -A ARM64 }
  19. - { name: UWP (x64), flags: -A x64 -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION="10.0" -DSDL_TESTS=OFF, nowerror: true,
  20. project: VisualC-WinRT/SDL-UWP.sln, projectflags: '/p:Platform=x64 /p:WindowsTargetPlatformVersion=10.0.17763.0' }
  21. steps:
  22. - uses: actions/checkout@v3
  23. - name: Create CMake project using SDL as a subproject
  24. shell: python
  25. run: |
  26. import os
  27. import textwrap
  28. srcdir = r"${{ github.workspace }}".replace("\\", "/")
  29. builddir = f"{ srcdir }/build"
  30. os.makedirs(builddir)
  31. with open(f"{ builddir }/CMakeLists.txt", "w") as f:
  32. f.write(textwrap.dedent(f"""\
  33. cmake_minimum_required(VERSION 3.0)
  34. project(sdl_user)
  35. add_subdirectory("{ srcdir }" SDL)
  36. """))
  37. - name: Configure (CMake)
  38. run: cmake -S build -B build `
  39. -DSDL_WERROR=${{ !matrix.platform.nowerror }} `
  40. -DSDL_TESTS=ON `
  41. -DSDL_INSTALL_TESTS=ON `
  42. -DSDL_VENDOR_INFO="Github Workflow" `
  43. -DSDL2_DISABLE_INSTALL=OFF `
  44. ${{ matrix.platform.flags }} `
  45. -DCMAKE_INSTALL_PREFIX=prefix
  46. - name: Build (CMake)
  47. run: cmake --build build/ --config Release --parallel
  48. - name: Run build-time tests
  49. if: "! contains(matrix.platform.name, 'ARM')"
  50. run: |
  51. $env:SDL_TESTS_QUICK=1
  52. ctest -VV --test-dir build/ -C Release
  53. - name: Install (CMake)
  54. run: |
  55. echo "SDL2_DIR=$Env:GITHUB_WORKSPACE/prefix" >> $Env:GITHUB_ENV
  56. cmake --install build/
  57. - name: Verify CMake configuration files
  58. if: ${{ !contains(matrix.platform.name, 'UWP') }} # FIXME: cmake/test/CMakeLists.txt should support UWP
  59. run: |
  60. cmake -S cmake/test -B cmake_config_build `
  61. -DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }} `
  62. ${{ matrix.platform.flags }}
  63. cmake --build cmake_config_build --config Release
  64. - name: Add msbuild to PATH
  65. if: ${{ matrix.platform.project != '' }}
  66. uses: microsoft/setup-msbuild@v1.1.3
  67. - name: Build msbuild
  68. if: ${{ matrix.platform.project != '' }}
  69. run: msbuild ${{ matrix.platform.project }} /m /p:BuildInParallel=true /p:Configuration=Release ${{ matrix.platform.projectflags }}