database.yml 5.6 KB

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