database.yml 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. name: database
  2. on:
  3. pull_request:
  4. paths:
  5. - 'FirebaseDatabase**'
  6. - 'Firebase/Database/**'
  7. - 'Example/Database/**'
  8. - 'Interop/Auth/Public/*.h'
  9. - '.github/workflows/database.yml'
  10. - 'Gemfile*'
  11. - 'scripts/run_database_emulator.sh'
  12. schedule:
  13. # Run every day at 2am (PST) - cron uses UTC times
  14. - cron: '0 10 * * *'
  15. jobs:
  16. unit:
  17. # Don't run on private repo unless it is a PR.
  18. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  19. runs-on: macos-11
  20. strategy:
  21. matrix:
  22. target: [iOS, tvOS, macOS]
  23. steps:
  24. - uses: actions/checkout@v2
  25. - uses: mikehardy/buildcache-action@50738c6c77de7f34e66b870e4f8ede333b69d077
  26. with:
  27. cache_key: ${{ matrix.os }}
  28. - name: Setup Bundler
  29. run: scripts/setup_bundler.sh
  30. - name: BuildAndTest # can be replaced with pod lib lint with CocoaPods 1.10
  31. run: scripts/third_party/travis/retry.sh scripts/build.sh Database ${{ matrix.target }} unit
  32. integration:
  33. # Don't run on private repo unless it is a PR.
  34. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  35. runs-on: macos-11
  36. steps:
  37. - uses: actions/checkout@v2
  38. - uses: mikehardy/buildcache-action@50738c6c77de7f34e66b870e4f8ede333b69d077
  39. with:
  40. cache_key: ${{ matrix.os }}
  41. - name: Setup Bundler
  42. run: scripts/setup_bundler.sh
  43. - name: IntegrationTest
  44. # Only iOS to mitigate flakes.
  45. run: scripts/third_party/travis/retry.sh scripts/build.sh Database iOS integration
  46. spm:
  47. # Don't run on private repo unless it is a PR.
  48. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  49. runs-on: macos-11
  50. steps:
  51. - uses: actions/checkout@v2
  52. - uses: mikehardy/buildcache-action@50738c6c77de7f34e66b870e4f8ede333b69d077
  53. with:
  54. cache_key: ${{ matrix.os }}
  55. - name: Initialize xcodebuild
  56. run: scripts/setup_spm_tests.sh
  57. - name: iOS Unit Tests
  58. run: scripts/third_party/travis/retry.sh ./scripts/build.sh DatabaseUnit iOS spm
  59. - name: iOS Swift Unit Tests
  60. run: scripts/third_party/travis/retry.sh ./scripts/build.sh DatabaseUnitSwift iOS spm
  61. spm-cron:
  62. # Don't run on private repo.
  63. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  64. runs-on: macos-11
  65. strategy:
  66. matrix:
  67. target: [tvOS, macOS, catalyst]
  68. steps:
  69. - uses: actions/checkout@v2
  70. - uses: mikehardy/buildcache-action@50738c6c77de7f34e66b870e4f8ede333b69d077
  71. with:
  72. cache_key: ${{ matrix.os }}
  73. - name: Initialize xcodebuild
  74. run: scripts/setup_spm_tests.sh
  75. - name: Unit Tests
  76. run: scripts/third_party/travis/retry.sh ./scripts/build.sh DatabaseUnit ${{ matrix.target }} spm
  77. - name: iOS Swift Unit Tests
  78. run: scripts/third_party/travis/retry.sh ./scripts/build.sh DatabaseUnitSwift ${{ matrix.target }} spm
  79. catalyst:
  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. runs-on: macos-11
  83. steps:
  84. - uses: actions/checkout@v2
  85. - uses: mikehardy/buildcache-action@50738c6c77de7f34e66b870e4f8ede333b69d077
  86. with:
  87. cache_key: ${{ matrix.os }}
  88. - name: Setup Bundler
  89. run: scripts/setup_bundler.sh
  90. - name: Setup project and Build for Catalyst
  91. run: scripts/test_catalyst.sh FirebaseDatabase test FirebaseDatabase-Unit-unit
  92. # Restore when FirebaseUI works with Firebase 7 (#6646)
  93. quickstart:
  94. # Don't run on private repo unless it is a PR.
  95. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  96. env:
  97. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  98. signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  99. runs-on: macos-11
  100. steps:
  101. - uses: actions/checkout@v2
  102. - name: Setup quickstart
  103. run: scripts/setup_quickstart.sh database
  104. - name: Install Secret GoogleService-Info.plist
  105. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-database.plist.gpg \
  106. quickstart-ios/database/GoogleService-Info.plist "$plist_secret"
  107. - name: Test objc quickstart
  108. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Database false)
  109. - name: Test swift quickstart
  110. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Database false swift)
  111. pod-lib-lint:
  112. # Don't run on private repo unless it is a PR.
  113. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  114. runs-on: macos-11
  115. strategy:
  116. matrix:
  117. target: [ios, tvos, macos, watchos]
  118. steps:
  119. - uses: actions/checkout@v2
  120. - name: Setup Bundler
  121. run: scripts/setup_bundler.sh
  122. - name: Build and test
  123. run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseDatabase.podspec --skip-tests --platforms=${{ matrix.target }}
  124. database-cron-only:
  125. # Don't run on private repo.
  126. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  127. runs-on: macos-11
  128. strategy:
  129. matrix:
  130. target: [ios, tvos, macos]
  131. flags: [
  132. '--skip-tests --use-static-frameworks',
  133. '--skip-tests --use-libraries'
  134. ]
  135. needs: pod-lib-lint
  136. steps:
  137. - uses: actions/checkout@v2
  138. - name: Setup Bundler
  139. run: scripts/setup_bundler.sh
  140. - name: PodLibLint database Cron
  141. run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseDatabase.podspec --platforms=${{ matrix.target }} ${{ matrix.flags }}
  142. podspec-presubmit:
  143. # Don't run on private repo unless it is a PR.
  144. if: github.repository == 'Firebase/firebase-ios-sdk' && github.event.pull_request.merged != true && github.event.action != 'closed'
  145. runs-on: macos-11
  146. steps:
  147. - uses: actions/checkout@v2
  148. - name: Setup Bundler
  149. run: scripts/setup_bundler.sh
  150. - name: Build and test
  151. run: scripts/third_party/travis/retry.sh pod spec lint FirebaseDatabase.podspec --skip-tests --sources='https://github.com/firebase/SpecsTesting','https://github.com/firebase/SpecsDev.git','https://github.com/firebase/SpecsStaging.git','https://cdn.cocoapods.org/'