database.yml 5.9 KB

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