functions.yml 8.0 KB

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