messaging.yml 12 KB

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