database.yml 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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@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@v2
  45. - uses: mikehardy/buildcache-action@50738c6c77de7f34e66b870e4f8ede333b69d077
  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@v2
  65. - uses: mikehardy/buildcache-action@50738c6c77de7f34e66b870e4f8ede333b69d077
  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@v2
  80. - uses: mikehardy/buildcache-action@50738c6c77de7f34e66b870e4f8ede333b69d077
  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. # Disable until FirebaseUI is updated to accept Firebase 9 and quickstart is updated to accept
  89. # Firebase UI 12
  90. # quickstart:
  91. # # Don't run on private repo unless it is a PR.
  92. # if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  93. # env:
  94. # plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  95. # signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  96. # runs-on: macos-12
  97. # steps:
  98. # - uses: actions/checkout@v2
  99. # - name: Setup quickstart
  100. # run: scripts/setup_quickstart.sh database
  101. # - name: Install Secret GoogleService-Info.plist
  102. # run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-database.plist.gpg \
  103. # quickstart-ios/database/GoogleService-Info.plist "$plist_secret"
  104. # - name: Test objc quickstart
  105. # run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Database false)
  106. # - name: Test swift quickstart
  107. # run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Database false swift)
  108. pod-lib-lint:
  109. # Don't run on private repo unless it is a PR.
  110. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  111. runs-on: macos-12
  112. strategy:
  113. matrix:
  114. target: [ios, tvos, macos, watchos]
  115. steps:
  116. - uses: actions/checkout@v2
  117. - uses: ruby/setup-ruby@v1
  118. - name: Setup Bundler
  119. run: scripts/setup_bundler.sh
  120. - name: Build and test
  121. run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseDatabase.podspec --skip-tests --platforms=${{ matrix.target }}
  122. database-cron-only:
  123. # Don't run on private repo.
  124. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  125. runs-on: macos-12
  126. strategy:
  127. matrix:
  128. target: [ios, tvos, macos]
  129. flags: [
  130. '--skip-tests --use-static-frameworks'
  131. ]
  132. needs: pod-lib-lint
  133. steps:
  134. - uses: actions/checkout@v2
  135. - uses: ruby/setup-ruby@v1
  136. - name: Setup Bundler
  137. run: scripts/setup_bundler.sh
  138. - name: PodLibLint database Cron
  139. run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseDatabase.podspec --platforms=${{ matrix.target }} ${{ matrix.flags }}