firestore.yml 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  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@v4
  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@v3
  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@v3
  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. # TODO(b/260248007): Re-enable this once tsan passes on Linux
  107. os: [macos-12]
  108. sanitizer: [asan, tsan]
  109. runs-on: ${{ matrix.os }}
  110. env:
  111. SANITIZERS: ${{ matrix.sanitizer }}
  112. steps:
  113. - uses: actions/checkout@v3
  114. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  115. with:
  116. cache_key: ${{ matrix.os }}
  117. - name: Prepare ccache
  118. uses: actions/cache@v3
  119. with:
  120. path: ~/.ccache
  121. key: firestore-ccache-${{ runner.os }}-${{ matrix.sanitizer }}-${{ github.sha }}
  122. restore-keys: |
  123. firestore-ccache-${{ runner.os }}-${{ matrix.sanitizer }}-
  124. - name: Setup build
  125. run: scripts/install_prereqs.sh Firestore ${{ runner.os }} cmake
  126. - name: Build and test
  127. run: scripts/third_party/travis/retry.sh scripts/build.sh Firestore ${{ runner.os }} cmake
  128. xcodebuild:
  129. # Don't run on private repo unless it is a PR.
  130. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  131. runs-on: macos-12
  132. needs: check
  133. strategy:
  134. matrix:
  135. target: [iOS, tvOS, macOS]
  136. steps:
  137. - uses: actions/checkout@v3
  138. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  139. with:
  140. cache_key: ${{ matrix.os }}
  141. - uses: ruby/setup-ruby@v1
  142. - name: Setup build
  143. run: scripts/install_prereqs.sh Firestore ${{ matrix.target }} xcodebuild
  144. - name: Build and test
  145. run: scripts/third_party/travis/retry.sh scripts/build.sh Firestore ${{ matrix.target }} xcodebuild
  146. pod-lib-lint:
  147. # Don't run on private repo unless it is a PR.
  148. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  149. runs-on: macos-12
  150. needs: check
  151. strategy:
  152. matrix:
  153. podspec: [
  154. 'FirebaseFirestore.podspec',
  155. 'FirebaseFirestoreSwift.podspec',
  156. ]
  157. steps:
  158. - uses: actions/checkout@v3
  159. - uses: ruby/setup-ruby@v1
  160. - name: Setup Bundler
  161. run: ./scripts/setup_bundler.sh
  162. - name: Pod lib lint
  163. # TODO(#9565, b/227461966): Remove --no-analyze when absl is fixed.
  164. run: |
  165. scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb ${{ matrix.podspec }} \
  166. --platforms=ios \
  167. --allow-warnings \
  168. --no-analyze
  169. # `pod lib lint` takes a long time so only run the other platforms and static frameworks build in the cron.
  170. pod-lib-lint-cron:
  171. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  172. runs-on: macos-12
  173. needs: check
  174. strategy:
  175. matrix:
  176. podspec: [
  177. 'FirebaseFirestore.podspec',
  178. 'FirebaseFirestoreSwift.podspec',
  179. ]
  180. platforms: [
  181. 'macos',
  182. 'tvos',
  183. ]
  184. flags: [
  185. '--use-static-frameworks',
  186. '',
  187. ]
  188. steps:
  189. - uses: actions/checkout@v3
  190. - uses: ruby/setup-ruby@v1
  191. - name: Setup Bundler
  192. run: ./scripts/setup_bundler.sh
  193. - name: Pod lib lint
  194. # TODO(#9565, b/227461966): Remove --no-analyze when absl is fixed.
  195. run: |
  196. scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb ${{ matrix.podspec }}\
  197. ${{ matrix.flags }} \
  198. --platforms=${{ matrix.platforms }} \
  199. --allow-warnings \
  200. --no-analyze
  201. spm:
  202. # Don't run on private repo unless it is a PR.
  203. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  204. runs-on: macos-12
  205. needs: check
  206. steps:
  207. - uses: actions/checkout@v3
  208. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  209. with:
  210. cache_key: ${{ matrix.os }}
  211. - name: Initialize xcodebuild
  212. run: scripts/setup_spm_tests.sh
  213. - name: iOS Build Test
  214. run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseFirestore iOS spmbuildonly
  215. - name: Swift Build
  216. run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseFirestoreSwift iOS spmbuildonly
  217. spm-cron:
  218. # Don't run on private repo.
  219. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  220. runs-on: macos-12
  221. strategy:
  222. matrix:
  223. target: [tvOS, macOS, catalyst]
  224. steps:
  225. - uses: actions/checkout@v3
  226. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  227. with:
  228. cache_key: ${{ matrix.os }}
  229. - name: Initialize xcodebuild
  230. run: scripts/setup_spm_tests.sh
  231. - name: Build Test
  232. run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseFirestore ${{ matrix.target }} spmbuildonly
  233. - name: Swift Build
  234. run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseFirestoreSwift ${{ matrix.target }} spmbuildonly
  235. # Disable until FirebaseUI is updated to accept Firebase 9 and quickstart is updated to accept
  236. # Firebase UI 12
  237. # quickstart:
  238. # # Don't run on private repo unless it is a PR.
  239. # if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  240. # env:
  241. # plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  242. # signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  243. # runs-on: macos-12
  244. # needs: check
  245. # steps:
  246. # - uses: actions/checkout@v3
  247. # - name: Setup quickstart
  248. # run: scripts/setup_quickstart.sh firestore
  249. # - name: Install Secret GoogleService-Info.plist
  250. # run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-firestore.plist.gpg \
  251. # quickstart-ios/firestore/GoogleService-Info.plist "$plist_secret"
  252. # - name: Test swift quickstart
  253. # run: ([ -z $plist_secret ] ||
  254. # scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Firestore false)