functions.yml 5.7 KB

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