messaging.yml 8.4 KB

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