messaging.yml 11 KB

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