functions.yml 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. name: functions
  2. on:
  3. pull_request:
  4. paths:
  5. - 'FirebaseFunctions**'
  6. - 'FirebaseSharedSwift**'
  7. - '.github/workflows/functions.yml'
  8. - 'FirebaseAuth/Interop/*.h'
  9. - 'FirebaseMessaging/Interop/*.h'
  10. - 'FirebaseTestingSupport/Functions/**'
  11. - 'FirebaseCombineSwift/Sources/Functions/**'
  12. - 'scripts/setup_quickstart.sh'
  13. - 'Gemfile*'
  14. schedule:
  15. # Run every day at 1am (PST) - cron uses UTC times
  16. - cron: '0 9 * * *'
  17. concurrency:
  18. group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
  19. cancel-in-progress: true
  20. jobs:
  21. pod-lib-lint:
  22. # Don't run on private repo unless it is a PR.
  23. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  24. strategy:
  25. matrix:
  26. target: [ios, tvos, macos, watchos]
  27. build-env:
  28. - os: macos-14
  29. xcode: Xcode_15.2
  30. - os: macos-15
  31. xcode: Xcode_16.1
  32. runs-on: ${{ matrix.build-env.os }}
  33. steps:
  34. - uses: actions/checkout@v4
  35. - uses: ruby/setup-ruby@v1
  36. - name: Xcode
  37. run: sudo xcode-select -s /Applications/${{ matrix.build-env.xcode }}.app/Contents/Developer
  38. - name: Setup Bundler
  39. run: scripts/setup_bundler.sh
  40. # The integration tests are flaky on Xcode 15 so only run the unit tests. The integration tests still run with SPM.
  41. # - name: Integration Test Server
  42. # run: FirebaseFunctions/Backend/start.sh synchronous
  43. - name: Build and test
  44. run: |
  45. scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseFunctions.podspec \
  46. --test-specs=unit --platforms=${{ matrix.target }}
  47. spm-package-resolved:
  48. runs-on: macos-14
  49. env:
  50. FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
  51. outputs:
  52. cache_key: ${{ steps.generate_cache_key.outputs.cache_key }}
  53. steps:
  54. - uses: actions/checkout@v4
  55. - name: Generate Swift Package.resolved
  56. id: swift_package_resolve
  57. run: |
  58. swift package resolve
  59. - name: Generate cache key
  60. id: generate_cache_key
  61. run: |
  62. cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}"
  63. echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT"
  64. - uses: actions/cache/save@v4
  65. id: cache
  66. with:
  67. path: .build
  68. key: ${{ steps.generate_cache_key.outputs.cache_key }}
  69. spm-integration:
  70. # Don't run on private repo unless it is a PR.
  71. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  72. needs: [spm-package-resolved]
  73. strategy:
  74. matrix:
  75. os: [macos-14]
  76. xcode: [Xcode_15.4]
  77. runs-on: ${{ matrix.os }}
  78. env:
  79. FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
  80. steps:
  81. - uses: actions/checkout@v4
  82. - uses: actions/cache/restore@v4
  83. with:
  84. path: .build
  85. key: ${{needs.spm-package-resolved.outputs.cache_key}}
  86. - name: Initialize xcodebuild
  87. run: scripts/setup_spm_tests.sh
  88. - name: Integration Test Server
  89. run: FirebaseFunctions/Backend/start.sh synchronous
  90. - name: Xcode
  91. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  92. - name: iOS Swift Integration Tests (including Swift library)
  93. run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseFunctionsIntegration iOS spm
  94. - name: iOS ObjC Integration Tests (using Swift library)
  95. run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseFunctionsObjCIntegration iOS spm
  96. - name: Combine Unit Tests
  97. run: scripts/third_party/travis/retry.sh ./scripts/build.sh FunctionsCombineUnit iOS spm
  98. spm-unit:
  99. # Don't run on private repo.
  100. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  101. needs: [spm-package-resolved]
  102. strategy:
  103. matrix:
  104. include:
  105. - os: macos-13
  106. xcode: Xcode_15.2
  107. target: iOS
  108. - os: macos-14
  109. xcode: Xcode_15.4
  110. target: iOS
  111. - os: macos-15
  112. xcode: Xcode_16.1
  113. target: iOS
  114. - os: macos-15
  115. xcode: Xcode_16.1
  116. target: tvOS
  117. - os: macos-15
  118. xcode: Xcode_16.1
  119. target: macOS
  120. - os: macos-15
  121. xcode: Xcode_16.1
  122. target: watchOS
  123. - os: macos-15
  124. xcode: Xcode_16.1
  125. target: catalyst
  126. - os: macos-15
  127. xcode: Xcode_16.1
  128. target: visionOS
  129. runs-on: ${{ matrix.os }}
  130. steps:
  131. - uses: actions/checkout@v4
  132. - uses: actions/cache/restore@v4
  133. with:
  134. path: .build
  135. key: ${{needs.spm-package-resolved.outputs.cache_key}}
  136. - name: Xcode
  137. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  138. - name: Initialize xcodebuild
  139. run: scripts/setup_spm_tests.sh
  140. - name: Unit Tests
  141. run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseFunctionsUnit ${{ matrix.target }} spm
  142. # TODO: Move to macos-14 and Xcode 15. The legacy quickstart uses material which doesn't build on Xcode 15.
  143. # quickstart:
  144. # # Don't run on private repo unless it is a PR.
  145. # if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  146. # env:
  147. # plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  148. # signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  149. # LEGACY: true
  150. # # TODO: Move to macos-14 and Xcode 15. The legacy quickstart uses material which doesn't build on Xcode 15.
  151. # runs-on: macos-12
  152. # steps:
  153. # - uses: actions/checkout@v4
  154. # - uses: ruby/setup-ruby@v1
  155. # - name: Setup quickstart
  156. # run: scripts/setup_quickstart.sh functions
  157. # - name: install secret googleservice-info.plist
  158. # run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-functions.plist.gpg \
  159. # quickstart-ios/functions/GoogleService-Info.plist "$plist_secret"
  160. # - name: Setup custom URL scheme
  161. # run: sed -i '' 's/REVERSED_CLIENT_ID/com.googleusercontent.apps.1025801074639-6p6ebi8amuklcjrto20gvpe295smm8u6/' quickstart-ios/functions/LegacyFunctionsQuickstart/FunctionsExample/Info.plist
  162. # - name: Test objc quickstart
  163. # run: ([ -z $plist_secret ] ||
  164. # scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Functions true)
  165. # - name: Test swift quickstart
  166. # run: ([ -z $plist_secret ] ||
  167. # scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Functions true swift)
  168. # quickstart-ftl-cron-only:
  169. # # Don't run on private repo
  170. # if: github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule'
  171. # env:
  172. # plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  173. # signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  174. # LEGACY: true
  175. # # TODO: Move to macos-14 and Xcode 15. The legacy quickstart uses material which doesn't build on Xcode 15.
  176. # runs-on: macos-12
  177. # steps:
  178. # - uses: actions/checkout@v4
  179. # - uses: ruby/setup-ruby@v1
  180. # - uses: actions/setup-python@v5
  181. # with:
  182. # python-version: '3.11'
  183. # - name: Setup quickstart
  184. # run: scripts/setup_quickstart.sh functions
  185. # - name: install secret googleservice-info.plist
  186. # run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-functions.plist.gpg \
  187. # quickstart-ios/functions/GoogleService-Info.plist "$plist_secret"
  188. # - name: Setup custom URL scheme
  189. # run: sed -i '' 's/REVERSED_CLIENT_ID/com.googleusercontent.apps.1025801074639-6p6ebi8amuklcjrto20gvpe295smm8u6/' quickstart-ios/functions/LegacyFunctionsQuickstart/FunctionsExample/Info.plist
  190. # - name: Build objc quickstart
  191. # run: ([ -z $plist_secret ] ||
  192. # scripts/third_party/travis/retry.sh scripts/test_quickstart_ftl.sh Functions)
  193. # - name: Build swift quickstart
  194. # run: ([ -z $plist_secret ] ||
  195. # scripts/third_party/travis/retry.sh scripts/test_quickstart_ftl.sh Functions swift)
  196. # - id: ftl_test
  197. # uses: FirebaseExtended/github-actions/firebase-test-lab@v1.4
  198. # with:
  199. # credentials_json: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CREDENTIALS }}
  200. # testapp_dir: quickstart-ios/build-for-testing
  201. # test_type: "xctest"
  202. functions-cron-only:
  203. # Don't run on private repo.
  204. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  205. runs-on: macos-14
  206. strategy:
  207. matrix:
  208. target: [ios, tvos, macos]
  209. flags: [
  210. '--use-static-frameworks',
  211. ]
  212. needs: pod-lib-lint
  213. steps:
  214. - uses: actions/checkout@v4
  215. - uses: ruby/setup-ruby@v1
  216. - name: Setup Bundler
  217. run: scripts/setup_bundler.sh
  218. - name: Integration Test Server
  219. run: FirebaseFunctions/Backend/start.sh synchronous
  220. - name: PodLibLint Functions Cron
  221. run: |
  222. scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb \
  223. FirebaseFunctions.podspec --platforms=${{ matrix.target }} --use-static-frameworks