functions.yml 5.8 KB

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