functions.yml 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  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. target: [iOS, tvOS, macOS, catalyst, watchOS]
  102. os: [macos-14]
  103. xcode: [Xcode_15.2, Xcode_16]
  104. runs-on: ${{ matrix.os }}
  105. steps:
  106. - uses: actions/checkout@v4
  107. - uses: actions/cache/restore@v4
  108. with:
  109. path: .build
  110. key: ${{needs.spm-package-resolved.outputs.cache_key}}
  111. - name: Xcode
  112. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  113. - name: Initialize xcodebuild
  114. run: scripts/setup_spm_tests.sh
  115. - name: Unit Tests
  116. run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseFunctionsUnit ${{ matrix.target }} spm
  117. # TODO: Move to macos-14 and Xcode 15. The legacy quickstart uses material which doesn't build on Xcode 15.
  118. # quickstart:
  119. # # Don't run on private repo unless it is a PR.
  120. # if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  121. # env:
  122. # plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  123. # signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  124. # LEGACY: true
  125. # # TODO: Move to macos-14 and Xcode 15. The legacy quickstart uses material which doesn't build on Xcode 15.
  126. # runs-on: macos-12
  127. # steps:
  128. # - uses: actions/checkout@v4
  129. # - uses: ruby/setup-ruby@v1
  130. # - name: Setup quickstart
  131. # run: scripts/setup_quickstart.sh functions
  132. # - name: install secret googleservice-info.plist
  133. # run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-functions.plist.gpg \
  134. # quickstart-ios/functions/GoogleService-Info.plist "$plist_secret"
  135. # - name: Setup custom URL scheme
  136. # run: sed -i '' 's/REVERSED_CLIENT_ID/com.googleusercontent.apps.1025801074639-6p6ebi8amuklcjrto20gvpe295smm8u6/' quickstart-ios/functions/LegacyFunctionsQuickstart/FunctionsExample/Info.plist
  137. # - name: Test objc quickstart
  138. # run: ([ -z $plist_secret ] ||
  139. # scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Functions true)
  140. # - name: Test swift quickstart
  141. # run: ([ -z $plist_secret ] ||
  142. # scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Functions true swift)
  143. # quickstart-ftl-cron-only:
  144. # # Don't run on private repo
  145. # if: github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule'
  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. # - uses: actions/setup-python@v5
  156. # with:
  157. # python-version: '3.11'
  158. # - name: Setup quickstart
  159. # run: scripts/setup_quickstart.sh functions
  160. # - name: install secret googleservice-info.plist
  161. # run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-functions.plist.gpg \
  162. # quickstart-ios/functions/GoogleService-Info.plist "$plist_secret"
  163. # - name: Setup custom URL scheme
  164. # run: sed -i '' 's/REVERSED_CLIENT_ID/com.googleusercontent.apps.1025801074639-6p6ebi8amuklcjrto20gvpe295smm8u6/' quickstart-ios/functions/LegacyFunctionsQuickstart/FunctionsExample/Info.plist
  165. # - name: Build objc quickstart
  166. # run: ([ -z $plist_secret ] ||
  167. # scripts/third_party/travis/retry.sh scripts/test_quickstart_ftl.sh Functions)
  168. # - name: Build swift quickstart
  169. # run: ([ -z $plist_secret ] ||
  170. # scripts/third_party/travis/retry.sh scripts/test_quickstart_ftl.sh Functions swift)
  171. # - id: ftl_test
  172. # uses: FirebaseExtended/github-actions/firebase-test-lab@v1.4
  173. # with:
  174. # credentials_json: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CREDENTIALS }}
  175. # testapp_dir: quickstart-ios/build-for-testing
  176. # test_type: "xctest"
  177. functions-cron-only:
  178. # Don't run on private repo.
  179. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  180. runs-on: macos-14
  181. strategy:
  182. matrix:
  183. target: [ios, tvos, macos]
  184. flags: [
  185. '--use-static-frameworks',
  186. ]
  187. needs: pod-lib-lint
  188. steps:
  189. - uses: actions/checkout@v4
  190. - uses: ruby/setup-ruby@v1
  191. - name: Setup Bundler
  192. run: scripts/setup_bundler.sh
  193. - name: Integration Test Server
  194. run: FirebaseFunctions/Backend/start.sh synchronous
  195. - name: PodLibLint Functions Cron
  196. run: |
  197. scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb \
  198. FirebaseFunctions.podspec --platforms=${{ matrix.target }} --use-static-frameworks