messaging.yml 10 KB

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