functions.yml 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  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. quickstart:
  105. # Don't run on private repo unless it is a PR.
  106. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  107. env:
  108. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  109. signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  110. LEGACY: true
  111. # TODO: Move to macos-14 and Xcode 15. The legacy quickstart uses material which doesn't build on Xcode 15.
  112. runs-on: macos-12
  113. steps:
  114. - uses: actions/checkout@v4
  115. - uses: ruby/setup-ruby@v1
  116. - name: Setup quickstart
  117. run: scripts/setup_quickstart.sh functions
  118. - name: install secret googleservice-info.plist
  119. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-functions.plist.gpg \
  120. quickstart-ios/functions/GoogleService-Info.plist "$plist_secret"
  121. - name: Setup custom URL scheme
  122. run: sed -i '' 's/REVERSED_CLIENT_ID/com.googleusercontent.apps.1025801074639-6p6ebi8amuklcjrto20gvpe295smm8u6/' quickstart-ios/functions/LegacyFunctionsQuickstart/FunctionsExample/Info.plist
  123. - name: Test objc quickstart
  124. run: ([ -z $plist_secret ] ||
  125. scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Functions true)
  126. - name: Test swift quickstart
  127. run: ([ -z $plist_secret ] ||
  128. scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Functions true swift)
  129. quickstart-ftl-cron-only:
  130. # Don't run on private repo
  131. if: github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule'
  132. env:
  133. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  134. signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  135. LEGACY: true
  136. # TODO: Move to macos-14 and Xcode 15. The legacy quickstart uses material which doesn't build on Xcode 15.
  137. runs-on: macos-12
  138. steps:
  139. - uses: actions/checkout@v4
  140. - uses: ruby/setup-ruby@v1
  141. - uses: actions/setup-python@v4
  142. with:
  143. python-version: '3.11'
  144. - name: Setup quickstart
  145. run: scripts/setup_quickstart.sh functions
  146. - name: install secret googleservice-info.plist
  147. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-functions.plist.gpg \
  148. quickstart-ios/functions/GoogleService-Info.plist "$plist_secret"
  149. - name: Setup custom URL scheme
  150. run: sed -i '' 's/REVERSED_CLIENT_ID/com.googleusercontent.apps.1025801074639-6p6ebi8amuklcjrto20gvpe295smm8u6/' quickstart-ios/functions/LegacyFunctionsQuickstart/FunctionsExample/Info.plist
  151. - name: Build objc quickstart
  152. run: ([ -z $plist_secret ] ||
  153. scripts/third_party/travis/retry.sh scripts/test_quickstart_ftl.sh Functions)
  154. - name: Build swift quickstart
  155. run: ([ -z $plist_secret ] ||
  156. scripts/third_party/travis/retry.sh scripts/test_quickstart_ftl.sh Functions swift)
  157. - id: ftl_test
  158. uses: FirebaseExtended/github-actions/firebase-test-lab@v1.4
  159. with:
  160. credentials_json: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CREDENTIALS }}
  161. testapp_dir: quickstart-ios/build-for-testing
  162. test_type: "xctest"
  163. functions-cron-only:
  164. # Don't run on private repo.
  165. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  166. runs-on: macos-14
  167. strategy:
  168. matrix:
  169. target: [ios, tvos, macos]
  170. flags: [
  171. '--use-static-frameworks',
  172. ]
  173. needs: pod-lib-lint
  174. steps:
  175. - uses: actions/checkout@v4
  176. - uses: ruby/setup-ruby@v1
  177. - name: Setup Bundler
  178. run: scripts/setup_bundler.sh
  179. - name: Integration Test Server
  180. run: FirebaseFunctions/Backend/start.sh synchronous
  181. - name: PodLibLint Functions Cron
  182. run: |
  183. scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb \
  184. FirebaseFunctions.podspec --platforms=${{ matrix.target }} --use-static-frameworks