messaging.yml 11 KB

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