database.yml 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  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-14, macos-13]
  28. include:
  29. - os: macos-14
  30. xcode: Xcode_15.3
  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-14
  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. max-parallel: 1
  67. matrix:
  68. target: [iOS, tvOS, macOS, catalyst, watchOS]
  69. os: [macos-13, macos-14]
  70. include:
  71. - os: macos-13
  72. xcode: Xcode_15.2
  73. - os: macos-14
  74. xcode: Xcode_15.3
  75. - os: macos-14
  76. xcode: Xcode_15.3
  77. target: visionOS
  78. runs-on: ${{ matrix.os }}
  79. steps:
  80. - uses: actions/checkout@v4
  81. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  82. with:
  83. cache_key: spm${{ matrix.os }}-${{ matrix.xcode }}-${{ matrix.target }}
  84. - name: Xcode
  85. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  86. - name: Initialize xcodebuild
  87. run: scripts/setup_spm_tests.sh
  88. - name: Unit Tests
  89. run: scripts/third_party/travis/retry.sh ./scripts/build.sh DatabaseUnit ${{ matrix.target }} spm
  90. - name: iOS Swift Unit Tests
  91. run: scripts/third_party/travis/retry.sh ./scripts/build.sh DatabaseUnitSwift ${{ matrix.target }} spm
  92. catalyst:
  93. # Don't run on private repo unless it is a PR.
  94. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  95. runs-on: macos-14
  96. steps:
  97. - uses: actions/checkout@v4
  98. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  99. with:
  100. cache_key: catalyst${{ matrix.os }}
  101. - uses: ruby/setup-ruby@v1
  102. - name: Setup Bundler
  103. run: scripts/setup_bundler.sh
  104. - name: Setup project and Build for Catalyst
  105. run: scripts/test_catalyst.sh FirebaseDatabase test FirebaseDatabase-Unit-unit
  106. quickstart:
  107. # Don't run on private repo unless it is a PR.
  108. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  109. env:
  110. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  111. signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  112. runs-on: macos-14
  113. steps:
  114. - uses: actions/checkout@v4
  115. - uses: ruby/setup-ruby@v1
  116. - name: Setup quickstart
  117. run: scripts/setup_quickstart.sh database
  118. - name: Install Secret GoogleService-Info.plist
  119. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-database.plist.gpg \
  120. quickstart-ios/database/GoogleService-Info.plist "$plist_secret"
  121. - name: Test objc quickstart
  122. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Database false)
  123. - name: Test swift quickstart
  124. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Database false swift)
  125. database-cron-only:
  126. # Don't run on private repo.
  127. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  128. runs-on: macos-14
  129. strategy:
  130. matrix:
  131. podspec: [FirebaseDatabase.podspec]
  132. target: [ios, tvos, macos]
  133. flags: [
  134. '--skip-tests --use-static-frameworks'
  135. ]
  136. needs: pod-lib-lint
  137. steps:
  138. - uses: actions/checkout@v4
  139. - uses: ruby/setup-ruby@v1
  140. - name: Setup Bundler
  141. run: scripts/setup_bundler.sh
  142. - name: PodLibLint database Cron
  143. run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb ${{ matrix.podspec }} --platforms=${{ matrix.target }} ${{ matrix.flags }}