functions.yml 9.5 KB

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