storage.yml 8.8 KB

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