linux_builds.yml 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. name: 🐧 Linux Builds
  2. on:
  3. workflow_call:
  4. # Global Settings
  5. env:
  6. # Used for the cache key. Add version suffix to force clean build.
  7. GODOT_BASE_BRANCH: master
  8. SCONSFLAGS: verbose=yes warnings=extra werror=yes module_text_server_fb_enabled=yes strict_checks=yes
  9. DOTNET_NOLOGO: true
  10. DOTNET_CLI_TELEMETRY_OPTOUT: true
  11. TSAN_OPTIONS: suppressions=misc/error_suppressions/tsan.txt
  12. concurrency:
  13. group: ci-${{ github.actor }}-${{ github.head_ref || github.run_number }}-${{ github.ref }}-linux
  14. cancel-in-progress: true
  15. jobs:
  16. build-linux:
  17. # Stay one LTS before latest to increase portability of Linux artifacts.
  18. runs-on: ubuntu-22.04
  19. name: ${{ matrix.name }}
  20. strategy:
  21. fail-fast: false
  22. matrix:
  23. include:
  24. - name: Editor w/ Mono (target=editor)
  25. cache-name: linux-editor-mono
  26. target: editor
  27. sconsflags: module_mono_enabled=yes
  28. bin: ./bin/godot.linuxbsd.editor.x86_64.mono
  29. build-mono: true
  30. tests: false # Disabled due freeze caused by mix Mono build and CI
  31. doc-test: true
  32. proj-conv: true
  33. api-compat: true
  34. artifact: true
  35. - name: Editor with doubles and GCC sanitizers (target=editor, tests=yes, dev_build=yes, scu_build=yes, precision=double, use_asan=yes, use_ubsan=yes, linker=gold)
  36. cache-name: linux-editor-double-sanitizers
  37. target: editor
  38. # Debug symbols disabled as they're huge on this build and we hit the 14 GB limit for runners.
  39. sconsflags: dev_build=yes scu_build=yes debug_symbols=no precision=double use_asan=yes use_ubsan=yes linker=gold
  40. bin: ./bin/godot.linuxbsd.editor.dev.double.x86_64.san
  41. build-mono: false
  42. tests: true
  43. proj-test: true
  44. # Generate an API dump for godot-cpp tests.
  45. api-dump: true
  46. # Skip 2GiB artifact speeding up action.
  47. artifact: false
  48. - name: Editor with clang sanitizers (target=editor, tests=yes, dev_build=yes, use_asan=yes, use_ubsan=yes, use_llvm=yes, linker=lld)
  49. cache-name: linux-editor-llvm-sanitizers
  50. target: editor
  51. sconsflags: dev_build=yes use_asan=yes use_ubsan=yes use_llvm=yes linker=lld
  52. bin: ./bin/godot.linuxbsd.editor.dev.x86_64.llvm.san
  53. build-mono: false
  54. tests: true
  55. # Skip 2GiB artifact speeding up action.
  56. artifact: false
  57. # Test our oldest supported SCons/Python versions on one arbitrary editor build.
  58. legacy-scons: true
  59. - name: Editor with ThreadSanitizer (target=editor, tests=yes, dev_build=yes, use_tsan=yes, use_llvm=yes, linker=lld)
  60. cache-name: linux-editor-thread-sanitizer
  61. target: editor
  62. tests: true
  63. sconsflags: dev_build=yes use_tsan=yes use_llvm=yes linker=lld
  64. bin: ./bin/godot.linuxbsd.editor.dev.x86_64.llvm.san
  65. build-mono: false
  66. # Skip 2GiB artifact speeding up action.
  67. artifact: false
  68. - name: Template w/ Mono (target=template_release, tests=yes)
  69. cache-name: linux-template-mono
  70. target: template_release
  71. sconsflags: module_mono_enabled=yes
  72. bin: ./bin/godot.linuxbsd.template_release.x86_64.mono
  73. build-mono: false
  74. tests: true
  75. artifact: true
  76. - name: Minimal template (target=template_release, tests=yes, everything disabled)
  77. cache-name: linux-template-minimal
  78. target: template_release
  79. sconsflags: modules_enabled_by_default=no disable_3d=yes disable_advanced_gui=yes deprecated=no minizip=no
  80. bin: ./bin/godot.linuxbsd.template_release.x86_64
  81. tests: true
  82. artifact: true
  83. steps:
  84. - name: Checkout
  85. uses: actions/checkout@v4
  86. with:
  87. submodules: recursive
  88. # Need newer mesa for lavapipe to work properly.
  89. - name: Linux dependencies for tests
  90. if: matrix.proj-test
  91. run: |
  92. sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
  93. sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EB8B81E14DA65431D7504EA8F63F0F2B90935439
  94. sudo add-apt-repository "deb https://ppa.launchpadcontent.net/kisak/turtle/ubuntu ${{ matrix.os == 'ubuntu-20.04' && 'focal' || 'jammy' }} main"
  95. sudo apt-get install -qq mesa-vulkan-drivers
  96. # TODO: Figure out somehow how to embed this one.
  97. - name: wayland-scanner dependency
  98. run: |
  99. sudo apt-get install libwayland-bin
  100. - name: Free disk space on runner
  101. run: |
  102. echo "Disk usage before:" && df -h
  103. sudo rm -rf /usr/local/lib/android
  104. echo "Disk usage after:" && df -h
  105. - name: Restore Godot build cache
  106. uses: ./.github/actions/godot-cache-restore
  107. with:
  108. cache-name: ${{ matrix.cache-name }}
  109. continue-on-error: true
  110. - name: Setup Python and SCons
  111. if: '!matrix.legacy-scons'
  112. uses: ./.github/actions/godot-deps
  113. - name: Setup Python and SCons (legacy versions)
  114. if: matrix.legacy-scons
  115. uses: ./.github/actions/godot-deps
  116. with:
  117. # Sync with Ensure*Version in SConstruct.
  118. python-version: 3.8
  119. scons-version: 4.0
  120. - name: Setup GCC problem matcher
  121. uses: ammaraskar/gcc-problem-matcher@master
  122. - name: Compilation
  123. uses: ./.github/actions/godot-build
  124. with:
  125. sconsflags: ${{ env.SCONSFLAGS }} ${{ matrix.sconsflags }}
  126. platform: linuxbsd
  127. target: ${{ matrix.target }}
  128. tests: ${{ matrix.tests }}
  129. - name: Save Godot build cache
  130. uses: ./.github/actions/godot-cache-save
  131. with:
  132. cache-name: ${{ matrix.cache-name }}
  133. continue-on-error: true
  134. - name: Generate C# glue
  135. if: matrix.build-mono
  136. run: |
  137. ${{ matrix.bin }} --headless --generate-mono-glue ./modules/mono/glue
  138. - name: Build .NET solutions
  139. if: matrix.build-mono
  140. run: |
  141. ./modules/mono/build_scripts/build_assemblies.py --godot-output-dir=./bin --godot-platform=linuxbsd
  142. - name: Prepare artifact
  143. if: matrix.artifact
  144. run: |
  145. strip bin/godot.*
  146. chmod +x bin/godot.*
  147. - name: Upload artifact
  148. uses: ./.github/actions/upload-artifact
  149. if: matrix.artifact
  150. with:
  151. name: ${{ matrix.cache-name }}
  152. - name: Dump Godot API
  153. uses: ./.github/actions/godot-api-dump
  154. if: matrix.api-dump
  155. with:
  156. bin: ${{ matrix.bin }}
  157. - name: Unit tests
  158. if: matrix.tests
  159. run: |
  160. ${{ matrix.bin }} --version
  161. ${{ matrix.bin }} --help
  162. ${{ matrix.bin }} --headless --test --force-colors
  163. - name: .NET source generators tests
  164. if: matrix.build-mono
  165. run: |
  166. dotnet test modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests
  167. # Check class reference
  168. - name: Check for class reference updates
  169. if: matrix.doc-test
  170. run: |
  171. echo "Running --doctool to see if this changes the public API without updating the documentation."
  172. 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"
  173. ${{ matrix.bin }} --doctool --headless 2>&1 > /dev/null || true
  174. git diff --color --exit-code && ! git ls-files --others --exclude-standard | sed -e 's/^/New doc file missing in PR: /' | grep 'xml$'
  175. # Check API backwards compatibility
  176. - name: Check for GDExtension compatibility
  177. if: matrix.api-compat
  178. run: |
  179. ./misc/scripts/validate_extension_api.sh "${{ matrix.bin }}"
  180. # Download and run the test project
  181. - name: Test Godot project
  182. uses: ./.github/actions/godot-project-test
  183. if: matrix.proj-test
  184. with:
  185. bin: ${{ matrix.bin }}
  186. # Test the project converter
  187. - name: Test project converter
  188. uses: ./.github/actions/godot-converter-test
  189. if: matrix.proj-conv
  190. with:
  191. bin: ${{ matrix.bin }}