firestore.yml 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  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 9pm (PST) - cron uses UTC times
  50. - cron: '0 5 * * *'
  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-latest
  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-latest, 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-latest
  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-latest
  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-latest
  135. needs: check
  136. strategy:
  137. matrix:
  138. flags: [
  139. '--use-static-frameworks',
  140. '',
  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 FirebaseFirestore.podspec \
  149. ${{ matrix.flags }} \
  150. --platforms=ios \
  151. --allow-warnings
  152. spm:
  153. # Don't run on private repo unless it is a PR.
  154. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  155. runs-on: macOS-latest
  156. needs: check
  157. steps:
  158. - uses: actions/checkout@v2
  159. - name: Xcode 12
  160. run: sudo xcode-select -s /Applications/Xcode_12.app/Contents/Developer
  161. - name: Initialize xcodebuild
  162. run: xcodebuild -list
  163. - name: iOS Build Test
  164. run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseFirestore iOS spmbuildonly
  165. - name: Swift Build
  166. run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseFirestoreSwift-Beta iOS spmbuildonly
  167. spm-cron:
  168. # Don't run on private repo.
  169. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  170. runs-on: macOS-latest
  171. strategy:
  172. matrix:
  173. target: [tvOS, macOS, catalyst]
  174. steps:
  175. - uses: actions/checkout@v2
  176. - name: Xcode 12
  177. run: sudo xcode-select -s /Applications/Xcode_12.app/Contents/Developer
  178. - name: Initialize xcodebuild
  179. run: xcodebuild -list
  180. - name: Build Test
  181. run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseFirestore ${{ matrix.target }} spmbuildonly
  182. - name: Swift Build
  183. run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseFirestoreSwift-Beta ${{ matrix.target }} spmbuildonly
  184. # Restore when FirebaseUI works with Firebase 7 (#6646)
  185. quickstart:
  186. # Don't run on private repo unless it is a PR.
  187. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  188. env:
  189. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  190. signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  191. runs-on: macOS-latest
  192. needs: check
  193. steps:
  194. - uses: actions/checkout@v2
  195. - name: Setup quickstart
  196. run: scripts/setup_quickstart.sh firestore
  197. - name: Install Secret GoogleService-Info.plist
  198. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-firestore.plist.gpg \
  199. quickstart-ios/firestore/GoogleService-Info.plist "$plist_secret"
  200. - name: Install Secret FIREGSignInInfo.h
  201. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/FIREGSignInInfo.h.gpg \
  202. quickstart-ios/TestUtils/FIREGSignInInfo.h "$signin_secret"
  203. - name: Test swift quickstart
  204. run: ([ -z $plist_secret ] ||
  205. scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Firestore)