ci.yml 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. name: CI
  2. on:
  3. push:
  4. branches: [ "master" ]
  5. pull_request:
  6. branches: [ "master" ]
  7. jobs:
  8. build_autotools:
  9. name: Autotools / ${{ matrix.os }}
  10. runs-on: ${{ matrix.os }}
  11. strategy:
  12. fail-fast: false
  13. matrix:
  14. os: [macos-12, macos-14, ubuntu-22.04]
  15. steps:
  16. - uses: actions/checkout@v4
  17. - name: Install Autotools
  18. if: runner.os == 'macOS'
  19. run: brew upgrade && brew install autoconf automake libtool
  20. - name: Generate Autotools
  21. run: ./autogen.sh
  22. - name: Configure Autotools
  23. run: ./configure
  24. - name: Build
  25. run: make
  26. - name: Test
  27. run: make check
  28. build_cmake_ios:
  29. name: CMake / iOS
  30. runs-on: macos-14
  31. steps:
  32. - uses: actions/checkout@v4
  33. - name: Configure CMake
  34. run: |
  35. cmake \
  36. -B build \
  37. -GXcode \
  38. -DCMAKE_SYSTEM_NAME=iOS \
  39. -DCMAKE_BUILD_TYPE=Release \
  40. -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED=NO \
  41. -DCGLM_STATIC=ON \
  42. -DCGLM_USE_TEST=ON
  43. - name: Build
  44. run: cmake --build build
  45. build_cmake_macos:
  46. name: CMake / ${{ matrix.os }}
  47. runs-on: ${{ matrix.os }}
  48. strategy:
  49. fail-fast: false
  50. matrix:
  51. os: [macos-12, macos-14]
  52. steps:
  53. - uses: actions/checkout@v4
  54. - name: Install Ninja
  55. if: runner.os == 'macOS'
  56. run: brew upgrade && brew install ninja
  57. - name: Configure CMake
  58. run: |
  59. cmake \
  60. -B build \
  61. -GNinja \
  62. -DCMAKE_BUILD_TYPE=Release \
  63. -DCGLM_STATIC=ON \
  64. -DCGLM_USE_TEST=ON
  65. - name: Build
  66. run: cmake --build build
  67. - name: Test
  68. working-directory: build
  69. run: ./tests
  70. build_cmake_ubuntu:
  71. name: CMake / ${{ matrix.target.os }} / ${{ matrix.target.cc }}
  72. runs-on: ${{ matrix.target.os }}
  73. strategy:
  74. fail-fast: false
  75. matrix:
  76. target:
  77. - { os: ubuntu-20.04, cc: gcc-11 }
  78. - { os: ubuntu-22.04, cc: gcc-12 }
  79. - { os: ubuntu-22.04, cc: gcc-13 }
  80. - { os: ubuntu-20.04, cc: clang-12 }
  81. - { os: ubuntu-22.04, cc: clang-15 }
  82. steps:
  83. - uses: actions/checkout@v4
  84. - name: Install Compiler and Ninja
  85. run: |
  86. sudo apt-get update -y
  87. sudo apt-get install -y ${{ matrix.target.cc }} ninja-build
  88. - name: Configure CMake
  89. run: |
  90. cmake \
  91. -B build \
  92. -GNinja \
  93. -DCMAKE_C_COMPILER=${{ matrix.target.cc }} \
  94. -DCMAKE_BUILD_TYPE=Release \
  95. -DCGLM_STATIC=ON \
  96. -DCGLM_USE_TEST=ON
  97. - name: Build
  98. run: cmake --build build
  99. - name: Test
  100. working-directory: build
  101. run: ./tests
  102. build_cmake_windows:
  103. name: CMake / ${{ matrix.platform.name }}
  104. runs-on: windows-2022
  105. strategy:
  106. fail-fast: false
  107. matrix:
  108. platform:
  109. - { name: Windows (x64), flags: -A x64 }
  110. - { name: Windows (x86), flags: -A Win32 }
  111. - { name: Windows (clang-cl x64), flags: -T ClangCL -A x64 }
  112. - { name: Windows (clang-cl x86), flags: -T ClangCL -A Win32 }
  113. - { name: Windows (ARM), flags: -A ARM, skip_tests: true, skip_build: true } # This fails to build.
  114. - { name: Windows (ARM64), flags: -A ARM64, skip_tests: true }
  115. - { name: UWP (ARM64), flags: -A ARM64, -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION="10.0", skip_tests: true }
  116. - { name: UWP (x64), flags: -A x64 -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION="10.0", skip_tests: true }
  117. steps:
  118. - uses: actions/checkout@v4
  119. - name: Configure CMake
  120. run: cmake -B build `
  121. -DCGLM_STATIC=ON `
  122. -DCGLM_USE_TEST=ON `
  123. ${{ matrix.platform.flags }}
  124. - name: Build
  125. if: ${{ !matrix.platform.skip_build }}
  126. run: cmake --build build --config Release --parallel
  127. - name: Test
  128. if: ${{ !matrix.platform.skip_tests }}
  129. working-directory: build
  130. run: .\Release\tests.exe
  131. build_documentation:
  132. name: Documentation
  133. runs-on: ubuntu-22.04
  134. steps:
  135. - uses: actions/checkout@v4
  136. - uses: actions/setup-python@v5
  137. with:
  138. python-version: '3.12'
  139. - name: Install Dependencies
  140. working-directory: docs
  141. run: python3 -m pip install -r requirements.txt
  142. - name: Build
  143. working-directory: docs
  144. run: sphinx-build -W --keep-going source build
  145. build_meson:
  146. name: Meson / ${{ matrix.os }}
  147. runs-on: ${{ matrix.os }}
  148. strategy:
  149. fail-fast: false
  150. matrix:
  151. os: [macos-14, ubuntu-22.04]
  152. steps:
  153. - uses: actions/checkout@v4
  154. - uses: actions/setup-python@v5
  155. with:
  156. python-version: '3.12'
  157. cache: 'pip'
  158. - name: Install meson
  159. run: python3 -m pip install meson ninja
  160. - name: Build
  161. run: meson setup build -Dbuildtype=release --default-library=static -Dbuild_tests=true
  162. - name: Test
  163. run: meson test -C build
  164. build_msbuild:
  165. name: MSBuild / Windows
  166. runs-on: windows-2022
  167. # This has no test yet.
  168. # It could also try building for ARM, ARM64, ARM64EC, but those fail currently.
  169. steps:
  170. - uses: actions/checkout@v4
  171. - uses: microsoft/setup-msbuild@v2
  172. - name: Build (x86)
  173. working-directory: win
  174. run: msbuild cglm.vcxproj /p:Configuration=Release /p:Platform=x86 /p:BuildInParallel=true
  175. - name: Build (x64)
  176. working-directory: win
  177. run: msbuild cglm.vcxproj /p:Configuration=Release /p:Platform=x64 /p:BuildInParallel=true
  178. build_swift:
  179. name: Swift ${{ matrix.swift }} / ${{ matrix.os }}
  180. runs-on: ${{ matrix.os }}
  181. strategy:
  182. fail-fast: false
  183. matrix:
  184. os: [macos-12, macos-14, ubuntu-22.04]
  185. # This has no test yet.
  186. steps:
  187. - uses: actions/checkout@v4
  188. - name: Build
  189. run: swift build