functions.yml 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  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-12, macos-13]
  28. include:
  29. - os: macos-12
  30. xcode: Xcode_14.2
  31. - os: macos-13
  32. xcode: Xcode_15.1
  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-12]
  54. include:
  55. - os: macos-12
  56. xcode: Xcode_14.2
  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-12, macos-13]
  84. include:
  85. - os: macos-12
  86. xcode: Xcode_14.2
  87. - os: macos-13
  88. xcode: Xcode_15.1
  89. runs-on: ${{ matrix.os }}
  90. steps:
  91. - uses: actions/checkout@v4
  92. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  93. with:
  94. cache_key: spm${{ matrix.os }}-${{ matrix.xcode }}-${{ matrix.target }}
  95. - name: Xcode
  96. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  97. - name: Initialize xcodebuild
  98. run: scripts/setup_spm_tests.sh
  99. - name: Unit Tests
  100. run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseFunctionsUnit ${{ matrix.target }} spm
  101. quickstart:
  102. # Don't run on private repo unless it is a PR.
  103. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  104. env:
  105. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  106. signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  107. LEGACY: true
  108. runs-on: macos-12
  109. steps:
  110. - uses: actions/checkout@v4
  111. - uses: ruby/setup-ruby@v1
  112. - name: Setup quickstart
  113. run: scripts/setup_quickstart.sh functions
  114. - name: install secret googleservice-info.plist
  115. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-functions.plist.gpg \
  116. quickstart-ios/functions/GoogleService-Info.plist "$plist_secret"
  117. - name: Setup custom URL scheme
  118. run: sed -i '' 's/REVERSED_CLIENT_ID/com.googleusercontent.apps.1025801074639-6p6ebi8amuklcjrto20gvpe295smm8u6/' quickstart-ios/functions/LegacyFunctionsQuickstart/FunctionsExample/Info.plist
  119. - name: Test objc quickstart
  120. run: ([ -z $plist_secret ] ||
  121. scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Functions true)
  122. - name: Test swift quickstart
  123. run: ([ -z $plist_secret ] ||
  124. scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Functions true swift)
  125. quickstart-ftl-cron-only:
  126. # Don't run on private repo
  127. if: github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule'
  128. env:
  129. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  130. signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  131. LEGACY: true
  132. runs-on: macos-12
  133. steps:
  134. - uses: actions/checkout@v4
  135. - uses: ruby/setup-ruby@v1
  136. - uses: actions/setup-python@v4
  137. with:
  138. python-version: '3.11'
  139. - name: Setup quickstart
  140. run: scripts/setup_quickstart.sh functions
  141. - name: install secret googleservice-info.plist
  142. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-functions.plist.gpg \
  143. quickstart-ios/functions/GoogleService-Info.plist "$plist_secret"
  144. - name: Setup custom URL scheme
  145. run: sed -i '' 's/REVERSED_CLIENT_ID/com.googleusercontent.apps.1025801074639-6p6ebi8amuklcjrto20gvpe295smm8u6/' quickstart-ios/functions/LegacyFunctionsQuickstart/FunctionsExample/Info.plist
  146. - name: Build objc quickstart
  147. run: ([ -z $plist_secret ] ||
  148. scripts/third_party/travis/retry.sh scripts/test_quickstart_ftl.sh Functions)
  149. - name: Build swift quickstart
  150. run: ([ -z $plist_secret ] ||
  151. scripts/third_party/travis/retry.sh scripts/test_quickstart_ftl.sh Functions swift)
  152. - id: ftl_test
  153. uses: FirebaseExtended/github-actions/firebase-test-lab@v1.4
  154. with:
  155. credentials_json: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CREDENTIALS }}
  156. testapp_dir: quickstart-ios/build-for-testing
  157. test_type: "xctest"
  158. functions-cron-only:
  159. # Don't run on private repo.
  160. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  161. runs-on: macos-12
  162. strategy:
  163. matrix:
  164. target: [ios, tvos, macos]
  165. flags: [
  166. '--use-static-frameworks',
  167. ]
  168. needs: pod-lib-lint
  169. steps:
  170. - uses: actions/checkout@v4
  171. - uses: ruby/setup-ruby@v1
  172. - name: Setup Bundler
  173. run: scripts/setup_bundler.sh
  174. - name: Integration Test Server
  175. run: FirebaseFunctions/Backend/start.sh synchronous
  176. - name: PodLibLint Functions Cron
  177. run: |
  178. scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb \
  179. FirebaseFunctions.podspec --platforms=${{ matrix.target }} --use-static-frameworks