storage.yml 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  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-15
  25. xcode: Xcode_16.2
  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.2
  95. target: iOS
  96. - os: macos-15
  97. xcode: Xcode_16.2
  98. target: tvOS
  99. - os: macos-15
  100. xcode: Xcode_16.2
  101. target: macOS
  102. - os: macos-15
  103. xcode: Xcode_16.2
  104. target: watchOS
  105. - os: macos-15
  106. xcode: Xcode_16.2
  107. target: catalyst
  108. - os: macos-15
  109. xcode: Xcode_16.2
  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: Install visionOS, if needed.
  123. if: matrix.target == 'visionOS spm'
  124. run: xcodebuild -downloadPlatform visionOS
  125. - name: Initialize xcodebuild
  126. run: scripts/setup_spm_tests.sh
  127. - name: Unit Tests
  128. run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseStorageUnit ${{ matrix.target }} spm
  129. quickstart:
  130. # Don't run on private repo unless it is a PR.
  131. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  132. # TODO: See #12399 and restore Objective-C testing for Xcode 15 if GHA is fixed.
  133. strategy:
  134. matrix:
  135. include:
  136. #- os: macos-13
  137. # xcode: Xcode_14.2 # TODO: the legacy ObjC quickstart doesn't build with Xcode 15.
  138. - swift: swift
  139. os: macos-15
  140. xcode: Xcode_16.2
  141. env:
  142. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  143. signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  144. LEGACY: true
  145. runs-on: ${{ matrix.os }}
  146. steps:
  147. - uses: actions/checkout@v4
  148. - uses: ruby/setup-ruby@v1
  149. - name: Setup quickstart
  150. run: scripts/setup_quickstart.sh storage
  151. - name: Install Secret GoogleService-Info.plist
  152. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-storage.plist.gpg \
  153. quickstart-ios/storage/GoogleService-Info.plist "$plist_secret"
  154. - name: Xcode
  155. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  156. - name: Test quickstart
  157. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Storage false ${{ matrix.swift }})
  158. quickstart-ftl-cron-only:
  159. # Don't run on private repo.
  160. if: github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule'
  161. env:
  162. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  163. signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  164. LEGACY: true
  165. runs-on: macos-14
  166. steps:
  167. - uses: actions/checkout@v4
  168. - uses: ruby/setup-ruby@v1
  169. - uses: actions/setup-python@v5
  170. with:
  171. python-version: '3.11'
  172. - name: Setup quickstart
  173. run: scripts/setup_quickstart.sh storage
  174. - name: Install Secret GoogleService-Info.plist
  175. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-storage.plist.gpg \
  176. quickstart-ios/storage/GoogleService-Info.plist "$plist_secret"
  177. # - name: Build objc quickstart
  178. # run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart_ftl.sh Storage)
  179. - name: Build swift quickstart
  180. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart_ftl.sh Storage swift)
  181. - id: ftl_test
  182. uses: FirebaseExtended/github-actions/firebase-test-lab@v1.4
  183. with:
  184. credentials_json: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CREDENTIALS }}
  185. testapp_dir: quickstart-ios/build-for-testing
  186. test_type: "xctest"
  187. pod-lib-lint:
  188. # Don't run on private repo unless it is a PR.
  189. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  190. strategy:
  191. matrix:
  192. target: [ios, tvos, macos, watchos]
  193. build-env:
  194. - os: macos-14
  195. xcode: Xcode_15.3
  196. tests: --skip-tests
  197. - os: macos-15
  198. xcode: Xcode_16.2
  199. tests: --test-specs=unit
  200. runs-on: ${{ matrix.build-env.os }}
  201. steps:
  202. - uses: actions/checkout@v4
  203. - uses: ruby/setup-ruby@v1
  204. - name: Setup Bundler
  205. run: scripts/setup_bundler.sh
  206. - name: Xcodes
  207. run: ls -l /Applications/Xcode*
  208. - name: Xcode
  209. run: sudo xcode-select -s /Applications/${{ matrix.build-env.xcode }}.app/Contents/Developer
  210. - name: Build and test
  211. run: |
  212. scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseStorage.podspec ${{ matrix.build-env.tests }} \
  213. --platforms=${{ matrix.target }}
  214. storage-cron-only:
  215. # Don't run on private repo.
  216. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  217. strategy:
  218. matrix:
  219. target: [ios, tvos, macos, watchos]
  220. build-env:
  221. - os: macos-14
  222. xcode: Xcode_15.3
  223. - os: macos-15
  224. xcode: Xcode_16.2
  225. runs-on: ${{ matrix.build-env.os }}
  226. needs: pod-lib-lint
  227. steps:
  228. - uses: actions/checkout@v4
  229. - uses: ruby/setup-ruby@v1
  230. - name: Setup Bundler
  231. run: scripts/setup_bundler.sh
  232. - name: Xcode
  233. run: sudo xcode-select -s /Applications/${{ matrix.build-env.xcode }}.app/Contents/Developer
  234. - name: PodLibLint Storage Cron
  235. run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseStorage.podspec --platforms=${{ matrix.target }} --use-static-frameworks --skip-tests