messaging.yml 12 KB

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