database.yml 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. name: database
  2. on:
  3. pull_request:
  4. paths:
  5. - 'FirebaseDatabase**'
  6. - 'Firebase/Database/**'
  7. - 'FirebaseSharedSwift**'
  8. - 'Example/Database/**'
  9. - 'FirebaseAuth/Interop/*.h'
  10. - '.github/workflows/database.yml'
  11. - 'Gemfile*'
  12. - 'scripts/run_database_emulator.sh'
  13. schedule:
  14. # Run every day at 2am (PST) - cron uses UTC times
  15. - cron: '0 10 * * *'
  16. concurrency:
  17. group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
  18. cancel-in-progress: true
  19. jobs:
  20. pod-lib-lint:
  21. # Don't run on private repo unless it is a PR.
  22. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  23. strategy:
  24. matrix:
  25. target: [ios, tvos, macos --skip-tests, watchos]
  26. os: [macos-14]
  27. xcode: [Xcode_15.2, Xcode_16]
  28. runs-on: ${{ matrix.os }}
  29. steps:
  30. - uses: actions/checkout@v4
  31. - uses: ruby/setup-ruby@v1
  32. - name: Setup Bundler
  33. run: scripts/setup_bundler.sh
  34. - name: Xcode
  35. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  36. - name: Build and test
  37. run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseDatabase.podspec --test-specs=unit --platforms=${{ matrix.target }}
  38. integration:
  39. # Don't run on private repo unless it is a PR.
  40. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  41. runs-on: macos-14
  42. steps:
  43. - uses: actions/checkout@v4
  44. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  45. with:
  46. cache_key: integration${{ matrix.os }}
  47. - uses: ruby/setup-ruby@v1
  48. - name: Setup Bundler
  49. run: scripts/setup_bundler.sh
  50. - name: Install xcpretty
  51. run: gem install xcpretty
  52. - name: Xcode
  53. run: sudo xcode-select -s /Applications/Xcode_15.2.app/Contents/Developer
  54. - name: IntegrationTest
  55. # Only iOS to mitigate flakes.
  56. run: scripts/third_party/travis/retry.sh scripts/build.sh Database iOS integration
  57. spm-package-resolved:
  58. env:
  59. FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
  60. runs-on: macos-14
  61. outputs:
  62. cache_key: ${{ steps.generate_cache_key.outputs.cache_key }}
  63. steps:
  64. - uses: actions/checkout@v4
  65. - name: Generate Swift Package.resolved
  66. id: swift_package_resolve
  67. run: |
  68. swift package resolve
  69. - name: Generate cache key
  70. id: generate_cache_key
  71. run: |
  72. cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}"
  73. echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT"
  74. - uses: actions/cache/save@v4
  75. id: cache
  76. with:
  77. path: .build
  78. key: ${{ steps.generate_cache_key.outputs.cache_key }}
  79. spm:
  80. # Don't run on private repo unless it is a PR.
  81. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  82. needs: [spm-package-resolved]
  83. strategy:
  84. matrix:
  85. include:
  86. - os: macos-13
  87. xcode: Xcode_15.2
  88. target: iOS
  89. - os: macos-14
  90. xcode: Xcode_15.4
  91. target: iOS
  92. - os: macos-15
  93. xcode: Xcode_16
  94. target: iOS
  95. - os: macos-15
  96. xcode: Xcode_16
  97. target: tvOS
  98. - os: macos-15
  99. xcode: Xcode_16
  100. target: macOS
  101. - os: macos-15
  102. xcode: Xcode_16
  103. target: watchOS
  104. - os: macos-15
  105. xcode: Xcode_16
  106. target: catalyst
  107. - os: macos-15
  108. xcode: Xcode_16
  109. target: visionOS
  110. runs-on: ${{ matrix.os }}
  111. steps:
  112. - uses: actions/checkout@v4
  113. - uses: actions/cache/restore@v4
  114. with:
  115. path: .build
  116. key: ${{needs.spm-package-resolved.outputs.cache_key}}
  117. - name: Xcode
  118. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  119. - name: Initialize xcodebuild
  120. run: scripts/setup_spm_tests.sh
  121. - name: Unit Tests
  122. run: scripts/third_party/travis/retry.sh ./scripts/build.sh DatabaseUnit ${{ matrix.target }} spm
  123. - name: iOS Swift Unit Tests
  124. run: scripts/third_party/travis/retry.sh ./scripts/build.sh DatabaseUnitSwift ${{ matrix.target }} spm
  125. catalyst:
  126. # Don't run on private repo unless it is a PR.
  127. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  128. runs-on: macos-14
  129. steps:
  130. - uses: actions/checkout@v4
  131. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  132. with:
  133. cache_key: catalyst${{ matrix.os }}
  134. - uses: ruby/setup-ruby@v1
  135. - name: Setup Bundler
  136. run: scripts/setup_bundler.sh
  137. - name: Setup project and Build for Catalyst
  138. run: scripts/test_catalyst.sh FirebaseDatabase test FirebaseDatabase-Unit-unit
  139. quickstart:
  140. # Don't run on private repo unless it is a PR.
  141. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  142. env:
  143. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  144. signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  145. runs-on: macos-14
  146. steps:
  147. - uses: actions/checkout@v4
  148. - uses: ruby/setup-ruby@v1
  149. - name: Setup quickstart
  150. run: scripts/setup_quickstart.sh database
  151. - name: Install Secret GoogleService-Info.plist
  152. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-database.plist.gpg \
  153. quickstart-ios/database/GoogleService-Info.plist "$plist_secret"
  154. - name: Test objc quickstart
  155. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Database false)
  156. - name: Test swift quickstart
  157. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Database false swift)
  158. database-cron-only:
  159. # Don't run on private repo.
  160. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  161. runs-on: macos-14
  162. strategy:
  163. matrix:
  164. podspec: [FirebaseDatabase.podspec]
  165. target: [ios, tvos, macos]
  166. flags: [
  167. '--skip-tests --use-static-frameworks'
  168. ]
  169. needs: pod-lib-lint
  170. steps:
  171. - uses: actions/checkout@v4
  172. - uses: ruby/setup-ruby@v1
  173. - name: Setup Bundler
  174. run: scripts/setup_bundler.sh
  175. - name: PodLibLint database Cron
  176. run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb ${{ matrix.podspec }} --platforms=${{ matrix.target }} ${{ matrix.flags }}