storage.yml 10 KB

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