functions.yml 5.9 KB

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