functions.yml 9.0 KB

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