firestore.yml 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  1. # Copyright 2020 Google LLC
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. name: firestore
  15. on:
  16. pull_request:
  17. paths:
  18. # Firestore sources
  19. - 'Firestore/**'
  20. # Interop headers
  21. - 'FirebaseAuth/Interop/*.h'
  22. # FirebaseCore header change
  23. - 'FirebaseCore/Internal'
  24. - 'FirebaseCore/Sources/Public'
  25. # Podspec
  26. - 'FirebaseFirestore.podspec'
  27. # CMake
  28. - '**CMakeLists.txt'
  29. - 'cmake/**'
  30. # Build scripts to which Firestore is sensitive
  31. #
  32. # Note that this doesn't include check scripts because changing those will
  33. # already trigger the check workflow.
  34. - 'scripts/binary_to_array.py'
  35. - 'scripts/build.sh'
  36. - 'scripts/install_prereqs.sh'
  37. - 'scripts/localize_podfile.swift'
  38. - 'scripts/pod_lib_lint.rb'
  39. - 'scripts/run_firestore_emulator.sh'
  40. - 'scripts/setup_*'
  41. - 'scripts/sync_project.rb'
  42. - 'scripts/test_quickstart.sh'
  43. - 'scripts/xcresult_logs.py'
  44. # This workflow
  45. - '.github/workflows/firestore.yml'
  46. # Rebuild on Ruby infrastructure changes.
  47. - 'Gemfile*'
  48. schedule:
  49. # Run every day at 12am (PST) - cron uses UTC times
  50. - cron: '0 8 * * *'
  51. concurrency:
  52. group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
  53. cancel-in-progress: true
  54. jobs:
  55. check:
  56. # Don't run on private repo unless it is a PR.
  57. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  58. runs-on: macos-12
  59. steps:
  60. - uses: actions/checkout@v3
  61. - uses: actions/setup-python@v2
  62. with:
  63. python-version: 3.6
  64. - name: Setup check
  65. run: scripts/setup_check.sh
  66. - name: Run check
  67. run: scripts/check.sh --test-only
  68. cmake:
  69. # Don't run on private repo unless it is a PR.
  70. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  71. needs: check
  72. strategy:
  73. matrix:
  74. os: [macos-12, ubuntu-latest]
  75. env:
  76. MINT_PATH: ${{ github.workspace }}/mint
  77. runs-on: ${{ matrix.os }}
  78. steps:
  79. - uses: actions/checkout@v3
  80. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  81. with:
  82. cache_key: ${{ matrix.os }}
  83. - name: Prepare ccache
  84. uses: actions/cache@v1
  85. with:
  86. path: ~/.ccache
  87. key: firestore-ccache-${{ runner.os }}-${{ github.sha }}
  88. restore-keys: |
  89. firestore-ccache-${{ runner.os }}-
  90. - name: Cache Mint packages
  91. uses: actions/cache@v1
  92. with:
  93. path: ${{ env.MINT_PATH }}
  94. key: ${{ runner.os }}-mint-${{ hashFiles('**/Mintfile') }}
  95. restore-keys: ${{ runner.os }}-mint-
  96. - name: Setup build
  97. run: scripts/install_prereqs.sh Firestore ${{ runner.os }} cmake
  98. - name: Build and test
  99. run: scripts/third_party/travis/retry.sh scripts/build.sh Firestore ${{ runner.os }} cmake
  100. sanitizers:
  101. # Don't run on private repo unless it is a PR.
  102. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  103. needs: check
  104. strategy:
  105. matrix:
  106. os: [macos-12, unbuntu-latest]
  107. sanitizer: [asan, tsan]
  108. runs-on: ${{ matrix.os }}
  109. env:
  110. SANITIZERS: ${{ matrix.sanitizer }}
  111. steps:
  112. - uses: actions/checkout@v3
  113. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  114. with:
  115. cache_key: ${{ matrix.os }}
  116. - name: Prepare ccache
  117. uses: actions/cache@v1
  118. with:
  119. path: ~/.ccache
  120. key: firestore-ccache-${{ runner.os }}-${{ matrix.sanitizer }}-${{ github.sha }}
  121. restore-keys: |
  122. firestore-ccache-${{ runner.os }}-${{ matrix.sanitizer }}-
  123. - name: Setup build
  124. run: scripts/install_prereqs.sh Firestore ${{ runner.os }} cmake
  125. - name: Build and test
  126. run: scripts/third_party/travis/retry.sh scripts/build.sh Firestore ${{ runner.os }} cmake
  127. xcodebuild:
  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-12
  131. needs: check
  132. strategy:
  133. matrix:
  134. target: [iOS, tvOS, macOS]
  135. steps:
  136. - uses: actions/checkout@v3
  137. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  138. with:
  139. cache_key: ${{ matrix.os }}
  140. - uses: ruby/setup-ruby@v1
  141. - name: Setup build
  142. run: scripts/install_prereqs.sh Firestore ${{ matrix.target }} xcodebuild
  143. - name: Build and test
  144. run: scripts/third_party/travis/retry.sh scripts/build.sh Firestore ${{ matrix.target }} xcodebuild
  145. pod-lib-lint:
  146. # Don't run on private repo unless it is a PR.
  147. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  148. runs-on: macos-12
  149. needs: check
  150. strategy:
  151. matrix:
  152. podspec: [
  153. 'FirebaseFirestore.podspec',
  154. 'FirebaseFirestoreSwift.podspec',
  155. ]
  156. steps:
  157. - uses: actions/checkout@v3
  158. - uses: ruby/setup-ruby@v1
  159. - name: Setup Bundler
  160. run: ./scripts/setup_bundler.sh
  161. - name: Pod lib lint
  162. # TODO(#9565, b/227461966): Remove --no-analyze when absl is fixed.
  163. run: |
  164. scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb ${{ matrix.podspec }} \
  165. --platforms=ios \
  166. --allow-warnings \
  167. --no-analyze
  168. # `pod lib lint` takes a long time so only run the other platforms and static frameworks build in the cron.
  169. pod-lib-lint-cron:
  170. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  171. runs-on: macos-12
  172. needs: check
  173. strategy:
  174. matrix:
  175. podspec: [
  176. 'FirebaseFirestore.podspec',
  177. 'FirebaseFirestoreSwift.podspec',
  178. ]
  179. platforms: [
  180. 'macos',
  181. 'tvos',
  182. ]
  183. flags: [
  184. '--use-static-frameworks',
  185. '',
  186. ]
  187. steps:
  188. - uses: actions/checkout@v3
  189. - uses: ruby/setup-ruby@v1
  190. - name: Setup Bundler
  191. run: ./scripts/setup_bundler.sh
  192. - name: Pod lib lint
  193. # TODO(#9565, b/227461966): Remove --no-analyze when absl is fixed.
  194. run: |
  195. scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb ${{ matrix.podspec }}\
  196. ${{ matrix.flags }} \
  197. --platforms=${{ matrix.platforms }} \
  198. --allow-warnings \
  199. --no-analyze
  200. spm:
  201. # Don't run on private repo unless it is a PR.
  202. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  203. runs-on: macos-12
  204. needs: check
  205. steps:
  206. - uses: actions/checkout@v3
  207. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  208. with:
  209. cache_key: ${{ matrix.os }}
  210. - name: Initialize xcodebuild
  211. run: scripts/setup_spm_tests.sh
  212. - name: iOS Build Test
  213. run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseFirestore iOS spmbuildonly
  214. - name: Swift Build
  215. run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseFirestoreSwift iOS spmbuildonly
  216. spm-cron:
  217. # Don't run on private repo.
  218. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  219. runs-on: macos-12
  220. strategy:
  221. matrix:
  222. target: [tvOS, macOS, catalyst]
  223. steps:
  224. - uses: actions/checkout@v3
  225. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  226. with:
  227. cache_key: ${{ matrix.os }}
  228. - name: Initialize xcodebuild
  229. run: scripts/setup_spm_tests.sh
  230. - name: Build Test
  231. run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseFirestore ${{ matrix.target }} spmbuildonly
  232. - name: Swift Build
  233. run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseFirestoreSwift ${{ matrix.target }} spmbuildonly
  234. # Disable until FirebaseUI is updated to accept Firebase 9 and quickstart is updated to accept
  235. # Firebase UI 12
  236. # quickstart:
  237. # # Don't run on private repo unless it is a PR.
  238. # if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  239. # env:
  240. # plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  241. # signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  242. # runs-on: macos-12
  243. # needs: check
  244. # steps:
  245. # - uses: actions/checkout@v3
  246. # - name: Setup quickstart
  247. # run: scripts/setup_quickstart.sh firestore
  248. # - name: Install Secret GoogleService-Info.plist
  249. # run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-firestore.plist.gpg \
  250. # quickstart-ios/firestore/GoogleService-Info.plist "$plist_secret"
  251. # - name: Test swift quickstart
  252. # run: ([ -z $plist_secret ] ||
  253. # scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Firestore false)