messaging.yml 11 KB

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