messaging.yml 11 KB

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