linux_builds.yml 5.2 KB

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