database.yml 5.2 KB

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