messaging.yml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  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. # TODO(#12205) Update the build.sh script for this job from "test" instead of "build"
  24. messaging-integration-tests:
  25. # Don't run on private repo unless it is a PR.
  26. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  27. env:
  28. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  29. runs-on: macos-15
  30. steps:
  31. - uses: actions/checkout@v4
  32. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  33. with:
  34. cache_key: integration
  35. - name: Configure test keychain
  36. run: scripts/configure_test_keychain.sh
  37. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  38. - name: Xcode
  39. run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
  40. - name: Setup Bundler
  41. run: scripts/setup_bundler.sh
  42. - name: Install xcpretty
  43. run: gem install xcpretty
  44. - name: Install Secret GoogleService-Info.plist
  45. run: |
  46. mkdir FirebaseMessaging/Tests/IntegrationTests/Resources
  47. scripts/decrypt_gha_secret.sh scripts/gha-encrypted/messaging-sample-plist.gpg \
  48. FirebaseMessaging/Tests/IntegrationTests/Resources/GoogleService-Info.plist "$plist_secret"
  49. - name: BuildAndTest
  50. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/build.sh Messaging all)
  51. pod-lib-lint:
  52. # Don't run on private repo unless it is a PR.
  53. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  54. strategy:
  55. matrix:
  56. podspec: [FirebaseMessagingInterop.podspec, FirebaseMessaging.podspec]
  57. target: [ios, tvos, macos --skip-tests, watchos --skip-tests] # skipping tests on mac because of keychain access
  58. build-env:
  59. - os: macos-14
  60. xcode: Xcode_16.2
  61. tests: --test-specs=unit
  62. - os: macos-15
  63. xcode: Xcode_16.2
  64. tests: --skip-tests
  65. runs-on: ${{ matrix.build-env.os }}
  66. steps:
  67. - uses: actions/checkout@v4
  68. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  69. - name: Setup Bundler
  70. run: scripts/setup_bundler.sh
  71. - name: Xcode
  72. run: sudo xcode-select -s /Applications/${{ matrix.build-env.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.build-env.tests }} --platforms=${{ matrix.target }}
  75. spm-package-resolved:
  76. env:
  77. FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
  78. runs-on: macos-14
  79. outputs:
  80. cache_key: ${{ steps.generate_cache_key.outputs.cache_key }}
  81. steps:
  82. - uses: actions/checkout@v4
  83. - name: Xcode
  84. run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
  85. - name: Generate Swift Package.resolved
  86. id: swift_package_resolve
  87. run: |
  88. swift package resolve
  89. - name: Generate cache key
  90. id: generate_cache_key
  91. run: |
  92. cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}"
  93. echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT"
  94. - uses: actions/cache/save@v4
  95. id: cache
  96. with:
  97. path: .build
  98. key: ${{ steps.generate_cache_key.outputs.cache_key }}
  99. spm:
  100. # Don't run on private repo unless it is a PR.
  101. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  102. needs: [spm-package-resolved]
  103. strategy:
  104. matrix:
  105. include:
  106. - os: macos-14
  107. xcode: Xcode_16.2
  108. target: iOS spmbuildonly
  109. - os: macos-15
  110. xcode: Xcode_16.2
  111. target: iOS spm
  112. - os: macos-15
  113. xcode: Xcode_16.2
  114. target: tvOS spmbuildonly
  115. - os: macos-15
  116. xcode: Xcode_16.2
  117. target: macOS spmbuildonly
  118. - os: macos-15
  119. xcode: Xcode_16.2
  120. target: watchOS spmbuildonly
  121. - os: macos-15
  122. xcode: Xcode_16.2
  123. target: catalyst spmbuildonly
  124. - os: macos-15
  125. xcode: Xcode_16.2
  126. target: visionOS spmbuildonly
  127. runs-on: ${{ matrix.os }}
  128. steps:
  129. - uses: actions/checkout@v4
  130. - uses: actions/cache/restore@v4
  131. with:
  132. path: .build
  133. key: ${{needs.spm-package-resolved.outputs.cache_key}}
  134. - name: Initialize xcodebuild
  135. run: scripts/setup_spm_tests.sh
  136. - name: Xcode
  137. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  138. - name: Unit Tests
  139. run: scripts/third_party/travis/retry.sh ./scripts/build.sh MessagingUnit ${{ matrix.target }}
  140. catalyst:
  141. # Don't run on private repo unless it is a PR.
  142. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  143. runs-on: macos-15
  144. steps:
  145. - uses: actions/checkout@v4
  146. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  147. with:
  148. cache_key: catalyst${{ matrix.os }}
  149. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  150. - name: Setup Bundler
  151. run: scripts/setup_bundler.sh
  152. - name: Xcode
  153. run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
  154. - name: Setup project and Build Catalyst
  155. run: scripts/test_catalyst.sh FirebaseMessaging test FirebaseMessaging-Unit-unit
  156. quickstart:
  157. # Don't run on private repo unless it is a PR.
  158. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  159. env:
  160. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  161. signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  162. strategy:
  163. matrix:
  164. include:
  165. - os: macos-15
  166. xcode: Xcode_16.2
  167. runs-on: ${{ matrix.os }}
  168. steps:
  169. - uses: actions/checkout@v4
  170. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  171. - name: Setup quickstart
  172. run: scripts/setup_quickstart.sh messaging
  173. - name: Install Secret GoogleService-Info.plist
  174. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-messaging.plist.gpg \
  175. quickstart-ios/messaging/GoogleService-Info.plist "$plist_secret"
  176. - name: Xcode
  177. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  178. - name: Test objc quickstart
  179. run: ([ -z $plist_secret ] ||
  180. scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Messaging false)
  181. - name: Test swift quickstart
  182. run: ([ -z $plist_secret ] ||
  183. scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Messaging false swift)
  184. quickstart-ftl-cron-only:
  185. # Don't run on private repo.
  186. if: github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule'
  187. env:
  188. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  189. signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  190. runs-on: macos-15
  191. steps:
  192. - uses: actions/checkout@v4
  193. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  194. - uses: actions/setup-python@v5
  195. with:
  196. python-version: '3.11'
  197. - name: Xcode
  198. run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
  199. - name: Setup quickstart
  200. run: scripts/setup_quickstart.sh messaging
  201. - name: Install Secret GoogleService-Info.plist
  202. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-messaging.plist.gpg \
  203. quickstart-ios/messaging/GoogleService-Info.plist "$plist_secret"
  204. - name: Build objc quickstart
  205. run: ([ -z $plist_secret ] ||
  206. scripts/third_party/travis/retry.sh scripts/test_quickstart_ftl.sh Messaging)
  207. - name: Build swift quickstart
  208. run: ([ -z $plist_secret ] ||
  209. scripts/third_party/travis/retry.sh scripts/test_quickstart_ftl.sh Messaging swift)
  210. - id: ftl_test
  211. uses: FirebaseExtended/github-actions/firebase-test-lab@v1.4
  212. with:
  213. credentials_json: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CREDENTIALS }}
  214. testapp_dir: quickstart-ios/build-for-testing
  215. test_type: "xctest"
  216. messaging-cron-only:
  217. # Don't run on private repo.
  218. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  219. strategy:
  220. matrix:
  221. target: [ios, tvos, macos --skip-tests, watchos --skip-tests]
  222. os: [macos-14, macos-15]
  223. include:
  224. - os: macos-15
  225. xcode: Xcode_16.2
  226. tests: --test-specs=unit
  227. - os: macos-14
  228. xcode: Xcode_16.2
  229. tests: --skip-tests
  230. runs-on: ${{ matrix.os }}
  231. steps:
  232. - uses: actions/checkout@v4
  233. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  234. - name: Setup Bundler
  235. run: scripts/setup_bundler.sh
  236. - name: Xcode
  237. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  238. - name: PodLibLint Messaging Cron
  239. run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseMessaging.podspec ${{ matrix.tests }} --platforms=${{ matrix.target }} --use-static-frameworks
  240. messaging-sample-build-test:
  241. # Don't run on private repo unless it is a PR.
  242. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  243. env:
  244. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  245. runs-on: macos-15
  246. steps:
  247. - uses: actions/checkout@v4
  248. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  249. with:
  250. cache_key: sample${{ matrix.os }}
  251. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  252. - name: Setup Bundler
  253. run: scripts/setup_bundler.sh
  254. - name: Install Secret GoogleService-Info.plist
  255. run: |
  256. scripts/decrypt_gha_secret.sh scripts/gha-encrypted/messaging-sample-plist.gpg \
  257. FirebaseMessaging/Apps/Shared/GoogleService-Info.plist "$plist_secret"
  258. - name: Prereqs
  259. run: scripts/install_prereqs.sh MessagingSample iOS
  260. - name: Xcode
  261. run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
  262. - name: Build
  263. run: ([ -z $plist_secret ] || scripts/build.sh MessagingSample iOS)
  264. messaging-swiftui-sample-build-test:
  265. # Don't run on private repo unless it is a PR.
  266. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  267. env:
  268. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  269. runs-on: macos-15
  270. steps:
  271. - uses: actions/checkout@v4
  272. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  273. with:
  274. cache_key: sample${{ matrix.os }}
  275. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  276. - name: Setup Bundler
  277. run: scripts/setup_bundler.sh
  278. - name: Install Secret GoogleService-Info.plist
  279. run: |
  280. scripts/decrypt_gha_secret.sh scripts/gha-encrypted/messaging-sample-plist.gpg \
  281. FirebaseMessaging/Apps/Shared/GoogleService-Info.plist "$plist_secret"
  282. - name: Prereqs
  283. run: scripts/install_prereqs.sh SwiftUISample iOS
  284. - name: Xcode
  285. run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
  286. - name: Build
  287. run: ([ -z $plist_secret ] || scripts/build.sh SwiftUISample iOS)
  288. messaging-watchos-standalone-sample-build-test:
  289. # Don't run on private repo unless it is a PR.
  290. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  291. env:
  292. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  293. runs-on: macos-15
  294. steps:
  295. - uses: actions/checkout@v4
  296. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  297. with:
  298. cache_key: watch-sample${{ matrix.os }}
  299. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  300. - name: Setup Bundler
  301. run: scripts/setup_bundler.sh
  302. - name: Install Secret GoogleService-Info.plist
  303. run: |
  304. scripts/decrypt_gha_secret.sh scripts/gha-encrypted/messaging-sample-plist.gpg \
  305. FirebaseMessaging/Apps/Shared/GoogleService-Info.plist "$plist_secret"
  306. - name: Prereqs
  307. run: scripts/install_prereqs.sh MessagingSampleStandaloneWatchApp watchOS
  308. - name: Xcode
  309. run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
  310. - name: Build
  311. run: ([ -z $plist_secret ] || scripts/build.sh MessagingSampleStandaloneWatchApp watchOS)