database.yml 5.4 KB

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