database.yml 6.7 KB

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