ci.yml 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. name: Continuous integration
  2. on: [push, pull_request]
  3. env:
  4. # Only used for the cache key. Increment version to force clean build.
  5. GODOT_BASE_BRANCH: 3.x
  6. concurrency:
  7. group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}
  8. cancel-in-progress: true
  9. jobs:
  10. build:
  11. name: ${{ matrix.name }}
  12. runs-on: ${{ matrix.os }}
  13. strategy:
  14. fail-fast: false
  15. matrix:
  16. include:
  17. - name: 🐧 Linux (GCC)
  18. os: ubuntu-22.04
  19. platform: linux
  20. artifact-name: godot-cpp-linux-glibc2.35-x86_64-release
  21. artifact-path: bin/libgodot-cpp.linux.release.64.a
  22. godot_zip: Godot_v3.6-stable_linux_server.64.zip
  23. executable: Godot_v3.6-stable_linux_server.64
  24. cache-name: linux-x86_64
  25. - name: 🏁 Windows (x86_64, MSVC)
  26. os: windows-2022
  27. platform: windows
  28. artifact-name: godot-cpp-windows-msvc2022-x86_64-release
  29. artifact-path: bin/libgodot-cpp.windows.release.64.lib
  30. cache-name: windows-x86_64-msvc
  31. - name: 🏁 Windows (x86_64, MinGW)
  32. os: windows-2022
  33. platform: windows
  34. artifact-name: godot-cpp-linux-mingw-x86_64-release
  35. artifact-path: bin/libgodot-cpp.windows.release.64.a
  36. flags: use_mingw=yes
  37. cache-name: windows-x86_64-mingw
  38. - name: 🍎 macOS (universal)
  39. os: macos-15
  40. platform: osx
  41. artifact-name: godot-cpp-macos-universal-release
  42. artifact-path: bin/libgodot-cpp.osx.release.64.a
  43. flags: macos_arch=universal
  44. godot_zip: Godot_v3.6-stable_osx.universal.zip
  45. executable: Godot.app/Contents/MacOS/Godot
  46. cache-name: macos-unversal
  47. - name: 🤖 Android (arm64)
  48. os: ubuntu-22.04
  49. platform: android
  50. artifact-name: godot-cpp-android-arm64-release
  51. artifact-path: bin/libgodot-cpp.android.release.arm64v8.a
  52. flags: ANDROID_NDK_ROOT=$ANDROID_NDK_LATEST_HOME android_arch=arm64v8
  53. cache-name: android-arm64
  54. - name: 🍏 iOS (arm64)
  55. os: macos-15
  56. platform: ios
  57. artifact-name: godot-cpp-ios-arm64-release
  58. artifact-path: bin/libgodot-cpp.ios.release.arm64.a
  59. cache-name: ios-arm64
  60. env:
  61. SCONS_CACHE: ${{ github.workspace }}/.scons-cache/
  62. steps:
  63. - name: Checkout
  64. uses: actions/checkout@v6
  65. with:
  66. submodules: recursive
  67. - name: Setup Godot build cache
  68. uses: ./.github/actions/godot-cache
  69. with:
  70. cache-name: ${{ matrix.cache-name }}
  71. continue-on-error: true
  72. - name: Set up Python (for SCons)
  73. uses: actions/setup-python@v6
  74. with:
  75. python-version: '3.x'
  76. - name: Linux dependencies
  77. if: ${{ matrix.platform == 'linux' }}
  78. run: |
  79. sudo apt-get update -qq
  80. sudo apt-get install -qqq build-essential pkg-config
  81. - name: Install scons
  82. run: |
  83. python -m pip install scons
  84. - name: Windows dependency (MinGW)
  85. if: ${{ matrix.platform == 'windows' }}
  86. uses: egor-tensin/setup-mingw@v3
  87. with:
  88. version: 12.2.0
  89. - name: Build godot-cpp (debug)
  90. run: |
  91. scons platform=${{ matrix.platform }} target=debug ${{ matrix.flags }}
  92. - name: Build test without rebuilding godot-cpp (debug)
  93. run: |
  94. cd test
  95. scons platform=${{ matrix.platform }} target=debug ${{ matrix.flags }} build_library=no
  96. - name: Build test and godot-cpp (release)
  97. run: |
  98. cd test
  99. scons platform=${{ matrix.platform }} target=release ${{ matrix.flags }}
  100. - name: Run test GDNative library
  101. if: ${{ matrix.platform == 'linux' || matrix.platform == 'osx' }}
  102. run: |
  103. curl -LO https://github.com/godotengine/godot/releases/download/3.6-stable/${{ matrix.godot_zip }}
  104. unzip ${{ matrix.godot_zip }}
  105. ./${{ matrix.executable }} --path test -s script.gd
  106. - name: Upload artifact
  107. uses: actions/upload-artifact@v6
  108. with:
  109. name: ${{ matrix.artifact-name }}
  110. path: ${{ matrix.artifact-path }}
  111. if-no-files-found: error
  112. static-checks:
  113. name: 📊 Static Checks (clang-format)
  114. runs-on: ubuntu-22.04
  115. steps:
  116. - name: Checkout
  117. uses: actions/checkout@v6
  118. with:
  119. submodules: recursive
  120. - name: Make apt sources.list use the default Ubuntu repositories
  121. run: |
  122. sudo rm -f /etc/apt/sources.list.d/*
  123. sudo cp -f misc/ci/sources.list /etc/apt/sources.list
  124. sudo apt-get update
  125. - name: Install dependencies
  126. run: |
  127. sudo apt-get install -qq dos2unix recode clang-format
  128. - name: Style checks via clang-format
  129. run: |
  130. bash ./misc/scripts/clang_format.sh
  131. - name: Bindings generation checks (ensures get_file_list returns all generated files)
  132. run: |
  133. python ./misc/scripts/check_get_file_list.py