messaging.yml 11 KB

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