firestore.yml 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  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. - name: Prepare ccache
  78. uses: actions/cache@v1
  79. with:
  80. path: ~/.ccache
  81. key: firestore-ccache-${{ runner.os }}-${{ github.sha }}
  82. restore-keys: |
  83. firestore-ccache-${{ runner.os }}-
  84. - name: Cache Mint packages
  85. uses: actions/cache@v1
  86. with:
  87. path: ${{ env.MINT_PATH }}
  88. key: ${{ runner.os }}-mint-${{ hashFiles('**/Mintfile') }}
  89. restore-keys: ${{ runner.os }}-mint-
  90. - name: Setup build
  91. run: scripts/install_prereqs.sh Firestore ${{ runner.os }} cmake
  92. - name: Build and test
  93. run: scripts/third_party/travis/retry.sh scripts/build.sh Firestore ${{ runner.os }} cmake
  94. sanitizers:
  95. # Don't run on private repo unless it is a PR.
  96. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  97. runs-on: macos-11
  98. needs: check
  99. strategy:
  100. matrix:
  101. sanitizer: [asan, tsan]
  102. env:
  103. SANITIZERS: ${{ matrix.sanitizer }}
  104. steps:
  105. - uses: actions/checkout@v2
  106. - name: Prepare ccache
  107. uses: actions/cache@v1
  108. with:
  109. path: ~/.ccache
  110. key: firestore-ccache-${{ runner.os }}-${{ matrix.sanitizer }}-${{ github.sha }}
  111. restore-keys: |
  112. firestore-ccache-${{ runner.os }}-${{ matrix.sanitizer }}-
  113. - name: Setup build
  114. run: scripts/install_prereqs.sh Firestore ${{ runner.os }} cmake
  115. - name: Build and test
  116. run: scripts/third_party/travis/retry.sh scripts/build.sh Firestore ${{ runner.os }} cmake
  117. xcodebuild:
  118. # Don't run on private repo unless it is a PR.
  119. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  120. runs-on: macos-11
  121. needs: check
  122. strategy:
  123. matrix:
  124. target: [iOS, tvOS, macOS]
  125. steps:
  126. - uses: actions/checkout@v2
  127. - name: Setup build
  128. run: scripts/install_prereqs.sh Firestore ${{ matrix.target }} xcodebuild
  129. - name: Build and test
  130. run: scripts/third_party/travis/retry.sh scripts/build.sh Firestore ${{ matrix.target }} xcodebuild
  131. pod-lib-lint:
  132. # Don't run on private repo unless it is a PR.
  133. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  134. runs-on: macos-11
  135. needs: check
  136. strategy:
  137. matrix:
  138. podspec: [
  139. 'FirebaseFirestore.podspec',
  140. 'FirebaseFirestoreSwift.podspec',
  141. ]
  142. steps:
  143. - uses: actions/checkout@v2
  144. - name: Setup Bundler
  145. run: ./scripts/setup_bundler.sh
  146. - name: Pod lib lint
  147. run: |
  148. scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb ${{ matrix.podspec }} \
  149. --platforms=ios \
  150. --allow-warnings
  151. # `pod lib lint` takes a long time so only run the other platforms and static frameworks build in the cron.
  152. pod-lib-lint-cron:
  153. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  154. runs-on: macos-11
  155. needs: check
  156. strategy:
  157. matrix:
  158. podspec: [
  159. 'FirebaseFirestore.podspec',
  160. 'FirebaseFirestoreSwift.podspec',
  161. ]
  162. platforms: [
  163. 'macos',
  164. 'tvos',
  165. ]
  166. flags: [
  167. '--use-static-frameworks',
  168. '',
  169. ]
  170. steps:
  171. - uses: actions/checkout@v2
  172. - name: Setup Bundler
  173. run: ./scripts/setup_bundler.sh
  174. - name: Pod lib lint
  175. run: |
  176. scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb ${{ matrix.podspec }}\
  177. ${{ matrix.flags }} \
  178. --platforms=${{ matrix.platforms }} \
  179. --allow-warnings
  180. spm:
  181. # Don't run on private repo unless it is a PR.
  182. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  183. runs-on: macos-11
  184. needs: check
  185. steps:
  186. - uses: actions/checkout@v2
  187. - name: Initialize xcodebuild
  188. run: scripts/setup_spm_tests.sh
  189. - name: iOS Build Test
  190. run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseFirestore iOS spmbuildonly
  191. - name: Swift Build
  192. run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseFirestoreSwift-Beta iOS spmbuildonly
  193. spm-cron:
  194. # Don't run on private repo.
  195. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  196. runs-on: macos-11
  197. strategy:
  198. matrix:
  199. target: [tvOS, macOS, catalyst]
  200. steps:
  201. - uses: actions/checkout@v2
  202. - name: Initialize xcodebuild
  203. run: scripts/setup_spm_tests.sh
  204. - name: Build Test
  205. run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseFirestore ${{ matrix.target }} spmbuildonly
  206. - name: Swift Build
  207. run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseFirestoreSwift-Beta ${{ matrix.target }} spmbuildonly
  208. # Restore when FirebaseUI works with Firebase 7 (#6646)
  209. quickstart:
  210. # Don't run on private repo unless it is a PR.
  211. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  212. env:
  213. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  214. signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  215. runs-on: macos-11
  216. needs: check
  217. steps:
  218. - uses: actions/checkout@v2
  219. - name: Setup quickstart
  220. run: scripts/setup_quickstart.sh firestore
  221. - name: Install Secret GoogleService-Info.plist
  222. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-firestore.plist.gpg \
  223. quickstart-ios/firestore/GoogleService-Info.plist "$plist_secret"
  224. - name: Test swift quickstart
  225. run: ([ -z $plist_secret ] ||
  226. scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Firestore false)
  227. podspec-presubmit:
  228. # Don't run on private repo unless it is a PR.
  229. if: github.repository == 'Firebase/firebase-ios-sdk' && github.event.pull_request.merged != true && github.event.action != 'closed'
  230. runs-on: macos-11
  231. steps:
  232. - uses: actions/checkout@v2
  233. - name: Setup Bundler
  234. run: scripts/setup_bundler.sh
  235. - name: Build and test
  236. 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/'