database.yml 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  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: IntegrationTest
  53. # Only iOS to mitigate flakes.
  54. run: scripts/third_party/travis/retry.sh scripts/build.sh Database iOS integration
  55. spm-package-resolved:
  56. env:
  57. FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
  58. runs-on: macos-14
  59. outputs:
  60. cache_key: ${{ steps.generate_cache_key.outputs.cache_key }}
  61. steps:
  62. - uses: actions/checkout@v4
  63. - name: Generate Swift Package.resolved
  64. id: swift_package_resolve
  65. run: |
  66. swift package resolve
  67. - name: Generate cache key
  68. id: generate_cache_key
  69. run: |
  70. cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}"
  71. echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT"
  72. - uses: actions/cache/save@v4
  73. id: cache
  74. with:
  75. path: .build
  76. key: ${{ steps.generate_cache_key.outputs.cache_key }}
  77. spm:
  78. # Don't run on private repo unless it is a PR.
  79. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  80. needs: [spm-package-resolved]
  81. strategy:
  82. matrix:
  83. include:
  84. - os: macos-13
  85. xcode: Xcode_15.2
  86. target: iOS
  87. - os: macos-14
  88. xcode: Xcode_15.4
  89. target: iOS
  90. - os: macos-15
  91. xcode: Xcode_16
  92. target: iOS
  93. - os: macos-15
  94. xcode: Xcode_16
  95. target: tvOS
  96. - os: macos-15
  97. xcode: Xcode_16
  98. target: macOS
  99. - os: macos-15
  100. xcode: Xcode_16
  101. target: watchOS
  102. - os: macos-15
  103. xcode: Xcode_16
  104. target: catalyst
  105. - os: macos-15
  106. xcode: Xcode_16
  107. target: visionOS
  108. runs-on: ${{ matrix.os }}
  109. steps:
  110. - uses: actions/checkout@v4
  111. - uses: actions/cache/restore@v4
  112. with:
  113. path: .build
  114. key: ${{needs.spm-package-resolved.outputs.cache_key}}
  115. - name: Xcode
  116. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  117. - name: Initialize xcodebuild
  118. run: scripts/setup_spm_tests.sh
  119. - name: Unit Tests
  120. run: scripts/third_party/travis/retry.sh ./scripts/build.sh DatabaseUnit ${{ matrix.target }} spm
  121. - name: iOS Swift Unit Tests
  122. run: scripts/third_party/travis/retry.sh ./scripts/build.sh DatabaseUnitSwift ${{ matrix.target }} spm
  123. catalyst:
  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-14
  127. steps:
  128. - uses: actions/checkout@v4
  129. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  130. with:
  131. cache_key: catalyst${{ matrix.os }}
  132. - uses: ruby/setup-ruby@v1
  133. - name: Setup Bundler
  134. run: scripts/setup_bundler.sh
  135. - name: Setup project and Build for Catalyst
  136. run: scripts/test_catalyst.sh FirebaseDatabase test FirebaseDatabase-Unit-unit
  137. quickstart:
  138. # Don't run on private repo unless it is a PR.
  139. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  140. env:
  141. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  142. signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  143. runs-on: macos-14
  144. steps:
  145. - uses: actions/checkout@v4
  146. - uses: ruby/setup-ruby@v1
  147. - name: Setup quickstart
  148. run: scripts/setup_quickstart.sh database
  149. - name: Install Secret GoogleService-Info.plist
  150. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-database.plist.gpg \
  151. quickstart-ios/database/GoogleService-Info.plist "$plist_secret"
  152. - name: Test objc quickstart
  153. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Database false)
  154. - name: Test swift quickstart
  155. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Database false swift)
  156. database-cron-only:
  157. # Don't run on private repo.
  158. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  159. runs-on: macos-14
  160. strategy:
  161. matrix:
  162. podspec: [FirebaseDatabase.podspec]
  163. target: [ios, tvos, macos]
  164. flags: [
  165. '--skip-tests --use-static-frameworks'
  166. ]
  167. needs: pod-lib-lint
  168. steps:
  169. - uses: actions/checkout@v4
  170. - uses: ruby/setup-ruby@v1
  171. - name: Setup Bundler
  172. run: scripts/setup_bundler.sh
  173. - name: PodLibLint database Cron
  174. run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb ${{ matrix.podspec }} --platforms=${{ matrix.target }} ${{ matrix.flags }}