messaging.yml 9.7 KB

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