messaging.yml 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. name: messaging
  2. permissions:
  3. contents: read
  4. on:
  5. workflow_dispatch:
  6. pull_request:
  7. paths:
  8. # Messaging sources
  9. - 'FirebaseMessaging/**'
  10. # Interop headers
  11. - 'Interop/Analytics/Public/*.h'
  12. # Podspec
  13. - 'FirebaseMessaging.podspec'
  14. # This file
  15. - '.github/workflows/messaging.yml'
  16. # Re-usable workflows being used by this file.
  17. - '.github/workflows/common.yml'
  18. - '.github/workflows/common_cocoapods.yml'
  19. - '.github/workflows/common_catalyst.yml'
  20. - '.github/workflows/common_quickstart.yml'
  21. # Rebuild on Ruby infrastructure changes
  22. - 'Gemfile*'
  23. schedule:
  24. # Run every day at 11pm (PDT) / 2am (EDT) - cron uses UTC times
  25. - cron: '0 6 * * *'
  26. concurrency:
  27. group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
  28. cancel-in-progress: true
  29. jobs:
  30. spm:
  31. uses: ./.github/workflows/common.yml
  32. with:
  33. target: MessagingUnit
  34. buildonly_platforms: tvOS, macOS, watchOS, catalyst, visionOS
  35. catalyst:
  36. uses: ./.github/workflows/common_catalyst.yml
  37. with:
  38. product: FirebaseMessaging
  39. target: FirebaseMessaging-Unit-unit
  40. pod_lib_lint:
  41. strategy:
  42. matrix:
  43. product: [FirebaseMessagingInterop, FirebaseMessaging]
  44. uses: ./.github/workflows/common_cocoapods.yml
  45. with:
  46. product: ${{ matrix.product }}
  47. # TODO(#12205) Update the build.sh script for this job from "test" instead of "build"
  48. messaging-integration-tests:
  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. env:
  52. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  53. runs-on: macos-15
  54. steps:
  55. - uses: actions/checkout@v4
  56. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  57. with:
  58. cache_key: integration
  59. - name: Configure test keychain
  60. run: scripts/configure_test_keychain.sh
  61. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  62. - name: Xcode
  63. run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer
  64. - name: Setup Bundler
  65. run: scripts/setup_bundler.sh
  66. - name: Install xcpretty
  67. run: gem install xcpretty
  68. - name: Install Secret GoogleService-Info.plist
  69. run: |
  70. mkdir FirebaseMessaging/Tests/IntegrationTests/Resources
  71. scripts/decrypt_gha_secret.sh scripts/gha-encrypted/messaging-sample-plist.gpg \
  72. FirebaseMessaging/Tests/IntegrationTests/Resources/GoogleService-Info.plist "$plist_secret"
  73. - name: BuildAndTest
  74. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/build.sh Messaging all)
  75. quickstart:
  76. uses: ./.github/workflows/common_quickstart.yml
  77. strategy:
  78. matrix:
  79. quickstart_type: [objc, swift]
  80. with:
  81. product: Messaging
  82. is_legacy: false
  83. quickstart_type: ${{ matrix.quickstart_type }}
  84. setup_command: scripts/setup_quickstart.sh messaging
  85. plist_src_path: scripts/gha-encrypted/qs-messaging.plist.gpg
  86. plist_dst_path: quickstart-ios/messaging/GoogleService-Info.plist
  87. run_tests: false
  88. secrets:
  89. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  90. quickstart-ftl-cron-only:
  91. # Don't run on private repo.
  92. if: github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule'
  93. env:
  94. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  95. runs-on: macos-15
  96. steps:
  97. - uses: actions/checkout@v4
  98. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  99. - uses: actions/setup-python@v5
  100. with:
  101. python-version: '3.11'
  102. - name: Xcode
  103. run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer
  104. - name: Setup quickstart
  105. run: scripts/setup_quickstart.sh messaging
  106. - name: Install Secret GoogleService-Info.plist
  107. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-messaging.plist.gpg \
  108. quickstart-ios/messaging/GoogleService-Info.plist "$plist_secret"
  109. - name: Build objc quickstart
  110. run: ([ -z $plist_secret ] ||
  111. scripts/third_party/travis/retry.sh scripts/test_quickstart_ftl.sh Messaging)
  112. - name: Build swift quickstart
  113. run: ([ -z $plist_secret ] ||
  114. scripts/third_party/travis/retry.sh scripts/test_quickstart_ftl.sh Messaging swift)
  115. - id: ftl_test
  116. uses: FirebaseExtended/github-actions/firebase-test-lab@v1.4
  117. with:
  118. credentials_json: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CREDENTIALS }}
  119. testapp_dir: quickstart-ios/build-for-testing
  120. test_type: "xctest"
  121. messaging-cron-only:
  122. # Don't run on private repo.
  123. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  124. strategy:
  125. matrix:
  126. target: [ios, tvos, macos --skip-tests, watchos --skip-tests]
  127. os: [macos-14, macos-15]
  128. include:
  129. - os: macos-15
  130. xcode: Xcode_16.4
  131. tests: --test-specs=unit
  132. - os: macos-14
  133. xcode: Xcode_16.2
  134. tests: --skip-tests
  135. runs-on: ${{ matrix.os }}
  136. steps:
  137. - uses: actions/checkout@v4
  138. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  139. - name: Setup Bundler
  140. run: scripts/setup_bundler.sh
  141. - name: Xcode
  142. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  143. - name: PodLibLint Messaging Cron
  144. run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseMessaging.podspec ${{ matrix.tests }} --platforms=${{ matrix.target }} --use-static-frameworks
  145. messaging-sample-build-test:
  146. # Don't run on private repo unless it is a PR.
  147. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  148. env:
  149. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  150. runs-on: macos-15
  151. steps:
  152. - uses: actions/checkout@v4
  153. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  154. with:
  155. cache_key: sample${{ matrix.os }}
  156. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  157. - name: Xcode
  158. run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer
  159. - name: Setup Bundler
  160. run: scripts/setup_bundler.sh
  161. - name: Install Secret GoogleService-Info.plist
  162. run: |
  163. scripts/decrypt_gha_secret.sh scripts/gha-encrypted/messaging-sample-plist.gpg \
  164. FirebaseMessaging/Apps/Shared/GoogleService-Info.plist "$plist_secret"
  165. - name: Prereqs
  166. run: scripts/install_prereqs.sh MessagingSample iOS
  167. - name: Build
  168. run: ([ -z $plist_secret ] || scripts/build.sh MessagingSample iOS)
  169. messaging-swiftui-sample-build-test:
  170. # Don't run on private repo unless it is a PR.
  171. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  172. env:
  173. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  174. runs-on: macos-15
  175. steps:
  176. - uses: actions/checkout@v4
  177. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  178. with:
  179. cache_key: sample${{ matrix.os }}
  180. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  181. - name: Setup Bundler
  182. run: scripts/setup_bundler.sh
  183. - name: Install Secret GoogleService-Info.plist
  184. run: |
  185. scripts/decrypt_gha_secret.sh scripts/gha-encrypted/messaging-sample-plist.gpg \
  186. FirebaseMessaging/Apps/Shared/GoogleService-Info.plist "$plist_secret"
  187. - name: Prereqs
  188. run: scripts/install_prereqs.sh SwiftUISample iOS
  189. - name: Xcode
  190. run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer
  191. - name: Build
  192. run: ([ -z $plist_secret ] || scripts/build.sh SwiftUISample iOS)
  193. messaging-watchos-standalone-sample-build-test:
  194. # Don't run on private repo unless it is a PR.
  195. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  196. env:
  197. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  198. runs-on: macos-15
  199. steps:
  200. - uses: actions/checkout@v4
  201. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  202. with:
  203. cache_key: watch-sample${{ matrix.os }}
  204. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  205. - name: Setup Bundler
  206. run: scripts/setup_bundler.sh
  207. - name: Install Secret GoogleService-Info.plist
  208. run: |
  209. scripts/decrypt_gha_secret.sh scripts/gha-encrypted/messaging-sample-plist.gpg \
  210. FirebaseMessaging/Apps/Shared/GoogleService-Info.plist "$plist_secret"
  211. - name: Prereqs
  212. run: scripts/install_prereqs.sh MessagingSampleStandaloneWatchApp watchOS
  213. - name: Xcode
  214. run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer
  215. - name: Build
  216. run: ([ -z $plist_secret ] || scripts/build.sh MessagingSampleStandaloneWatchApp watchOS)
  217. - name: Upload xcodebuild logs
  218. if: failure()
  219. uses: actions/upload-artifact@v4
  220. with:
  221. name: xcodebuild-logs-${{ matrix.target }}
  222. path: xcodebuild-*.log