messaging.yml 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  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:
  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. runs-on: macos-12
  28. steps:
  29. - uses: actions/checkout@v3
  30. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  31. with:
  32. cache_key: ${{ matrix.os }}
  33. - name: Configure test keychain
  34. run: scripts/configure_test_keychain.sh
  35. - uses: ruby/setup-ruby@v1
  36. - name: Setup Bundler
  37. run: scripts/setup_bundler.sh
  38. - name: Install xcpretty
  39. run: gem install xcpretty
  40. - name: Install Secret GoogleService-Info.plist
  41. run: |
  42. mkdir FirebaseMessaging/Tests/IntegrationTests/Resources
  43. scripts/decrypt_gha_secret.sh scripts/gha-encrypted/messaging-sample-plist.gpg \
  44. FirebaseMessaging/Tests/IntegrationTests/Resources/GoogleService-Info.plist "$plist_secret"
  45. - name: BuildAndTest # can be replaced with pod lib lint with CocoaPods 1.10
  46. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/build.sh Messaging all)
  47. pod-lib-lint:
  48. # Don't run on private repo unless it is a PR.
  49. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  50. runs-on: macos-12
  51. strategy:
  52. matrix:
  53. target: [ios, tvos, macos --skip-tests] # skipping tests on mac because of keychain access
  54. steps:
  55. - uses: actions/checkout@v3
  56. - uses: ruby/setup-ruby@v1
  57. - name: Setup Bundler
  58. run: scripts/setup_bundler.sh
  59. - name: Build and test
  60. run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseMessaging.podspec --platforms=${{ matrix.target }}
  61. spm:
  62. # Don't run on private repo unless it is a PR.
  63. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  64. runs-on: macos-12
  65. strategy:
  66. matrix:
  67. target: [iOS, watchOS]
  68. steps:
  69. - uses: actions/checkout@v3
  70. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  71. with:
  72. cache_key: ${{ matrix.os }}
  73. - name: Initialize xcodebuild
  74. run: scripts/setup_spm_tests.sh
  75. - name: Unit Tests
  76. run: scripts/third_party/travis/retry.sh ./scripts/build.sh MessagingUnit ${{ matrix.target }} spm
  77. spm-cron:
  78. # Don't run on private repo.
  79. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  80. runs-on: macos-12
  81. strategy:
  82. matrix:
  83. target: [tvOS, macOS, catalyst]
  84. steps:
  85. - uses: actions/checkout@v3
  86. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  87. with:
  88. cache_key: ${{ matrix.os }}
  89. - name: Initialize xcodebuild
  90. run: scripts/setup_spm_tests.sh
  91. - name: Unit Tests
  92. run: scripts/third_party/travis/retry.sh ./scripts/build.sh MessagingUnit ${{ matrix.target }} spm
  93. catalyst:
  94. # Don't run on private repo unless it is a PR.
  95. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  96. runs-on: macos-12
  97. steps:
  98. - uses: actions/checkout@v3
  99. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  100. with:
  101. cache_key: ${{ matrix.os }}
  102. - uses: ruby/setup-ruby@v1
  103. - name: Setup Bundler
  104. run: scripts/setup_bundler.sh
  105. - name: Setup project and Build Catalyst
  106. run: scripts/test_catalyst.sh FirebaseMessaging test FirebaseMessaging-Unit-unit
  107. quickstart:
  108. # Don't run on private repo unless it is a PR.
  109. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  110. env:
  111. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  112. signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  113. runs-on: macos-12
  114. steps:
  115. - uses: actions/checkout@v3
  116. - uses: ruby/setup-ruby@v1
  117. - name: Setup quickstart
  118. run: scripts/setup_quickstart.sh messaging
  119. - name: Install Secret GoogleService-Info.plist
  120. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-messaging.plist.gpg \
  121. quickstart-ios/messaging/GoogleService-Info.plist "$plist_secret"
  122. - name: Test objc quickstart
  123. run: ([ -z $plist_secret ] ||
  124. scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Messaging false)
  125. - name: Test swift quickstart
  126. run: ([ -z $plist_secret ] ||
  127. scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Messaging false swift)
  128. quickstart-ftl-cron-only:
  129. # Don't run on private repo.
  130. if: github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule'
  131. env:
  132. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  133. signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  134. runs-on: macos-12
  135. steps:
  136. - uses: actions/checkout@v3
  137. - uses: ruby/setup-ruby@v1
  138. - name: Setup quickstart
  139. run: scripts/setup_quickstart.sh messaging
  140. - name: Install Secret GoogleService-Info.plist
  141. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-messaging.plist.gpg \
  142. quickstart-ios/messaging/GoogleService-Info.plist "$plist_secret"
  143. - name: Build objc quickstart
  144. run: ([ -z $plist_secret ] ||
  145. scripts/third_party/travis/retry.sh scripts/test_quickstart_ftl.sh Messaging)
  146. - name: Build swift quickstart
  147. run: ([ -z $plist_secret ] ||
  148. scripts/third_party/travis/retry.sh scripts/test_quickstart_ftl.sh Messaging swift)
  149. - id: ftl_test
  150. uses: FirebaseExtended/github-actions/firebase-test-lab@v1.2
  151. with:
  152. credentials_json: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CREDENTIALS }}
  153. testapp_dir: quickstart-ios/build-for-testing
  154. test_type: "xctest"
  155. messaging-cron-only:
  156. # Don't run on private repo.
  157. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  158. runs-on: macos-12
  159. strategy:
  160. matrix:
  161. target: [ios, tvos, macos --skip-tests]
  162. flags: [
  163. '--use-modular-headers'
  164. ]
  165. needs: pod-lib-lint
  166. steps:
  167. - uses: actions/checkout@v3
  168. - uses: ruby/setup-ruby@v1
  169. - name: Setup Bundler
  170. run: scripts/setup_bundler.sh
  171. - name: PodLibLint Messaging Cron
  172. run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseMessaging.podspec --platforms=${{ matrix.target }}
  173. messaging-sample-build-test:
  174. # Don't run on private repo unless it is a PR.
  175. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  176. env:
  177. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  178. runs-on: macos-12
  179. steps:
  180. - uses: actions/checkout@v3
  181. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  182. with:
  183. cache_key: ${{ matrix.os }}
  184. - uses: ruby/setup-ruby@v1
  185. - name: Setup Bundler
  186. run: scripts/setup_bundler.sh
  187. - name: Install Secret GoogleService-Info.plist
  188. run: |
  189. scripts/decrypt_gha_secret.sh scripts/gha-encrypted/messaging-sample-plist.gpg \
  190. FirebaseMessaging/Apps/Shared/GoogleService-Info.plist "$plist_secret"
  191. - name: Prereqs
  192. run: scripts/install_prereqs.sh MessagingSample iOS
  193. - name: Build
  194. run: ([ -z $plist_secret ] || scripts/build.sh MessagingSample iOS)
  195. messaging-swiftui-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-12
  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 SwiftUISample iOS
  215. - name: Build
  216. run: ([ -z $plist_secret ] || scripts/build.sh SwiftUISample iOS)