functions.yml 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. name: functions
  2. on:
  3. pull_request:
  4. paths:
  5. - 'FirebaseFunctions/**'
  6. - '.github/workflows/functions.yml'
  7. - 'Interop/Auth/Public/*.h'
  8. - 'FirebaseMessaging/Sources/Interop/*.h'
  9. - 'FirebaseTestingSupport/Functions/**'
  10. - 'FirebaseCombineSwift/Sources/Functions/**'
  11. - 'scripts/setup_quickstart.sh'
  12. - 'Gemfile*'
  13. schedule:
  14. # Run every day at 3am (PST) - cron uses UTC times
  15. - cron: '0 11 * * *'
  16. jobs:
  17. pod-lib-lint:
  18. # Don't run on private repo unless it is a PR.
  19. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  20. runs-on: macos-11
  21. strategy:
  22. matrix:
  23. target: [ios, tvos, macos, watchos]
  24. steps:
  25. - uses: actions/checkout@v2
  26. - name: Setup Bundler
  27. run: scripts/setup_bundler.sh
  28. - name: Integration Test Server
  29. run: FirebaseFunctions/Backend/start.sh synchronous
  30. - name: Build and test
  31. run: |
  32. scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseFunctions.podspec \
  33. --platforms=${{ matrix.target }}
  34. spm:
  35. # Don't run on private repo unless it is a PR.
  36. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  37. runs-on: macos-11
  38. steps:
  39. - uses: actions/checkout@v2
  40. - uses: mikehardy/buildcache-action@50738c6c77de7f34e66b870e4f8ede333b69d077
  41. with:
  42. cache_key: ${{ matrix.os }}
  43. - name: Initialize xcodebuild
  44. run: scripts/setup_spm_tests.sh
  45. - name: iOS Unit Tests
  46. run: scripts/third_party/travis/retry.sh ./scripts/build.sh FunctionsUnit iOS spm
  47. - name: Integration Test Server
  48. run: FirebaseFunctions/Backend/start.sh synchronous
  49. - name: iOS Swift Integration Tests (Objective C library)
  50. run: scripts/third_party/travis/retry.sh ./scripts/build.sh FunctionsSwiftIntegration iOS spm
  51. - name: iOS Swift Integration Tests (including Swift library)
  52. run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseFunctionsSwiftUnit iOS spm
  53. - name: iOS Objective C Integration Tests
  54. run: scripts/third_party/travis/retry.sh ./scripts/build.sh FunctionsIntegration iOS spm
  55. - name: Combine Unit Tests
  56. run: scripts/third_party/travis/retry.sh ./scripts/build.sh FunctionsCombineUnit iOS spm
  57. spm-cron:
  58. # Don't run on private repo.
  59. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  60. runs-on: macos-11
  61. strategy:
  62. matrix:
  63. target: [tvOS, macOS, catalyst]
  64. steps:
  65. - uses: actions/checkout@v2
  66. - uses: mikehardy/buildcache-action@50738c6c77de7f34e66b870e4f8ede333b69d077
  67. with:
  68. cache_key: ${{ matrix.os }}
  69. - name: Initialize xcodebuild
  70. run: scripts/setup_spm_tests.sh
  71. - name: Unit Tests
  72. run: scripts/third_party/travis/retry.sh ./scripts/build.sh FunctionsUnit ${{ matrix.target }} spm
  73. catalyst:
  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. runs-on: macos-11
  77. steps:
  78. - uses: actions/checkout@v2
  79. - uses: mikehardy/buildcache-action@50738c6c77de7f34e66b870e4f8ede333b69d077
  80. with:
  81. cache_key: ${{ matrix.os }}
  82. - name: Setup Bundler
  83. run: scripts/setup_bundler.sh
  84. - name: Setup project and Build for Catalyst
  85. run: scripts/test_catalyst.sh FirebaseFunctions test FirebaseFunctions-Unit-unit
  86. # Restore when FirebaseUI works with Firebase 7 (#6646)
  87. quickstart:
  88. # Don't run on private repo unless it is a PR.
  89. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  90. env:
  91. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  92. signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  93. runs-on: macos-11
  94. steps:
  95. - uses: actions/checkout@v2
  96. - name: Setup quickstart
  97. run: scripts/setup_quickstart.sh functions
  98. - name: install secret googleservice-info.plist
  99. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-functions.plist.gpg \
  100. quickstart-ios/functions/GoogleService-Info.plist "$plist_secret"
  101. - name: Setup custom URL scheme
  102. run: sed -i '' 's/REVERSED_CLIENT_ID/com.googleusercontent.apps.1025801074639-6p6ebi8amuklcjrto20gvpe295smm8u6/' quickstart-ios/functions/FunctionsExample/Info.plist
  103. - name: Test objc quickstart
  104. run: ([ -z $plist_secret ] ||
  105. scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Functions true)
  106. - name: Test swift quickstart
  107. run: ([ -z $plist_secret ] ||
  108. scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Functions true swift)
  109. functions-cron-only:
  110. # Don't run on private repo.
  111. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  112. runs-on: macos-11
  113. strategy:
  114. matrix:
  115. target: [ios, tvos, macos]
  116. flags: [
  117. '--use-static-frameworks',
  118. '--use-libraries --skip-tests'
  119. ]
  120. needs: pod-lib-lint
  121. steps:
  122. - uses: actions/checkout@v2
  123. - name: Setup Bundler
  124. run: scripts/setup_bundler.sh
  125. - name: Integration Test Server
  126. run: FirebaseFunctions/Backend/start.sh synchronous
  127. - name: PodLibLint Functions Cron
  128. run: |
  129. scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb \
  130. FirebaseFunctions.podspec --platforms=${{ matrix.target }} ${{ matrix.flags }}
  131. #TODO - reenable once there's a tag with the new directory structure. See #8918 and #8299
  132. # podspec-presubmit:
  133. # Don't run on private repo unless it is a PR.
  134. # if: github.repository == 'Firebase/firebase-ios-sdk' && github.event.pull_request.merged != true && github.event.action != 'closed'
  135. # runs-on: macos-11
  136. # steps:
  137. # - uses: actions/checkout@v2
  138. # - name: Setup Bundler
  139. # run: scripts/setup_bundler.sh
  140. # - name: Build and test
  141. # run: scripts/third_party/travis/retry.sh pod spec lint FirebaseFunctions.podspec --skip-tests --sources='https://github.com/firebase/SpecsTesting','https://github.com/firebase/SpecsDev.git','https://github.com/firebase/SpecsStaging.git','https://cdn.cocoapods.org/'