database.yml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. name: database
  2. on:
  3. workflow_dispatch:
  4. pull_request:
  5. paths:
  6. - 'FirebaseDatabase**'
  7. - 'Firebase/Database/**'
  8. - 'FirebaseSharedSwift**'
  9. - 'Example/Database/**'
  10. - 'FirebaseAuth/Interop/*.h'
  11. - '.github/workflows/database.yml'
  12. - 'Gemfile*'
  13. - 'scripts/run_database_emulator.sh'
  14. schedule:
  15. # Run every day at 2am (PST) - cron uses UTC times
  16. - cron: '0 10 * * *'
  17. concurrency:
  18. group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
  19. cancel-in-progress: true
  20. jobs:
  21. spm:
  22. strategy:
  23. matrix:
  24. target: [DatabaseUnit, DatabaseUnitSwift]
  25. uses: ./.github/workflows/common.yml
  26. with:
  27. target: ${{ matrix.target }}
  28. catalyst:
  29. uses: ./.github/workflows/common_catalyst.yml
  30. with:
  31. product: FirebaseDatabase
  32. target: FirebaseDatabase-Unit-unit
  33. pod-lib-lint:
  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. strategy:
  37. matrix:
  38. target: [ios, tvos, macos --skip-tests, watchos]
  39. build-env:
  40. - os: macos-14
  41. xcode: Xcode_16.2
  42. - os: macos-15
  43. xcode: Xcode_16.2
  44. runs-on: ${{ matrix.build-env.os }}
  45. steps:
  46. - uses: actions/checkout@v4
  47. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  48. - name: Setup Bundler
  49. run: scripts/setup_bundler.sh
  50. - name: Xcode
  51. run: sudo xcode-select -s /Applications/${{ matrix.build-env.xcode }}.app/Contents/Developer
  52. - name: Build and test
  53. run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseDatabase.podspec --test-specs=unit --platforms=${{ matrix.target }}
  54. integration:
  55. # Don't run on private repo unless it is a PR.
  56. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  57. runs-on: macos-15
  58. steps:
  59. - uses: actions/checkout@v4
  60. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  61. with:
  62. cache_key: integration${{ matrix.os }}
  63. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  64. - name: Setup Bundler
  65. run: scripts/setup_bundler.sh
  66. - name: Install xcpretty
  67. run: gem install xcpretty
  68. - name: Xcode
  69. run: sudo xcode-select -s /Applications/Xcode_16.3.app/Contents/Developer
  70. - name: IntegrationTest
  71. # Only iOS to mitigate flakes.
  72. run: scripts/third_party/travis/retry.sh scripts/build.sh Database iOS integration
  73. quickstart:
  74. # Don't run on private repo unless it is a PR.
  75. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  76. env:
  77. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  78. signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  79. runs-on: macos-15
  80. steps:
  81. - uses: actions/checkout@v4
  82. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  83. - name: Setup quickstart
  84. run: scripts/setup_quickstart.sh database
  85. - name: Install Secret GoogleService-Info.plist
  86. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-database.plist.gpg \
  87. quickstart-ios/database/GoogleService-Info.plist "$plist_secret"
  88. - name: Xcode
  89. run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
  90. - name: Test objc quickstart
  91. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Database false)
  92. - name: Test swift quickstart
  93. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Database false swift)
  94. database-cron-only:
  95. # Don't run on private repo.
  96. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  97. runs-on: macos-15
  98. strategy:
  99. matrix:
  100. podspec: [FirebaseDatabase.podspec]
  101. target: [ios, tvos, macos]
  102. flags: [
  103. '--skip-tests --use-static-frameworks'
  104. ]
  105. needs: pod-lib-lint
  106. steps:
  107. - uses: actions/checkout@v4
  108. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  109. - name: Xcode
  110. run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
  111. - name: Setup Bundler
  112. run: scripts/setup_bundler.sh
  113. - name: PodLibLint database Cron
  114. run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb ${{ matrix.podspec }} --platforms=${{ matrix.target }} ${{ matrix.flags }}