continuous_integration.yml 12 KB

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