crashlytics.yml 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. name: crashlytics
  2. on:
  3. workflow_dispatch:
  4. pull_request:
  5. paths:
  6. - 'Crashlytics**'
  7. - 'FirebaseCrashlytics.podspec'
  8. - '.github/workflows/crashlytics.yml'
  9. - 'Interop/Analytics/Public/*.h'
  10. - 'Gemfile*'
  11. schedule:
  12. # Run every day at 10am (PST) - cron uses UTC times
  13. - cron: '0 2 * * *'
  14. concurrency:
  15. group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
  16. cancel-in-progress: true
  17. jobs:
  18. pod-lib-lint:
  19. # Don't run on private repo unless it is a PR.
  20. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  21. strategy:
  22. matrix:
  23. target: [ios, tvos, macos, watchos --skip-tests]
  24. flags: [
  25. '--use-modular-headers --skip-tests',
  26. ''
  27. ]
  28. build-env:
  29. - os: macos-14
  30. xcode: Xcode_16.2
  31. tests:
  32. - os: macos-15
  33. xcode: Xcode_16.2
  34. tests:
  35. runs-on: ${{ matrix.build-env.os }}
  36. steps:
  37. - uses: actions/checkout@v4
  38. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  39. - name: Setup Bundler
  40. run: scripts/setup_bundler.sh
  41. - name: Xcode
  42. run: sudo xcode-select -s /Applications/${{ matrix.build-env.xcode }}.app/Contents/Developer
  43. - uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3
  44. with:
  45. timeout_minutes: 120
  46. max_attempts: 3
  47. retry_on: error
  48. retry_wait_seconds: 120
  49. command: scripts/pod_lib_lint.rb FirebaseCrashlytics.podspec --platforms=${{ matrix.target }} ${{ matrix.build-env.tests }} ${{ matrix.flags }}
  50. spm-package-resolved:
  51. env:
  52. FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
  53. runs-on: macos-14
  54. outputs:
  55. cache_key: ${{ steps.generate_cache_key.outputs.cache_key }}
  56. steps:
  57. - uses: actions/checkout@v4
  58. - name: Xcode
  59. run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
  60. - name: Generate Swift Package.resolved
  61. id: swift_package_resolve
  62. run: |
  63. swift package resolve
  64. - name: Generate cache key
  65. id: generate_cache_key
  66. run: |
  67. cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}"
  68. echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT"
  69. - uses: actions/cache/save@v4
  70. id: cache
  71. with:
  72. path: .build
  73. key: ${{ steps.generate_cache_key.outputs.cache_key }}
  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. needs: [spm-package-resolved]
  78. strategy:
  79. matrix:
  80. include:
  81. - os: macos-14
  82. xcode: Xcode_16.2
  83. target: iOS
  84. - os: macos-15
  85. xcode: Xcode_16.2
  86. target: iOS
  87. - os: macos-15
  88. xcode: Xcode_16.2
  89. target: tvOS
  90. - os: macos-15
  91. xcode: Xcode_16.2
  92. target: macOS
  93. - os: macos-15
  94. xcode: Xcode_16.2
  95. target: watchOS
  96. - os: macos-15
  97. xcode: Xcode_16.2
  98. target: catalyst
  99. - os: macos-15
  100. xcode: Xcode_16.2
  101. target: visionOS
  102. runs-on: ${{ matrix.os }}
  103. steps:
  104. - uses: actions/checkout@v4
  105. - uses: actions/cache/restore@v4
  106. with:
  107. path: .build
  108. key: ${{needs.spm-package-resolved.outputs.cache_key}}
  109. - name: Xcode
  110. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  111. - name: Install visionOS, if needed.
  112. if: matrix.target == 'visionOS'
  113. run: xcodebuild -downloadPlatform visionOS
  114. - name: Initialize xcodebuild
  115. run: scripts/setup_spm_tests.sh
  116. - uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3
  117. with:
  118. timeout_minutes: 120
  119. max_attempts: 3
  120. retry_on: error
  121. retry_wait_seconds: 120
  122. command: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseCrashlyticsUnit ${{ matrix.target }} spm
  123. catalyst:
  124. # Don't run on private repo unless it is a PR.
  125. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  126. runs-on: macos-15
  127. steps:
  128. - uses: actions/checkout@v4
  129. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  130. with:
  131. cache_key: catalyst${{ matrix.os }}
  132. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  133. - name: Setup Bundler
  134. run: scripts/setup_bundler.sh
  135. - name: Xcode
  136. run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
  137. - uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3
  138. with:
  139. timeout_minutes: 120
  140. max_attempts: 5
  141. retry_on: error
  142. retry_wait_seconds: 120
  143. command: scripts/test_catalyst.sh FirebaseCrashlytics test FirebaseCrashlytics-Unit-unit
  144. quickstart:
  145. # Don't run on private repo unless it is a PR.
  146. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  147. env:
  148. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  149. signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  150. runs-on: macos-15
  151. steps:
  152. - uses: actions/checkout@v4
  153. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  154. - name: Xcode
  155. run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
  156. - name: Setup quickstart
  157. run: scripts/setup_quickstart.sh crashlytics
  158. env:
  159. LEGACY: true
  160. - name: Install Secret GoogleService-Info.plist
  161. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-crashlytics.plist.gpg \
  162. quickstart-ios/crashlytics/GoogleService-Info.plist "$plist_secret"
  163. - name: Test swift quickstart
  164. run: |
  165. mkdir quickstart-ios/crashlytics/LegacyCrashlyticsQuickstart/Pods/FirebaseCrashlytics
  166. # Set the deployed pod location of run and upload-symbols with the development pod version.
  167. cp Crashlytics/run quickstart-ios/crashlytics/LegacyCrashlyticsQuickstart/Pods/FirebaseCrashlytics/
  168. cp Crashlytics/upload-symbols quickstart-ios/crashlytics/LegacyCrashlyticsQuickstart/Pods/FirebaseCrashlytics/
  169. ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Crashlytics true swift)
  170. env:
  171. LEGACY: true
  172. quickstart-ftl-cron-only:
  173. # Don't run on private repo.
  174. if: github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule'
  175. env:
  176. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  177. signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  178. runs-on: macos-15
  179. steps:
  180. - uses: actions/checkout@v4
  181. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  182. - uses: actions/setup-python@v5
  183. with:
  184. python-version: '3.11'
  185. - name: Xcode
  186. run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
  187. - name: Setup quickstart
  188. run: scripts/setup_quickstart.sh crashlytics
  189. env:
  190. LEGACY: true
  191. - name: Install Secret GoogleService-Info.plist
  192. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-crashlytics.plist.gpg \
  193. quickstart-ios/crashlytics/GoogleService-Info.plist "$plist_secret"
  194. - name: Build swift quickstart
  195. run: |
  196. mkdir quickstart-ios/crashlytics/LegacyCrashlyticsQuickstart/Pods/FirebaseCrashlytics
  197. # Set the deployed pod location of run and upload-symbols with the development pod version.
  198. cp Crashlytics/run quickstart-ios/crashlytics/LegacyCrashlyticsQuickstart/Pods/FirebaseCrashlytics/
  199. cp Crashlytics/upload-symbols quickstart-ios/crashlytics/LegacyCrashlyticsQuickstart/Pods/FirebaseCrashlytics/
  200. ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart_ftl.sh Crashlytics swift)
  201. env:
  202. LEGACY: true
  203. - id: ftl_test
  204. uses: FirebaseExtended/github-actions/firebase-test-lab@v1.4
  205. with:
  206. credentials_json: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CREDENTIALS }}
  207. testapp_dir: quickstart-ios/build-for-testing
  208. test_type: "xctest"
  209. crashlytics-cron-only:
  210. # Don't run on private repo.
  211. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  212. runs-on: macos-15
  213. strategy:
  214. matrix:
  215. # Disable watchos because it does not support XCTest.
  216. target: [ios, tvos, macos, watchos --skip-tests]
  217. flags: [
  218. '--use-static-frameworks'
  219. ]
  220. needs: pod-lib-lint
  221. steps:
  222. - uses: actions/checkout@v4
  223. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  224. - name: Setup Bundler
  225. run: scripts/setup_bundler.sh
  226. - name: Xcode
  227. run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
  228. - uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3
  229. with:
  230. timeout_minutes: 120
  231. max_attempts: 3
  232. retry_on: error
  233. retry_wait_seconds: 120
  234. command: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseCrashlytics.podspec --platforms=${{ matrix.target }} ${{ matrix.flags }}