database.yml 5.8 KB

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