messaging.yml 11 KB

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