linux_builds.yml 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. name: 🐧 Linux Builds
  2. on:
  3. workflow_call:
  4. # Global Settings
  5. env:
  6. # Only used for the cache key. Increment version to force clean build.
  7. GODOT_BASE_BRANCH: 3.5
  8. SCONSFLAGS: verbose=yes warnings=all werror=yes
  9. concurrency:
  10. group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}-linux
  11. cancel-in-progress: true
  12. jobs:
  13. build-linux:
  14. # Stay one LTS before latest to increase portability of Linux artifacts.
  15. runs-on: "ubuntu-22.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)
  22. cache-name: linux-editor-mono
  23. target: release_debug
  24. tools: true
  25. sconsflags: module_mono_enabled=yes mono_static=yes mono_glue=no
  26. bin: "./bin/godot.x11.opt.tools.64.mono"
  27. build-mono: true
  28. artifact: true
  29. - name: Editor and sanitizers (target=debug, tools=yes, use_asan=yes, use_ubsan=yes, linker=gold)
  30. cache-name: linux-editor-sanitizers
  31. target: debug
  32. tools: true
  33. sconsflags: use_asan=yes use_ubsan=yes linker=gold
  34. test: true
  35. bin: "./bin/godot.x11.tools.64s"
  36. build-mono: false
  37. # Skip 2GiB artifact speeding up action.
  38. artifact: false
  39. - name: Template w/ Mono (target=release, tools=no)
  40. cache-name: linux-template-mono
  41. target: release
  42. tools: false
  43. sconsflags: module_mono_enabled=yes mono_static=yes mono_glue=no debug_symbols=no
  44. build-mono: false
  45. artifact: true
  46. steps:
  47. - uses: actions/checkout@v4
  48. - name: Linux dependencies
  49. shell: bash
  50. run: |
  51. # Azure repositories are flaky, remove them.
  52. sudo rm -f /etc/apt/sources.list.d/{azure,microsoft}*
  53. sudo apt-get update
  54. # The actual dependencies
  55. sudo apt-get install build-essential pkg-config libx11-dev libxcursor-dev \
  56. libxinerama-dev libgl1-mesa-dev libglu-dev libasound2-dev libpulse-dev \
  57. libdbus-1-dev libudev-dev libxi-dev libxrandr-dev yasm xvfb wget unzip
  58. - name: Setup Godot build cache
  59. uses: ./.github/actions/godot-cache
  60. with:
  61. cache-name: ${{ matrix.cache-name }}
  62. continue-on-error: true
  63. - name: Setup python and scons
  64. uses: ./.github/actions/godot-deps
  65. - name: Setup GCC problem matcher
  66. uses: ammaraskar/gcc-problem-matcher@master
  67. - name: Compilation
  68. uses: ./.github/actions/godot-build
  69. with:
  70. sconsflags: ${{ env.SCONSFLAGS }} ${{ matrix.sconsflags }}
  71. platform: linuxbsd
  72. target: ${{ matrix.target }}
  73. tools: ${{ matrix.tools }}
  74. # Generate mono glue
  75. - name: Generate Mono glue code
  76. if: ${{ matrix.build-mono }}
  77. run: |
  78. DRI_PRIME=0 xvfb-run ${{ matrix.bin }} --generate-mono-glue modules/mono/glue || true
  79. # Rebuild with mono
  80. - name: Compilation (mono_glue=yes)
  81. uses: ./.github/actions/godot-build
  82. if: ${{ matrix.build-mono }}
  83. with:
  84. sconsflags: ${{ env.SCONSFLAGS }} ${{ matrix.sconsflags }} mono_glue=yes
  85. platform: linuxbsd
  86. target: ${{ matrix.target }}
  87. tools: ${{ matrix.tools }}
  88. # Download and extract zip archive with project, folder is renamed to be able to easy change used project
  89. - name: Download test project
  90. if: ${{ matrix.test }}
  91. run: |
  92. wget https://github.com/godotengine/regression-test-project/archive/3.x.zip
  93. unzip 3.x.zip
  94. mv "regression-test-project-3.x" "test_project"
  95. # Editor is quite complicated piece of software, so it is easy to introduce bug here
  96. - name: Open and close editor
  97. if: ${{ matrix.test }}
  98. run: |
  99. DRI_PRIME=0 xvfb-run ${{ matrix.bin }} --audio-driver Dummy -e -q --path test_project 2>&1 | tee sanitizers_log.txt || true
  100. misc/scripts/check_ci_log.py sanitizers_log.txt
  101. # Run test project
  102. - name: Run project
  103. if: ${{ matrix.test }}
  104. run: |
  105. DRI_PRIME=0 xvfb-run ${{ matrix.bin }} 30 --video-driver GLES3 --audio-driver Dummy --path test_project 2>&1 | tee sanitizers_log.txt || true
  106. misc/scripts/check_ci_log.py sanitizers_log.txt
  107. # Check class reference
  108. - name: Check for class reference updates
  109. if: ${{ matrix.test }}
  110. run: |
  111. echo "Running --doctool to see if this changes the public API without updating the documentation."
  112. 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"
  113. DRI_PRIME=0 xvfb-run ${{ matrix.bin }} --doctool . 2>&1 > /dev/null || true
  114. git diff --color --exit-code && ! git ls-files --others --exclude-standard | sed -e 's/^/New doc file missing in PR: /' | grep 'xml$'
  115. - name: Prepare artifact
  116. if: ${{ matrix.artifact }}
  117. run: |
  118. strip bin/godot.*
  119. chmod +x bin/godot.*
  120. - name: Upload artifact
  121. uses: ./.github/actions/upload-artifact
  122. if: ${{ matrix.artifact }}
  123. with:
  124. name: ${{ matrix.cache-name }}