messaging.yml 11 KB

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