firestore.yml 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302
  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. - 'Interop/Auth/Public/*.h'
  22. # FirebaseCore header change
  23. - 'FirebaseCore/Sources/Private'
  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 2am (PST) - cron uses UTC times
  50. - cron: '0 10 * * *'
  51. jobs:
  52. check:
  53. # Don't run on private repo unless it is a PR.
  54. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  55. runs-on: macos-11
  56. steps:
  57. - uses: actions/checkout@v2
  58. - uses: actions/setup-python@v2
  59. with:
  60. python-version: 3.6
  61. - name: Setup check
  62. run: scripts/setup_check.sh
  63. - name: Run check
  64. run: scripts/check.sh --test-only
  65. cmake:
  66. # Don't run on private repo unless it is a PR.
  67. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  68. needs: check
  69. strategy:
  70. matrix:
  71. os: [macos-11, ubuntu-latest]
  72. env:
  73. MINT_PATH: ${{ github.workspace }}/mint
  74. runs-on: ${{ matrix.os }}
  75. steps:
  76. - uses: actions/checkout@v2
  77. - uses: mikehardy/buildcache-action@50738c6c77de7f34e66b870e4f8ede333b69d077
  78. with:
  79. cache_key: ${{ matrix.os }}
  80. - name: Prepare ccache
  81. uses: actions/cache@v1
  82. with:
  83. path: ~/.ccache
  84. key: firestore-ccache-${{ runner.os }}-${{ github.sha }}
  85. restore-keys: |
  86. firestore-ccache-${{ runner.os }}-
  87. - name: Cache Mint packages
  88. uses: actions/cache@v1
  89. with:
  90. path: ${{ env.MINT_PATH }}
  91. key: ${{ runner.os }}-mint-${{ hashFiles('**/Mintfile') }}
  92. restore-keys: ${{ runner.os }}-mint-
  93. - name: Setup build
  94. run: scripts/install_prereqs.sh Firestore ${{ runner.os }} cmake
  95. - name: Build and test
  96. run: scripts/third_party/travis/retry.sh scripts/build.sh Firestore ${{ runner.os }} cmake
  97. sanitizers:
  98. # Don't run on private repo unless it is a PR.
  99. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  100. runs-on: macos-11
  101. needs: check
  102. strategy:
  103. matrix:
  104. sanitizer: [asan, tsan]
  105. env:
  106. SANITIZERS: ${{ matrix.sanitizer }}
  107. steps:
  108. - uses: actions/checkout@v2
  109. - uses: mikehardy/buildcache-action@50738c6c77de7f34e66b870e4f8ede333b69d077
  110. with:
  111. cache_key: ${{ matrix.os }}
  112. - name: Prepare ccache
  113. uses: actions/cache@v1
  114. with:
  115. path: ~/.ccache
  116. key: firestore-ccache-${{ runner.os }}-${{ matrix.sanitizer }}-${{ github.sha }}
  117. restore-keys: |
  118. firestore-ccache-${{ runner.os }}-${{ matrix.sanitizer }}-
  119. - name: Setup build
  120. run: scripts/install_prereqs.sh Firestore ${{ runner.os }} cmake
  121. - name: Build and test
  122. run: scripts/third_party/travis/retry.sh scripts/build.sh Firestore ${{ runner.os }} cmake
  123. xcodebuild:
  124. # Don't run on private repo unless it is a PR.
  125. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  126. runs-on: macos-11
  127. needs: check
  128. strategy:
  129. matrix:
  130. target: [iOS, tvOS, macOS]
  131. steps:
  132. - uses: actions/checkout@v2
  133. - uses: mikehardy/buildcache-action@50738c6c77de7f34e66b870e4f8ede333b69d077
  134. with:
  135. cache_key: ${{ matrix.os }}
  136. - name: Setup build
  137. run: scripts/install_prereqs.sh Firestore ${{ matrix.target }} xcodebuild
  138. - name: Build and test
  139. run: scripts/third_party/travis/retry.sh scripts/build.sh Firestore ${{ matrix.target }} xcodebuild
  140. pod-lib-lint:
  141. # Don't run on private repo unless it is a PR.
  142. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  143. runs-on: macos-11
  144. needs: check
  145. strategy:
  146. matrix:
  147. podspec: [
  148. 'FirebaseFirestore.podspec',
  149. 'FirebaseFirestoreSwift.podspec',
  150. ]
  151. steps:
  152. - uses: actions/checkout@v2
  153. - name: Setup Bundler
  154. run: ./scripts/setup_bundler.sh
  155. - name: Pod lib lint
  156. run: |
  157. scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb ${{ matrix.podspec }} \
  158. --platforms=ios \
  159. --allow-warnings
  160. # `pod lib lint` takes a long time so only run the other platforms and static frameworks build in the cron.
  161. pod-lib-lint-cron:
  162. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  163. runs-on: macos-11
  164. needs: check
  165. strategy:
  166. matrix:
  167. podspec: [
  168. 'FirebaseFirestore.podspec',
  169. 'FirebaseFirestoreSwift.podspec',
  170. ]
  171. platforms: [
  172. 'macos',
  173. 'tvos',
  174. ]
  175. flags: [
  176. '--use-static-frameworks',
  177. '',
  178. ]
  179. steps:
  180. - uses: actions/checkout@v2
  181. - name: Setup Bundler
  182. run: ./scripts/setup_bundler.sh
  183. - name: Pod lib lint
  184. run: |
  185. scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb ${{ matrix.podspec }}\
  186. ${{ matrix.flags }} \
  187. --platforms=${{ matrix.platforms }} \
  188. --allow-warnings
  189. spm:
  190. # Don't run on private repo unless it is a PR.
  191. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  192. runs-on: macos-11
  193. needs: check
  194. steps:
  195. - uses: actions/checkout@v2
  196. - uses: mikehardy/buildcache-action@50738c6c77de7f34e66b870e4f8ede333b69d077
  197. with:
  198. cache_key: ${{ matrix.os }}
  199. - name: Initialize xcodebuild
  200. run: scripts/setup_spm_tests.sh
  201. - name: iOS Build Test
  202. run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseFirestore iOS spmbuildonly
  203. - name: Swift Build
  204. run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseFirestoreSwift-Beta iOS spmbuildonly
  205. spm-cron:
  206. # Don't run on private repo.
  207. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  208. runs-on: macos-11
  209. strategy:
  210. matrix:
  211. target: [tvOS, macOS, catalyst]
  212. steps:
  213. - uses: actions/checkout@v2
  214. - uses: mikehardy/buildcache-action@50738c6c77de7f34e66b870e4f8ede333b69d077
  215. with:
  216. cache_key: ${{ matrix.os }}
  217. - name: Initialize xcodebuild
  218. run: scripts/setup_spm_tests.sh
  219. - name: Build Test
  220. run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseFirestore ${{ matrix.target }} spmbuildonly
  221. - name: Swift Build
  222. run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseFirestoreSwift-Beta ${{ matrix.target }} spmbuildonly
  223. # Restore when FirebaseUI works with Firebase 7 (#6646)
  224. quickstart:
  225. # Don't run on private repo unless it is a PR.
  226. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  227. env:
  228. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  229. signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  230. runs-on: macos-11
  231. needs: check
  232. steps:
  233. - uses: actions/checkout@v2
  234. - name: Setup quickstart
  235. run: scripts/setup_quickstart.sh firestore
  236. - name: Install Secret GoogleService-Info.plist
  237. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-firestore.plist.gpg \
  238. quickstart-ios/firestore/GoogleService-Info.plist "$plist_secret"
  239. - name: Test swift quickstart
  240. run: ([ -z $plist_secret ] ||
  241. scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Firestore false)
  242. podspec-presubmit:
  243. # Don't run on private repo unless it is a PR.
  244. if: github.repository == 'Firebase/firebase-ios-sdk' && github.event.pull_request.merged != true && github.event.action != 'closed'
  245. runs-on: macos-11
  246. steps:
  247. - uses: actions/checkout@v2
  248. - name: Setup Bundler
  249. run: scripts/setup_bundler.sh
  250. - name: Build and test
  251. run: scripts/third_party/travis/retry.sh pod spec lint FirebaseFirestore.podspec --skip-tests --allow-warnings --platforms=ios --sources='https://github.com/firebase/SpecsTesting','https://github.com/firebase/SpecsDev.git','https://github.com/firebase/SpecsStaging.git','https://cdn.cocoapods.org/'