database.yml 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  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. unit:
  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. runs-on: macos-12
  24. strategy:
  25. matrix:
  26. target: [iOS, tvOS, macOS]
  27. steps:
  28. - uses: actions/checkout@v2
  29. - uses: mikehardy/buildcache-action@50738c6c77de7f34e66b870e4f8ede333b69d077
  30. with:
  31. cache_key: ${{ matrix.os }}
  32. - uses: ruby/setup-ruby@359bebbc29cbe6c87da6bc9ea3bc930432750108
  33. with:
  34. ruby-version: '2.7'
  35. - name: Setup Bundler
  36. run: scripts/setup_bundler.sh
  37. - name: Install xcpretty
  38. run: gem install xcpretty
  39. - name: BuildAndTest # can be replaced with pod lib lint with CocoaPods 1.10
  40. run: scripts/third_party/travis/retry.sh scripts/build.sh Database ${{ matrix.target }} unit
  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-12
  45. steps:
  46. - uses: actions/checkout@v2
  47. - uses: mikehardy/buildcache-action@50738c6c77de7f34e66b870e4f8ede333b69d077
  48. with:
  49. cache_key: ${{ matrix.os }}
  50. - uses: ruby/setup-ruby@359bebbc29cbe6c87da6bc9ea3bc930432750108
  51. with:
  52. ruby-version: '2.7'
  53. - name: Setup Bundler
  54. run: scripts/setup_bundler.sh
  55. - name: Install xcpretty
  56. run: gem install xcpretty
  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:
  61. # Don't run on private repo unless it is a PR.
  62. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  63. runs-on: macos-12
  64. strategy:
  65. matrix:
  66. target: [iOS, tvOS, macOS, catalyst, watchOS]
  67. steps:
  68. - uses: actions/checkout@v2
  69. - uses: mikehardy/buildcache-action@50738c6c77de7f34e66b870e4f8ede333b69d077
  70. with:
  71. cache_key: ${{ matrix.os }}
  72. - name: Initialize xcodebuild
  73. run: scripts/setup_spm_tests.sh
  74. - name: Unit Tests
  75. run: scripts/third_party/travis/retry.sh ./scripts/build.sh DatabaseUnit ${{ matrix.target }} spm
  76. - name: iOS Swift Unit Tests
  77. run: scripts/third_party/travis/retry.sh ./scripts/build.sh DatabaseUnitSwift ${{ matrix.target }} spm
  78. catalyst:
  79. # Don't run on private repo unless it is a PR.
  80. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  81. runs-on: macos-12
  82. steps:
  83. - uses: actions/checkout@v2
  84. - uses: mikehardy/buildcache-action@50738c6c77de7f34e66b870e4f8ede333b69d077
  85. with:
  86. cache_key: ${{ matrix.os }}
  87. - uses: ruby/setup-ruby@359bebbc29cbe6c87da6bc9ea3bc930432750108
  88. with:
  89. ruby-version: '2.7'
  90. - name: Setup Bundler
  91. run: scripts/setup_bundler.sh
  92. - name: Setup project and Build for Catalyst
  93. run: scripts/test_catalyst.sh FirebaseDatabase test FirebaseDatabase-Unit-unit
  94. # Disable until FirebaseUI is updated to accept Firebase 9 and quickstart is updated to accept
  95. # Firebase UI 12
  96. # quickstart:
  97. # # Don't run on private repo unless it is a PR.
  98. # if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  99. # env:
  100. # plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  101. # signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  102. # runs-on: macos-12
  103. # steps:
  104. # - uses: actions/checkout@v2
  105. # - name: Setup quickstart
  106. # run: scripts/setup_quickstart.sh database
  107. # - name: Install Secret GoogleService-Info.plist
  108. # run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-database.plist.gpg \
  109. # quickstart-ios/database/GoogleService-Info.plist "$plist_secret"
  110. # - name: Test objc quickstart
  111. # run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Database false)
  112. # - name: Test swift quickstart
  113. # run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Database false swift)
  114. pod-lib-lint:
  115. # Don't run on private repo unless it is a PR.
  116. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  117. runs-on: macos-12
  118. strategy:
  119. matrix:
  120. target: [ios, tvos, macos, watchos]
  121. steps:
  122. - uses: actions/checkout@v2
  123. - uses: ruby/setup-ruby@359bebbc29cbe6c87da6bc9ea3bc930432750108
  124. with:
  125. ruby-version: '2.7'
  126. - name: Setup Bundler
  127. run: scripts/setup_bundler.sh
  128. - name: Build and test
  129. run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseDatabase.podspec --skip-tests --platforms=${{ matrix.target }}
  130. database-cron-only:
  131. # Don't run on private repo.
  132. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  133. runs-on: macos-12
  134. strategy:
  135. matrix:
  136. target: [ios, tvos, macos]
  137. flags: [
  138. '--skip-tests --use-static-frameworks'
  139. ]
  140. needs: pod-lib-lint
  141. steps:
  142. - uses: actions/checkout@v2
  143. - uses: ruby/setup-ruby@359bebbc29cbe6c87da6bc9ea3bc930432750108
  144. with:
  145. ruby-version: '2.7'
  146. - name: Setup Bundler
  147. run: scripts/setup_bundler.sh
  148. - name: PodLibLint database Cron
  149. run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseDatabase.podspec --platforms=${{ matrix.target }} ${{ matrix.flags }}