linux_builds.yml 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. name: 🐧 Linux Builds
  2. on: [push, pull_request]
  3. # Global Settings
  4. env:
  5. # Only used for the cache key. Increment version to force clean build.
  6. GODOT_BASE_BRANCH: master
  7. SCONSFLAGS: verbose=yes warnings=extra werror=yes module_text_server_fb_enabled=yes
  8. DOTNET_NOLOGO: true
  9. DOTNET_CLI_TELEMETRY_OPTOUT: false
  10. concurrency:
  11. group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}-linux
  12. cancel-in-progress: true
  13. jobs:
  14. build-linux:
  15. runs-on: "ubuntu-20.04"
  16. name: ${{ matrix.name }}
  17. strategy:
  18. fail-fast: false
  19. matrix:
  20. include:
  21. - name: Editor w Mono (target=release_debug, tools=yes, tests=yes)
  22. cache-name: linux-editor-mono
  23. target: release_debug
  24. tools: true
  25. tests: false # Disabled due freeze caused by mix Mono build and CI
  26. sconsflags: module_mono_enabled=yes
  27. doc-test: true
  28. bin: "./bin/godot.linuxbsd.opt.tools.x86_64.mono"
  29. build-mono: true
  30. proj-conv: true
  31. artifact: true
  32. - name: Editor with doubles and GCC sanitizers (target=debug, tools=yes, float=64, tests=yes, use_asan=yes, use_ubsan=yes, linker=gold)
  33. cache-name: linux-editor-double-sanitizers
  34. target: debug
  35. tools: true
  36. tests: true
  37. sconsflags: float=64 use_asan=yes use_ubsan=yes linker=gold
  38. proj-test: true
  39. # Can be turned off for PRs that intentionally break compat with godot-cpp,
  40. # until both the upstream PR and the matching godot-cpp changes are merged.
  41. godot-cpp-test: true
  42. bin: "./bin/godot.linuxbsd.double.tools.x86_64.san"
  43. build-mono: false
  44. # Skip 2GiB artifact speeding up action.
  45. artifact: false
  46. - name: Editor with clang sanitizers (target=debug, tools=yes, use_asan=yes, use_ubsan=yes, use_llvm=yes, linker=lld)
  47. cache-name: linux-editor-llvm-sanitizers
  48. target: debug
  49. tools: true
  50. tests: true
  51. sconsflags: use_asan=yes use_ubsan=yes use_llvm=yes linker=lld
  52. bin: "./bin/godot.linuxbsd.tools.x86_64.llvm.san"
  53. build-mono: false
  54. # Skip 2GiB artifact speeding up action.
  55. artifact: false
  56. - name: Template w/ Mono (target=release, tools=no)
  57. cache-name: linux-template-mono
  58. target: release
  59. tools: false
  60. tests: false
  61. sconsflags: module_mono_enabled=yes debug_symbols=no
  62. build-mono: false
  63. artifact: true
  64. - name: Minimal Template (target=release, tools=no, everything disabled)
  65. cache-name: linux-template-minimal
  66. target: release
  67. tools: false
  68. tests: false
  69. sconsflags: modules_enabled_by_default=no disable_3d=yes disable_advanced_gui=yes deprecated=no minizip=no
  70. artifact: true
  71. steps:
  72. - uses: actions/checkout@v3
  73. - name: Linux dependencies
  74. shell: bash
  75. run: |
  76. # Azure repositories are not reliable, we need to prevent azure giving us packages.
  77. sudo rm -f /etc/apt/sources.list.d/*
  78. sudo cp -f misc/ci/sources.list /etc/apt/sources.list
  79. sudo apt-get update
  80. # The actual dependencies
  81. sudo apt-get install build-essential pkg-config libx11-dev libxcursor-dev \
  82. libxinerama-dev libgl1-mesa-dev libglu-dev libasound2-dev libpulse-dev \
  83. libdbus-1-dev libudev-dev libxi-dev libxrandr-dev yasm xvfb wget unzip \
  84. llvm libspeechd-dev speech-dispatcher fontconfig libfontconfig-dev
  85. - name: Setup Godot build cache
  86. uses: ./.github/actions/godot-cache
  87. with:
  88. cache-name: ${{ matrix.cache-name }}
  89. continue-on-error: true
  90. - name: Setup python and scons
  91. uses: ./.github/actions/godot-deps
  92. - name: Set up .NET Sdk
  93. uses: actions/setup-dotnet@v2
  94. if: ${{ matrix.build-mono }}
  95. with:
  96. dotnet-version: '6.0.x'
  97. - name: Compilation
  98. uses: ./.github/actions/godot-build
  99. with:
  100. sconsflags: ${{ env.SCONSFLAGS }} ${{ matrix.sconsflags }}
  101. platform: linuxbsd
  102. target: ${{ matrix.target }}
  103. tools: ${{ matrix.tools }}
  104. tests: ${{ matrix.tests }}
  105. - name: Generate C# glue
  106. if: ${{ matrix.build-mono }}
  107. run: |
  108. ${{ matrix.bin }} --headless --generate-mono-glue ./modules/mono/glue || true
  109. - name: Build .NET solutions
  110. if: ${{ matrix.build-mono }}
  111. run: |
  112. ./modules/mono/build_scripts/build_assemblies.py --godot-output-dir=./bin --godot-platform=linuxbsd
  113. # Execute unit tests for the editor
  114. - name: Unit tests
  115. if: ${{ matrix.tests }}
  116. run: |
  117. ${{ matrix.bin }} --version
  118. ${{ matrix.bin }} --help
  119. ${{ matrix.bin }} --test --headless
  120. # Check class reference
  121. - name: Check for class reference updates
  122. if: ${{ matrix.doc-test }}
  123. run: |
  124. echo "Running --doctool to see if this changes the public API without updating the documentation."
  125. 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"
  126. ${{ matrix.bin }} --doctool --headless 2>&1 > /dev/null || true
  127. git diff --color --exit-code && ! git ls-files --others --exclude-standard | sed -e 's/^/New doc file missing in PR: /' | grep 'xml$'
  128. # Download, unzip and setup SwiftShader library
  129. # See https://github.com/godotengine/regression-test-project/releases/tag/_ci-deps for details
  130. - name: Download SwiftShader
  131. if: ${{ matrix.tests }}
  132. run: |
  133. wget https://github.com/godotengine/regression-test-project/releases/download/_ci-deps/swiftshader-ubuntu20.04-20211002.zip
  134. unzip swiftshader-ubuntu20.04-20211002.zip
  135. curr="$(pwd)/libvk_swiftshader.so"
  136. sed -i "s|PATH_TO_CHANGE|$curr|" vk_swiftshader_icd.json
  137. # Test 3.x -> 4.x project converter
  138. - name: Test project converter
  139. if: ${{ matrix.proj-conv }}
  140. run: |
  141. mkdir converter_test
  142. cd converter_test
  143. touch project.godot
  144. ../${{ matrix.bin }} --headless --audio-driver Dummy --validate-conversion-3to4
  145. cd ..
  146. rm converter_test -rf
  147. # Download and extract zip archive with project, folder is renamed to be able to easy change used project
  148. - name: Download test project
  149. if: ${{ matrix.proj-test }}
  150. run: |
  151. wget https://github.com/godotengine/regression-test-project/archive/4.0.zip
  152. unzip 4.0.zip
  153. mv "regression-test-project-4.0" "test_project"
  154. # Editor is quite complicated piece of software, so it is easy to introduce bug here
  155. - name: Open and close editor (Vulkan)
  156. if: ${{ matrix.proj-test }}
  157. run: |
  158. VK_ICD_FILENAMES=$(pwd)/vk_swiftshader_icd.json DRI_PRIME=0 xvfb-run ${{ matrix.bin }} --audio-driver Dummy --editor --quit --path test_project 2>&1 | tee sanitizers_log.txt || true
  159. misc/scripts/check_ci_log.py sanitizers_log.txt
  160. - name: Open and close editor (GLES3)
  161. if: ${{ matrix.proj-test }}
  162. run: |
  163. DRI_PRIME=0 xvfb-run ${{ matrix.bin }} --audio-driver Dummy --rendering-driver opengl3 --editor --quit --path test_project 2>&1 | tee sanitizers_log.txt || true
  164. misc/scripts/check_ci_log.py sanitizers_log.txt
  165. # Run test project
  166. - name: Run project
  167. if: ${{ matrix.proj-test }}
  168. run: |
  169. VK_ICD_FILENAMES=$(pwd)/vk_swiftshader_icd.json DRI_PRIME=0 xvfb-run ${{ matrix.bin }} 40 --audio-driver Dummy --path test_project 2>&1 | tee sanitizers_log.txt || true
  170. misc/scripts/check_ci_log.py sanitizers_log.txt
  171. # Checkout godot-cpp
  172. - name: Checkout godot-cpp
  173. if: ${{ matrix.godot-cpp-test }}
  174. uses: actions/checkout@v3
  175. with:
  176. repository: godotengine/godot-cpp
  177. submodules: 'recursive'
  178. path: 'godot-cpp'
  179. # Check extension API
  180. - name: Check for extension api updates
  181. if: ${{ matrix.godot-cpp-test }}
  182. run: |
  183. echo "Running --dump-extension-api to create extensions api."
  184. VK_ICD_FILENAMES=$(pwd)/vk_swiftshader_icd.json DRI_PRIME=0 xvfb-run ${{ matrix.bin }} --audio-driver Dummy --dump-extension-api 2>&1 > /dev/null || true
  185. misc/scripts/compare_extension_api.py godot-cpp/godot-headers/extension_api.json extension_api.json
  186. # Copy new extension API files into place
  187. - name: Copy new extension API files into place
  188. if: ${{ matrix.godot-cpp-test }}
  189. run: |
  190. cp -f extension_api.json godot-cpp/godot-headers/
  191. cp -f core/extension/gdnative_interface.h godot-cpp/godot-headers/godot/
  192. # Build godot-cpp test extension
  193. - name: Build godot-cpp test extension
  194. if: ${{ matrix.godot-cpp-test }}
  195. run: |
  196. cd godot-cpp/test
  197. scons target=${{ matrix.target }}
  198. cd ../..
  199. - name: Prepare artifact
  200. if: ${{ matrix.artifact }}
  201. run: |
  202. strip bin/godot.*
  203. chmod +x bin/godot.*
  204. - name: Upload artifact
  205. uses: ./.github/actions/upload-artifact
  206. if: ${{ matrix.artifact }}
  207. with:
  208. name: ${{ matrix.cache-name }}