linux_builds.yml 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. name: 🐧 Linux Builds
  2. on:
  3. workflow_call:
  4. workflow_dispatch:
  5. # Global Settings
  6. env:
  7. SCONS_FLAGS: >-
  8. dev_mode=yes
  9. module_text_server_fb_enabled=yes
  10. "accesskit_sdk_path=${{ github.workspace }}/accesskit-c-0.18.0/"
  11. GODOT_CPP_BRANCH: 4.5
  12. DOTNET_NOLOGO: true
  13. DOTNET_CLI_TELEMETRY_OPTOUT: true
  14. ASAN_OPTIONS: color=always:print_suppressions=1:suppressions=${{ github.workspace }}/misc/error_suppressions/asan.txt
  15. LSAN_OPTIONS: color=always:print_suppressions=1:suppressions=${{ github.workspace }}/misc/error_suppressions/lsan.txt
  16. TSAN_OPTIONS: color=always:print_suppressions=1:suppressions=${{ github.workspace }}/misc/error_suppressions/tsan.txt
  17. UBSAN_OPTIONS: color=always:print_suppressions=1:suppressions=${{ github.workspace }}/misc/error_suppressions/ubsan.txt
  18. jobs:
  19. build-linux:
  20. # Stay one LTS before latest to increase portability of Linux artifacts.
  21. runs-on: ubuntu-22.04
  22. name: ${{ matrix.name }}
  23. timeout-minutes: 120
  24. strategy:
  25. fail-fast: false
  26. matrix:
  27. include:
  28. - name: Editor w/ Mono (target=editor)
  29. cache-name: linux-editor-mono
  30. target: editor
  31. scons-flags: module_mono_enabled=yes
  32. bin: ./bin/godot.linuxbsd.editor.x86_64.mono
  33. build-mono: true
  34. doc-test: true
  35. proj-conv: true
  36. api-compat: true
  37. artifact: true
  38. # Validate godot-cpp compatibility on one arbitrary editor build.
  39. godot-cpp: true
  40. - name: Editor with doubles and GCC sanitizers (target=editor, dev_build=yes, scu_build=yes, precision=double, use_asan=yes, use_ubsan=yes, linker=mold)
  41. cache-name: linux-editor-double-sanitizers
  42. target: editor
  43. # Debug symbols disabled as they're huge on this build and we hit the 14 GB limit for runners.
  44. scons-flags: >-
  45. dev_build=yes
  46. scu_build=yes
  47. debug_symbols=no
  48. precision=double
  49. use_asan=yes
  50. use_ubsan=yes
  51. linker=mold
  52. bin: ./bin/godot.linuxbsd.editor.dev.double.x86_64.san
  53. proj-test: true
  54. - name: Editor with clang sanitizers (target=editor, dev_build=yes, use_asan=yes, use_ubsan=yes, use_llvm=yes, linker=lld)
  55. cache-name: linux-editor-llvm-sanitizers
  56. target: editor
  57. scons-flags: >-
  58. dev_build=yes
  59. use_asan=yes
  60. use_ubsan=yes
  61. use_llvm=yes
  62. linker=lld
  63. bin: ./bin/godot.linuxbsd.editor.dev.x86_64.llvm.san
  64. # Test our oldest supported SCons/Python versions on one arbitrary editor build.
  65. legacy-scons: true
  66. - name: Editor with ThreadSanitizer (target=editor, dev_build=yes, use_tsan=yes, use_llvm=yes, linker=lld)
  67. cache-name: linux-editor-thread-sanitizer
  68. target: editor
  69. scons-flags: >-
  70. dev_build=yes
  71. use_tsan=yes
  72. use_llvm=yes
  73. linker=lld
  74. bin: ./bin/godot.linuxbsd.editor.dev.x86_64.llvm.san
  75. - name: Template w/ Mono, release (target=template_release)
  76. cache-name: linux-template-mono
  77. target: template_release
  78. scons-flags: module_mono_enabled=yes
  79. bin: ./bin/godot.linuxbsd.template_release.x86_64.mono
  80. artifact: true
  81. - name: Template w/ Mono, debug (target=template_debug)
  82. cache-name: linux-template-mono-debug
  83. target: template_debug
  84. scons-flags: module_mono_enabled=yes
  85. bin: ./bin/godot.linuxbsd.template_debug.x86_64.mono
  86. artifact: true
  87. - name: Minimal template (target=template_release, everything disabled)
  88. cache-name: linux-template-minimal
  89. target: template_release
  90. scons-flags: >-
  91. modules_enabled_by_default=no
  92. module_text_server_fb_enabled=no
  93. disable_3d=yes
  94. disable_advanced_gui=yes
  95. disable_physics_2d=yes
  96. disable_physics_3d=yes
  97. deprecated=no
  98. minizip=no
  99. brotli=no
  100. bin: ./bin/godot.linuxbsd.template_release.x86_64
  101. artifact: true
  102. steps:
  103. - name: Checkout
  104. uses: actions/checkout@v4
  105. with:
  106. submodules: recursive
  107. - name: Setup dependencies
  108. run: |
  109. sudo apt-get update
  110. sudo apt-get install libwayland-bin # TODO: Figure out somehow how to embed this one.
  111. if [ "${{ matrix.proj-test }}" == "true" ]; then
  112. sudo apt-get install mesa-vulkan-drivers
  113. fi
  114. - name: Free disk space on runner
  115. run: |
  116. echo "Disk usage before:" && df -h
  117. sudo rm -rf /usr/local/lib/android
  118. echo "Disk usage after:" && df -h
  119. - name: Restore Godot build cache
  120. uses: ./.github/actions/godot-cache-restore
  121. with:
  122. cache-name: ${{ matrix.cache-name }}
  123. continue-on-error: true
  124. - name: Setup Python and SCons
  125. if: "!matrix.legacy-scons"
  126. uses: ./.github/actions/godot-deps
  127. - name: Setup Python and SCons (legacy versions)
  128. if: matrix.legacy-scons
  129. uses: ./.github/actions/godot-deps
  130. with:
  131. # Sync with Ensure*Version in SConstruct.
  132. python-version: 3.8
  133. scons-version: 4.0
  134. - name: Force remove preinstalled .NET SDKs
  135. if: matrix.build-mono
  136. run: |
  137. sudo rm -rf /usr/share/dotnet/sdk/*
  138. - name: Setup older .NET SDK as baseline
  139. if: matrix.build-mono
  140. uses: actions/setup-dotnet@v4
  141. with:
  142. # Targeting the oldest version we want to support to ensure it still builds.
  143. dotnet-version: 8.0.100
  144. - name: Download pre-built AccessKit
  145. uses: dsaltares/[email protected]
  146. with:
  147. repo: AccessKit/accesskit-c
  148. version: tags/0.18.0
  149. file: accesskit-c-0.18.0.zip
  150. target: accesskit-c-0.18.0/accesskit_c.zip
  151. - name: Extract pre-built AccessKit
  152. run: unzip -o accesskit-c-0.18.0/accesskit_c.zip
  153. - name: Install mold linker
  154. if: matrix.proj-test
  155. uses: rui314/setup-mold@v1
  156. - name: Compilation
  157. uses: ./.github/actions/godot-build
  158. with:
  159. scons-flags: ${{ env.SCONS_FLAGS }} ${{ matrix.scons-flags }}
  160. platform: linuxbsd
  161. target: ${{ matrix.target }}
  162. - name: Compilation (godot-cpp)
  163. uses: ./.github/actions/godot-cpp-build
  164. if: matrix.godot-cpp
  165. with:
  166. bin: ${{ matrix.bin }}
  167. scons-flags: target=template_debug dev_build=yes verbose=yes
  168. godot-cpp-branch: ${{ env.GODOT_CPP_BRANCH }}
  169. - name: Save Godot build cache
  170. uses: ./.github/actions/godot-cache-save
  171. with:
  172. cache-name: ${{ matrix.cache-name }}
  173. continue-on-error: true
  174. - name: Generate C# glue
  175. if: matrix.build-mono
  176. run: |
  177. ${{ matrix.bin }} --headless --generate-mono-glue ./modules/mono/glue
  178. - name: Build .NET solutions
  179. if: matrix.build-mono
  180. run: |
  181. dotnet --info
  182. ./modules/mono/build_scripts/build_assemblies.py --godot-output-dir=./bin --godot-platform=linuxbsd --werror
  183. - name: Prepare artifact
  184. if: matrix.artifact
  185. run: |
  186. strip bin/godot.*
  187. chmod +x bin/godot.*
  188. - name: Upload artifact
  189. uses: ./.github/actions/upload-artifact
  190. if: matrix.artifact
  191. with:
  192. name: ${{ matrix.cache-name }}
  193. - name: Unit tests
  194. run: |
  195. ${{ matrix.bin }} --version
  196. ${{ matrix.bin }} --help
  197. ${{ matrix.bin }} --headless --test --force-colors
  198. - name: .NET source generators tests
  199. if: matrix.build-mono
  200. run: |
  201. dotnet test modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests
  202. # Check class reference
  203. - name: Check for class reference updates
  204. if: matrix.doc-test
  205. run: |
  206. echo "Running --doctool to see if this changes the public API without updating the documentation."
  207. echo -e "If a diff is shown, it means that your code/doc changes are incomplete and you should update the class reference with --doctool.\n\n"
  208. ${{ matrix.bin }} --doctool --headless 2>&1 > /dev/null || true
  209. git diff --color --exit-code && ! git ls-files --others --exclude-standard | sed -e 's/^/New doc file missing in PR: /' | grep 'xml$'
  210. # Check API backwards compatibility
  211. - name: Check for GDExtension compatibility
  212. if: matrix.api-compat
  213. run: |
  214. ./misc/scripts/validate_extension_api.sh "${{ matrix.bin }}"
  215. # Download and run the test project
  216. - name: Test Godot project
  217. uses: ./.github/actions/godot-project-test
  218. if: matrix.proj-test
  219. with:
  220. bin: ${{ matrix.bin }}
  221. # Test the project converter
  222. - name: Test project converter
  223. uses: ./.github/actions/godot-converter-test
  224. if: matrix.proj-conv
  225. with:
  226. bin: ${{ matrix.bin }}