storage.yml 8.2 KB

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