ci.yml 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  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: master
  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-18.04
  19. platform: linux
  20. artifact-name: godot-cpp-linux-glibc2.27-x86_64-release
  21. artifact-path: bin/libgodot-cpp.linux.template_release.x86_64.a
  22. cache-name: linux-x86_64
  23. - name: 🐧 Linux (GCC, Double Precision)
  24. os: ubuntu-18.04
  25. platform: linux
  26. artifact-name: godot-cpp-linux-glibc2.27-x86_64-double-release
  27. artifact-path: bin/libgodot-cpp.linux.template_release.double.x86_64.a
  28. flags: float=64
  29. cache-name: linux-x86_64-f64
  30. - name: 🏁 Windows (x86_64, MSVC)
  31. os: windows-2019
  32. platform: windows
  33. artifact-name: godot-cpp-windows-msvc2019-x86_64-release
  34. artifact-path: bin/libgodot-cpp.windows.template_release.x86_64.lib
  35. cache-name: windows-x86_64-msvc
  36. - name: 🏁 Windows (x86_64, MinGW)
  37. os: windows-2019
  38. platform: windows
  39. artifact-name: godot-cpp-linux-mingw-x86_64-release
  40. artifact-path: bin/libgodot-cpp.windows.template_release.x86_64.a
  41. flags: use_mingw=yes
  42. cache-name: windows-x86_64-mingw
  43. - name: 🍎 macOS (universal)
  44. os: macos-11
  45. platform: macos
  46. artifact-name: godot-cpp-macos-universal-release
  47. artifact-path: bin/libgodot-cpp.macos.template_release.universal.a
  48. flags: arch=universal
  49. cache-name: macos-universal
  50. - name: 🤖 Android (arm64)
  51. os: ubuntu-18.04
  52. platform: android
  53. artifact-name: godot-cpp-android-arm64-release
  54. artifact-path: bin/libgodot-cpp.android.template_release.arm64.a
  55. flags: ANDROID_NDK_ROOT=$ANDROID_NDK_LATEST_HOME arch=arm64
  56. cache-name: android-arm64
  57. - name: 🍏 iOS (arm64)
  58. os: macos-11
  59. platform: ios
  60. artifact-name: godot-cpp-ios-arm64-release
  61. artifact-path: bin/libgodot-cpp.ios.template_release.arm64.a
  62. flags: arch=arm64
  63. cache-name: ios-arm64
  64. env:
  65. SCONS_CACHE: ${{ github.workspace }}/.scons-cache/
  66. steps:
  67. - name: Checkout
  68. uses: actions/checkout@v3
  69. with:
  70. submodules: recursive
  71. - name: Setup Godot build cache
  72. uses: ./.github/actions/godot-cache
  73. with:
  74. cache-name: ${{ matrix.cache-name }}
  75. continue-on-error: true
  76. - name: Set up Python (for SCons)
  77. uses: actions/setup-python@v4
  78. with:
  79. python-version: '3.x'
  80. - name: Linux dependencies
  81. if: ${{ matrix.platform == 'linux' }}
  82. run: |
  83. sudo apt-get update -qq
  84. sudo apt-get install -qqq build-essential pkg-config
  85. - name: Install scons
  86. run: |
  87. python -m pip install scons==4.0.0
  88. - name: Setup MinGW for Windows/MinGW build
  89. if: ${{ matrix.platform == 'windows' && matrix.flags == 'use_mingw=yes' }}
  90. uses: egor-tensin/setup-mingw@v2
  91. - name: Build godot-cpp (debug)
  92. run: |
  93. scons platform=${{ matrix.platform }} target=template_debug ${{ matrix.flags }}
  94. - name: Build test without rebuilding godot-cpp (debug)
  95. run: |
  96. cd test
  97. scons platform=${{ matrix.platform }} target=template_debug ${{ matrix.flags }} build_library=no
  98. - name: Build test and godot-cpp (release)
  99. run: |
  100. cd test
  101. scons platform=${{ matrix.platform }} target=template_release ${{ matrix.flags }}
  102. - name: Upload artifact
  103. uses: actions/upload-artifact@v3
  104. with:
  105. name: ${{ matrix.artifact-name }}
  106. path: ${{ matrix.artifact-path }}
  107. if-no-files-found: error
  108. linux-cmake:
  109. name: 🐧 Build (Linux, GCC, CMake)
  110. runs-on: ubuntu-18.04
  111. steps:
  112. - name: Checkout
  113. uses: actions/checkout@v3
  114. with:
  115. submodules: recursive
  116. - name: Install dependencies
  117. run: |
  118. sudo apt-get update -qq
  119. sudo apt-get install -qqq build-essential pkg-config cmake
  120. - name: Build godot-cpp
  121. run: |
  122. cmake -DCMAKE_BUILD_TYPE=Release .
  123. make -j $(nproc) VERBOSE=1
  124. - name: Build test GDExtension library
  125. run: |
  126. cd test && cmake -DCMAKE_BUILD_TYPE=Release -DGODOT_HEADERS_PATH="../godot-headers" -DCPP_BINDINGS_PATH=".." .
  127. make -j $(nproc) VERBOSE=1
  128. linux-cmake-ninja:
  129. name: 🐧 Build (Linux, GCC, CMake Ninja)
  130. runs-on: ubuntu-18.04
  131. steps:
  132. - name: Checkout
  133. uses: actions/checkout@v3
  134. with:
  135. submodules: recursive
  136. - name: Install dependencies
  137. run: |
  138. sudo apt-get update -qq
  139. sudo apt-get install -qqq build-essential pkg-config cmake ninja-build
  140. - name: Build godot-cpp
  141. run: |
  142. cmake -DCMAKE_BUILD_TYPE=Release -GNinja .
  143. cmake --build . -j $(nproc) --verbose
  144. - name: Build test GDExtension library
  145. run: |
  146. cd test && cmake -DCMAKE_BUILD_TYPE=Release -DGODOT_HEADERS_PATH="../godot-headers" -DCPP_BINDINGS_PATH=".." -GNinja .
  147. cmake --build . -j $(nproc) --verbose
  148. windows-msvc-cmake:
  149. name: 🏁 Build (Windows, MSVC, CMake)
  150. runs-on: windows-2019
  151. steps:
  152. - name: Checkout
  153. uses: actions/checkout@v3
  154. with:
  155. submodules: recursive
  156. - name: Build godot-cpp
  157. run: |
  158. cmake -DCMAKE_BUILD_TYPE=Release -G"Visual Studio 16 2019" .
  159. cmake --build . --verbose
  160. - name: Build test GDExtension library
  161. run: |
  162. cd test && cmake -DCMAKE_BUILD_TYPE=Release -DGODOT_HEADERS_PATH="../godot-headers" -DCPP_BINDINGS_PATH=".." -G"Visual Studio 16 2019" .
  163. cmake --build . --verbose