continuous_integration.yml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  1. name: Continuous Integration
  2. on:
  3. workflow_dispatch:
  4. pull_request:
  5. branches:
  6. - main
  7. permissions: read-all
  8. jobs:
  9. linux:
  10. runs-on: ubuntu-22.04
  11. strategy:
  12. fail-fast: false
  13. matrix:
  14. compiler: [{cc: clang, cxx: clang++}, {cc: gcc, cxx: g++}]
  15. cmake_build_type: [Debug, Release]
  16. steps:
  17. - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
  18. - uses: lukka/get-cmake@2ecc21724e5215b0e567bc399a2602d2ecb48541 # v4.1.1
  19. - name: Setup ccache
  20. uses: hendrikmuhs/ccache-action@bfa03e1de4d7f7c3e80ad9109feedd05c4f5a716 # v1.2.19
  21. with:
  22. key: ubuntu-22-${{ matrix.cmake_build_type }}-${{ matrix.compiler.cc }}-${{matrix.compiler.cxx}}
  23. - run: ./update_glslang_sources.py
  24. - name: Configure
  25. run: cmake -S . -B build -D CMAKE_BUILD_TYPE=${{ matrix.cmake_build_type }} -DBUILD_WERROR=ON -D GLSLANG_TESTS=ON
  26. env:
  27. CC: ${{matrix.compiler.cc}}
  28. CXX: ${{matrix.compiler.cxx}}
  29. CMAKE_GENERATOR: Ninja
  30. CMAKE_C_COMPILER_LAUNCHER: ccache
  31. CMAKE_CXX_COMPILER_LAUNCHER: ccache
  32. - name: Build
  33. run: cmake --build build
  34. - name: Install
  35. run: cmake --install build --prefix build/install
  36. - name: Test find_package support
  37. run: |
  38. cmake -S Test/find_package -B build/find_package && \
  39. cmake --build build/find_package
  40. - name: Test
  41. run: ctest --output-on-failure --test-dir build
  42. - name: Check known validation failure list
  43. run: grep -l 'Validation failed' Test/baseResults/* | sort -fd | diff -u Test/baseResults/validation_fails.txt -
  44. linux-shared:
  45. runs-on: ubuntu-22.04
  46. strategy:
  47. fail-fast: false
  48. matrix:
  49. compiler: [{cc: clang, cxx: clang++}, {cc: gcc, cxx: g++}]
  50. cmake_build_type: [Release]
  51. steps:
  52. - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
  53. - uses: lukka/get-cmake@2ecc21724e5215b0e567bc399a2602d2ecb48541 # v4.1.1
  54. - name: Setup ccache
  55. uses: hendrikmuhs/ccache-action@bfa03e1de4d7f7c3e80ad9109feedd05c4f5a716 # v1.2.19
  56. with:
  57. key: ubuntu-22-${{ matrix.cmake_build_type }}-${{ matrix.compiler.cc }}-${{matrix.compiler.cxx}}
  58. - run: ./update_glslang_sources.py
  59. - name: Configure
  60. run: cmake -S . -B build -D CMAKE_BUILD_TYPE=${{ matrix.cmake_build_type }} -DBUILD_WERROR=ON -D GLSLANG_TESTS=ON -DBUILD_SHARED_LIBS=ON
  61. env:
  62. CC: ${{matrix.compiler.cc}}
  63. CXX: ${{matrix.compiler.cxx}}
  64. CMAKE_GENERATOR: Ninja
  65. CMAKE_C_COMPILER_LAUNCHER: ccache
  66. CMAKE_CXX_COMPILER_LAUNCHER: ccache
  67. - name: Build
  68. run: cmake --build build
  69. - name: Install
  70. run: cmake --install build --prefix build/install
  71. - name: Test find_package support
  72. run: |
  73. cmake -S Test/find_package -B build/find_package && \
  74. cmake --build build/find_package
  75. - name: Test
  76. run: ctest --output-on-failure --test-dir build
  77. linux-asan:
  78. runs-on: ubuntu-22.04
  79. strategy:
  80. fail-fast: false
  81. matrix:
  82. compiler: [{cc: gcc, cxx: g++}]
  83. cmake_build_type: [Debug]
  84. flags: ['-fsanitize=address', '-fsanitize=thread', '-fsanitize=undefined']
  85. steps:
  86. - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
  87. - uses: lukka/get-cmake@2ecc21724e5215b0e567bc399a2602d2ecb48541 # v4.1.1
  88. - name: Setup ccache
  89. uses: hendrikmuhs/ccache-action@bfa03e1de4d7f7c3e80ad9109feedd05c4f5a716 # v1.2.19
  90. with:
  91. key: ubuntu-22-${{ matrix.cmake_build_type }}-${{ matrix.compiler.cc }}-${{matrix.compiler.cxx}}-${{matrix.flags}}
  92. # This is to combat a bug when using 6.6 linux kernels with thread/address sanitizer
  93. # https://github.com/google/sanitizers/issues/1716
  94. - run: sudo sysctl vm.mmap_rnd_bits=28
  95. - run: ./update_glslang_sources.py
  96. - name: Configure
  97. run: cmake -S . -B build -D CMAKE_BUILD_TYPE=${{ matrix.cmake_build_type }} -D GLSLANG_TESTS=ON
  98. env:
  99. CC: ${{matrix.compiler.cc}}
  100. CXX: ${{matrix.compiler.cxx}}
  101. CMAKE_GENERATOR: Ninja
  102. CMAKE_C_COMPILER_LAUNCHER: ccache
  103. CMAKE_CXX_COMPILER_LAUNCHER: ccache
  104. CFLAGS: ${{matrix.flags}}
  105. CXXFLAGS: ${{matrix.flags}}
  106. LDFLAGS: ${{matrix.flags}}
  107. - name: Build
  108. run: cmake --build build
  109. - name: Install
  110. run: cmake --install build --prefix build/install
  111. - name: Test
  112. env:
  113. UBSAN_OPTIONS: 'halt_on_error=1:print_stacktrace=1'
  114. run: ctest --output-on-failure --test-dir build
  115. # Ensure we can compile/run on an older distro, with older tools (cmake, python, etc)
  116. linux_min:
  117. name: Linux Backcompat
  118. runs-on: ubuntu-22.04
  119. steps:
  120. - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
  121. - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
  122. with:
  123. python-version: '3.7'
  124. - uses: lukka/get-cmake@2ecc21724e5215b0e567bc399a2602d2ecb48541 # v4.1.1
  125. with:
  126. cmakeVersion: 3.22.1
  127. - name: Setup ccache
  128. uses: hendrikmuhs/ccache-action@bfa03e1de4d7f7c3e80ad9109feedd05c4f5a716 # v1.2.19
  129. with:
  130. key: linux_backcompat
  131. - run: ./update_glslang_sources.py
  132. - name: Configure
  133. run: cmake -S . -B build -D CMAKE_BUILD_TYPE=Release -D GLSLANG_TESTS=ON
  134. env:
  135. CMAKE_C_COMPILER_LAUNCHER: ccache
  136. CMAKE_CXX_COMPILER_LAUNCHER: ccache
  137. - name: Build
  138. run: cmake --build build
  139. - name: Install
  140. run: cmake --install build --prefix build/install
  141. - name: Test find_package support
  142. run: |
  143. cmake -S Test/find_package -B build/find_package && \
  144. cmake --build build/find_package
  145. - name: Test
  146. run: ctest --output-on-failure --test-dir build
  147. macos:
  148. runs-on: ${{matrix.os}}
  149. strategy:
  150. fail-fast: false
  151. matrix:
  152. os: [macos-14, macos-13]
  153. compiler: [{cc: clang, cxx: clang++}]
  154. cmake_build_type: [Debug, Release]
  155. steps:
  156. - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
  157. - uses: lukka/get-cmake@2ecc21724e5215b0e567bc399a2602d2ecb48541 # v4.1.1
  158. - run: ./update_glslang_sources.py
  159. - run: cmake -S . -B build -D CMAKE_BUILD_TYPE=${{matrix.cmake_build_type}} -G Ninja -DBUILD_WERROR=ON -D GLSLANG_TESTS=ON
  160. env:
  161. CC: ${{matrix.compiler.cc}}
  162. CXX: ${{matrix.compiler.cxx}}
  163. - run: cmake --build build
  164. - run: cmake --install build --prefix build/install
  165. - name: Test find_package support
  166. run: |
  167. cmake -S Test/find_package -B build/find_package && \
  168. cmake --build build/find_package
  169. - run: ctest --output-on-failure --test-dir build
  170. macos-shared:
  171. runs-on: ${{matrix.os}}
  172. strategy:
  173. fail-fast: false
  174. matrix:
  175. os: [macos-14]
  176. compiler: [{cc: clang, cxx: clang++}]
  177. cmake_build_type: [Release]
  178. steps:
  179. - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
  180. - uses: lukka/get-cmake@2ecc21724e5215b0e567bc399a2602d2ecb48541 # v4.1.1
  181. - run: ./update_glslang_sources.py
  182. - run: cmake -S . -B build -D CMAKE_BUILD_TYPE=${{matrix.cmake_build_type}} -G Ninja -DBUILD_WERROR=ON -D GLSLANG_TESTS=ON -DBUILD_SHARED_LIBS=ON
  183. env:
  184. CC: ${{matrix.compiler.cc}}
  185. CXX: ${{matrix.compiler.cxx}}
  186. - run: cmake --build build
  187. - run: cmake --install build --prefix build/install
  188. - name: Test find_package support
  189. run: |
  190. cmake -S Test/find_package -B build/find_package && \
  191. cmake --build build/find_package
  192. - run: ctest --output-on-failure --test-dir build
  193. windows:
  194. runs-on: ${{matrix.os.genus}}
  195. permissions:
  196. contents: write
  197. strategy:
  198. fail-fast: false
  199. matrix:
  200. os: [{genus: windows-2022, family: windows}]
  201. cmake_build_type: [Debug, Release]
  202. steps:
  203. - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
  204. - uses: lukka/get-cmake@2ecc21724e5215b0e567bc399a2602d2ecb48541 # v4.1.1
  205. - run: python update_glslang_sources.py
  206. - name: Build
  207. run: |
  208. cmake -S. -Bbuild -G "Visual Studio 17 2022" -A x64 -DCMAKE_INSTALL_PREFIX="$PWD/build/install" -DBUILD_WERROR=ON -D GLSLANG_TESTS=ON
  209. cmake --build build --config ${{matrix.cmake_build_type}} --target install
  210. - name: Test find_package support
  211. run: |
  212. cmake -S Test/find_package -B build/find_package
  213. cmake --build build/find_package
  214. - name: Test
  215. run: ctest -C ${{matrix.cmake_build_type}} --output-on-failure --test-dir build
  216. windows-shared:
  217. runs-on: ${{matrix.os.genus}}
  218. permissions:
  219. contents: write
  220. strategy:
  221. fail-fast: false
  222. matrix:
  223. os: [{genus: windows-2022, family: windows}]
  224. cmake_build_type: [Debug, Release]
  225. steps:
  226. - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
  227. - uses: lukka/get-cmake@2ecc21724e5215b0e567bc399a2602d2ecb48541 # v4.1.1
  228. - run: python update_glslang_sources.py
  229. - name: Build
  230. run: |
  231. cmake -S. -Bbuild -G "Visual Studio 17 2022" -A x64 -DCMAKE_INSTALL_PREFIX="$PWD/build/install" -DBUILD_WERROR=ON -D GLSLANG_TESTS=ON -DBUILD_SHARED_LIBS=ON
  232. cmake --build build --config ${{matrix.cmake_build_type}} --target install
  233. - name: Test find_package support
  234. run: |
  235. cmake -S Test/find_package -B build/find_package
  236. cmake --build build/find_package
  237. - name: Test
  238. run: ctest -C ${{matrix.cmake_build_type}} --output-on-failure --test-dir build
  239. iOS:
  240. runs-on: macos-13
  241. steps:
  242. - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
  243. - uses: lukka/get-cmake@2ecc21724e5215b0e567bc399a2602d2ecb48541 # v4.1.1
  244. - name: Setup ccache
  245. uses: hendrikmuhs/ccache-action@bfa03e1de4d7f7c3e80ad9109feedd05c4f5a716 # v1.2.19
  246. with:
  247. key: IOS
  248. - run: ./update_glslang_sources.py
  249. # NOTE: The MacOS SDK ships universal binaries. CI should reflect this.
  250. - name: Configure Universal Binary for iOS
  251. run: |
  252. cmake -S . -B build \
  253. -D CMAKE_BUILD_TYPE=Debug \
  254. -D CMAKE_SYSTEM_NAME=iOS \
  255. "-D CMAKE_OSX_ARCHITECTURES=arm64;x86_64" \
  256. -G Ninja
  257. env:
  258. CMAKE_C_COMPILER_LAUNCHER: ccache
  259. CMAKE_CXX_COMPILER_LAUNCHER: ccache
  260. - run: cmake --build build
  261. - run: cmake --install build --prefix /tmp
  262. android:
  263. runs-on: ubuntu-22.04
  264. strategy:
  265. matrix:
  266. # Android NDK currently offers 2 different toolchains.
  267. # Test both to ensure we are compatible with either approach.
  268. LEGACY: [ON, OFF]
  269. steps:
  270. - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
  271. - uses: lukka/get-cmake@2ecc21724e5215b0e567bc399a2602d2ecb48541 # v4.1.1
  272. - name: Setup ccache
  273. uses: hendrikmuhs/ccache-action@bfa03e1de4d7f7c3e80ad9109feedd05c4f5a716 # v1.2.19
  274. with:
  275. key: android-${{ matrix.LEGACY }}
  276. - run: ./update_glslang_sources.py
  277. - name: Configure for Android
  278. run: |
  279. cmake -S . -B build/ --toolchain $ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake \
  280. -D CMAKE_BUILD_TYPE=Release \
  281. -D ANDROID_ABI=armeabi-v7a \
  282. -D ANDROID_USE_LEGACY_TOOLCHAIN_FILE=${{ matrix.LEGACY }} \
  283. -G Ninja
  284. env:
  285. CMAKE_C_COMPILER_LAUNCHER: ccache
  286. CMAKE_CXX_COMPILER_LAUNCHER: ccache
  287. - run: cmake --build build/
  288. - run: cmake --install build/ --prefix /tmp
  289. emscripten:
  290. runs-on: ubuntu-22.04
  291. steps:
  292. - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
  293. - uses: lukka/get-cmake@2ecc21724e5215b0e567bc399a2602d2ecb48541 # v4.1.1
  294. - name: Setup ccache
  295. uses: hendrikmuhs/ccache-action@bfa03e1de4d7f7c3e80ad9109feedd05c4f5a716 # v1.2.19
  296. with:
  297. key: ubuntu-emscripten
  298. - uses: mymindstorm/setup-emsdk@6ab9eb1bda2574c4ddb79809fc9247783eaf9021 # v14
  299. - name: Update Glslang Sources
  300. run: ./update_glslang_sources.py
  301. - name: Configure
  302. run: emcmake cmake -GNinja -Bbuild/web -DCMAKE_BUILD_TYPE=Release -DENABLE_GLSLANG_JS=ON -DENABLE_OPT=OFF
  303. env:
  304. CMAKE_GENERATOR: Ninja
  305. CMAKE_C_COMPILER_LAUNCHER: ccache
  306. CMAKE_CXX_COMPILER_LAUNCHER: ccache
  307. - name: Build
  308. run: cmake --build build/web