messaging.yml 12 KB

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