database.yml 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. name: database
  2. on:
  3. pull_request:
  4. paths:
  5. - 'FirebaseDatabase**'
  6. - 'Firebase/Database/**'
  7. - 'Example/Database/**'
  8. - 'Interop/Auth/Public/*.h'
  9. - '.github/workflows/database.yml'
  10. - 'Gemfile'
  11. schedule:
  12. # Run every day at 11pm (PST) - cron uses UTC times
  13. - cron: '0 7 * * *'
  14. jobs:
  15. unit:
  16. # Don't run on private repo unless it is a PR.
  17. if: github.repository != 'FirebasePrivate/firebase-ios-sdk' || github.event_name == 'pull_request'
  18. runs-on: macos-latest
  19. strategy:
  20. matrix:
  21. target: [iOS, tvOS, macOS]
  22. steps:
  23. - uses: actions/checkout@v2
  24. - name: Setup Bundler
  25. run: scripts/setup_bundler.sh
  26. - name: BuildAndTest # can be replaced with pod lib lint with CocoaPods 1.10
  27. run: scripts/third_party/travis/retry.sh scripts/build.sh Database ${{ matrix.target }} unit
  28. integration:
  29. # Don't run on private repo unless it is a PR.
  30. if: github.repository != 'FirebasePrivate/firebase-ios-sdk' || github.event_name == 'pull_request'
  31. runs-on: macos-latest
  32. steps:
  33. - uses: actions/checkout@v2
  34. - name: Setup Bundler
  35. run: scripts/setup_bundler.sh
  36. - name: IntegrationTest
  37. # Only iOS to mitigate flakes.
  38. run: scripts/third_party/travis/retry.sh scripts/build.sh Database iOS integration
  39. catalyst:
  40. # Don't run on private repo unless it is a PR.
  41. if: github.repository != 'FirebasePrivate/firebase-ios-sdk' || github.event_name == 'pull_request'
  42. runs-on: macOS-latest
  43. steps:
  44. - uses: actions/checkout@v2
  45. - name: Setup Bundler
  46. run: scripts/setup_bundler.sh
  47. - name: Setup project and Build for Catalyst
  48. # Only build the unit tests on Catalyst. Test stopped working when GHA moved to Xcode 11.4.1.
  49. run: scripts/test_catalyst.sh FirebaseDatabase build FirebaseDatabase-Unit-unit
  50. quickstart_framework:
  51. env:
  52. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  53. signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  54. FRAMEWORK_ZIP: "Firebase-actions-dir.zip"
  55. SDK: "Database"
  56. runs-on: macOS-latest
  57. # Don't run on private repo.
  58. if: github.event_name == 'schedule' && github.repository != 'FirebasePrivate/firebase-ios-sdk'
  59. steps:
  60. - uses: actions/checkout@v2
  61. - name: Pull zip from GCS
  62. run: scripts/pull_zip_gcloud.sh "$plist_secret" "$FRAMEWORK_ZIP" "${HOME}/ios_frameworks"
  63. - name: Setup quickstart
  64. run: SAMPLE="$SDK" TARGET="${SDK}Example" NON_FIREBASE_SDKS="FirebaseUI/Database" scripts/setup_quickstart_framework.sh \
  65. "${HOME}"/ios_frameworks/Firebase/FirebaseDatabase/* \
  66. "${HOME}"/ios_frameworks/Firebase/FirebaseStorage/* \
  67. "${HOME}"/ios_frameworks/Firebase/FirebaseFirestore/* \
  68. "${HOME}"/ios_frameworks/Firebase/FirebaseAuth/* \
  69. "${HOME}"/ios_frameworks/Firebase/NonFirebaseSDKs/* \
  70. "${HOME}"/ios_frameworks/Firebase/FirebaseAnalytics/*
  71. - name: Install Secret GoogleService-Info.plist
  72. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-database.plist.gpg \
  73. quickstart-ios/database/GoogleService-Info.plist "$plist_secret"
  74. - name: Install Secret FIREGSignInInfo.h
  75. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/FIREGSignInInfo.h.gpg \
  76. quickstart-ios/TestUtils/FIREGSignInInfo.h "$signin_secret"
  77. - name: Test Quickstart
  78. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart_framework.sh "${SDK}")
  79. - name: Remove data before upload
  80. if: ${{ failure() }}
  81. run: scripts/remove_data.sh "${SDK}"
  82. - uses: actions/upload-artifact@v2
  83. if: ${{ failure() }}
  84. with:
  85. name: quickstart_artifacts
  86. path: quickstart-ios/
  87. quickstart:
  88. # Don't run on private repo unless it is a PR.
  89. if: github.repository != 'FirebasePrivate/firebase-ios-sdk' || github.event_name == 'pull_request'
  90. env:
  91. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  92. signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  93. runs-on: macOS-latest
  94. steps:
  95. - uses: actions/checkout@v2
  96. - name: Setup quickstart
  97. run: scripts/setup_quickstart.sh database
  98. - name: Install Secret GoogleService-Info.plist
  99. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-database.plist.gpg \
  100. quickstart-ios/database/GoogleService-Info.plist "$plist_secret"
  101. - name: Install Secret FIREGSignInInfo.h
  102. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/FIREGSignInInfo.h.gpg \
  103. quickstart-ios/TestUtils/FIREGSignInInfo.h "$signin_secret"
  104. - name: Test objc quickstart
  105. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Database)
  106. - name: Test swift quickstart
  107. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Database swift)
  108. pod-lib-lint:
  109. # Don't run on private repo unless it is a PR.
  110. if: github.repository != 'FirebasePrivate/firebase-ios-sdk' || github.event_name == 'pull_request'
  111. runs-on: macOS-latest
  112. strategy:
  113. matrix:
  114. target: [ios, tvos, macos]
  115. steps:
  116. - uses: actions/checkout@v2
  117. - name: Setup Bundler
  118. run: scripts/setup_bundler.sh
  119. - name: Build and test
  120. run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseDatabase.podspec --skip-tests --platforms=${{ matrix.target }}
  121. database-cron-only:
  122. # Don't run on private repo.
  123. if: github.event_name == 'schedule' && github.repository != 'FirebasePrivate/firebase-ios-sdk'
  124. runs-on: macos-latest
  125. strategy:
  126. matrix:
  127. target: [ios, tvos, macos]
  128. flags: [
  129. '--skip-tests --use-modular-headers',
  130. '--skip-tests --use-libraries'
  131. ]
  132. needs: pod-lib-lint
  133. steps:
  134. - uses: actions/checkout@v2
  135. - name: Setup Bundler
  136. run: scripts/setup_bundler.sh
  137. - name: PodLibLint database Cron
  138. run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseDatabase.podspec --platforms=${{ matrix.target }} ${{ matrix.flags }}