database.yml 5.5 KB

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