database.yml 5.7 KB

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