macos_builds.yml 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. name: 🍎 macOS 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: 4.4
  8. SCONSFLAGS: verbose=yes warnings=extra werror=yes module_text_server_fb_enabled=yes strict_checks=yes
  9. jobs:
  10. build-macos:
  11. runs-on: macos-latest
  12. name: ${{ matrix.name }}
  13. timeout-minutes: 120
  14. strategy:
  15. fail-fast: false
  16. matrix:
  17. include:
  18. - name: Editor (target=editor, tests=yes)
  19. cache-name: macos-editor
  20. target: editor
  21. tests: true
  22. bin: ./bin/godot.macos.editor.universal
  23. cache-limit: 1
  24. - name: Template (target=template_release, tests=yes)
  25. cache-name: macos-template
  26. target: template_release
  27. tests: true
  28. sconsflags: debug_symbols=no
  29. bin: ./bin/godot.macos.template_release.universal
  30. cache-limit: 1
  31. steps:
  32. - name: Checkout
  33. uses: actions/checkout@v4
  34. with:
  35. submodules: recursive
  36. - name: Restore Godot build cache
  37. uses: ./.github/actions/godot-cache-restore
  38. with:
  39. cache-name: ${{ matrix.cache-name }}
  40. continue-on-error: true
  41. - name: Setup Python and SCons
  42. uses: ./.github/actions/godot-deps
  43. - name: Setup Vulkan SDK
  44. run: |
  45. sh misc/scripts/install_vulkan_sdk_macos.sh
  46. - name: Compilation (x86_64)
  47. uses: ./.github/actions/godot-build
  48. with:
  49. sconsflags: ${{ env.SCONSFLAGS }} arch=x86_64
  50. platform: macos
  51. target: ${{ matrix.target }}
  52. tests: ${{ matrix.tests }}
  53. scons-cache-limit: 0 # Only cap on second run to avoid purging unnecessarily
  54. - name: Compilation (arm64)
  55. uses: ./.github/actions/godot-build
  56. with:
  57. sconsflags: ${{ env.SCONSFLAGS }} arch=arm64
  58. platform: macos
  59. target: ${{ matrix.target }}
  60. tests: ${{ matrix.tests }}
  61. scons-cache-limit: ${{ matrix.cache-limit }}
  62. - name: Save Godot build cache
  63. uses: ./.github/actions/godot-cache-save
  64. with:
  65. cache-name: ${{ matrix.cache-name }}
  66. continue-on-error: true
  67. - name: Prepare artifact
  68. run: |
  69. lipo -create ./bin/godot.macos.${{ matrix.target }}.x86_64 ./bin/godot.macos.${{ matrix.target }}.arm64 -output ./bin/godot.macos.${{ matrix.target }}.universal
  70. rm ./bin/godot.macos.${{ matrix.target }}.x86_64 ./bin/godot.macos.${{ matrix.target }}.arm64
  71. strip bin/godot.*
  72. chmod +x bin/godot.*
  73. - name: Upload artifact
  74. uses: ./.github/actions/upload-artifact
  75. with:
  76. name: ${{ matrix.cache-name }}
  77. - name: Unit tests
  78. if: matrix.tests
  79. run: |
  80. ${{ matrix.bin }} --version
  81. ${{ matrix.bin }} --help
  82. ${{ matrix.bin }} --test --force-colors