firestore.yml 9.3 KB

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