functions.yml 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. name: functions
  2. on:
  3. pull_request:
  4. paths:
  5. - 'FirebaseFunctions**'
  6. - 'FirebaseSharedSwift**'
  7. - '.github/workflows/functions.yml'
  8. - 'FirebaseAuth/Interop/*.h'
  9. - 'FirebaseMessaging/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-12
  25. strategy:
  26. matrix:
  27. target: [ios, tvos, macos, watchos]
  28. steps:
  29. - uses: actions/checkout@v2
  30. - uses: ruby/setup-ruby@359bebbc29cbe6c87da6bc9ea3bc930432750108
  31. with:
  32. ruby-version: '2.7'
  33. - name: Setup Bundler
  34. run: scripts/setup_bundler.sh
  35. - name: Integration Test Server
  36. run: FirebaseFunctions/Backend/start.sh synchronous
  37. - name: Build and test
  38. run: |
  39. scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseFunctions.podspec --platforms=${{ matrix.target }}
  40. spm-integration:
  41. # Don't run on private repo unless it is a PR.
  42. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  43. runs-on: macos-12
  44. env:
  45. FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
  46. steps:
  47. - uses: actions/checkout@v2
  48. - uses: mikehardy/buildcache-action@50738c6c77de7f34e66b870e4f8ede333b69d077
  49. with:
  50. cache_key: ${{ matrix.os }}
  51. - name: Initialize xcodebuild
  52. run: scripts/setup_spm_tests.sh
  53. - name: Integration Test Server
  54. run: FirebaseFunctions/Backend/start.sh synchronous
  55. - name: Functions Unit Tests
  56. run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseFunctionsUnit iOS spm
  57. - name: iOS Swift Integration Tests (including Swift library)
  58. run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseFunctionsIntegration iOS spm
  59. - name: iOS ObjC Integration Tests (using Swift library)
  60. run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseFunctionsObjCIntegration iOS spm
  61. - name: Combine Unit Tests
  62. run: scripts/third_party/travis/retry.sh ./scripts/build.sh FunctionsCombineUnit iOS spm
  63. spm-unit:
  64. # Don't run on private repo.
  65. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  66. runs-on: macos-12
  67. strategy:
  68. matrix:
  69. target: [iOS, 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 FirebaseFunctionsUnit ${{ matrix.target }} spm
  79. quickstart:
  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. env:
  83. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  84. signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  85. LEGACY: true
  86. runs-on: macos-12
  87. steps:
  88. - uses: actions/checkout@v2
  89. - uses: actions/checkout@v2
  90. - uses: ruby/setup-ruby@359bebbc29cbe6c87da6bc9ea3bc930432750108
  91. with:
  92. ruby-version: '2.7'
  93. - name: Setup quickstart
  94. run: scripts/setup_quickstart.sh functions
  95. - name: install secret googleservice-info.plist
  96. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-functions.plist.gpg \
  97. quickstart-ios/functions/GoogleService-Info.plist "$plist_secret"
  98. - name: Setup custom URL scheme
  99. run: sed -i '' 's/REVERSED_CLIENT_ID/com.googleusercontent.apps.1025801074639-6p6ebi8amuklcjrto20gvpe295smm8u6/' quickstart-ios/functions/LegacyFunctionsQuickstart/FunctionsExample/Info.plist
  100. - name: Test objc quickstart
  101. run: ([ -z $plist_secret ] ||
  102. scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Functions true)
  103. - name: Test swift quickstart
  104. run: ([ -z $plist_secret ] ||
  105. scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Functions true swift)
  106. functions-cron-only:
  107. # Don't run on private repo.
  108. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  109. runs-on: macos-12
  110. strategy:
  111. matrix:
  112. target: [ios, tvos, macos]
  113. flags: [
  114. '--use-static-frameworks',
  115. ]
  116. needs: pod-lib-lint
  117. steps:
  118. - uses: actions/checkout@v2
  119. - uses: ruby/setup-ruby@359bebbc29cbe6c87da6bc9ea3bc930432750108
  120. with:
  121. ruby-version: '2.7'
  122. - name: Setup Bundler
  123. run: scripts/setup_bundler.sh
  124. - name: Integration Test Server
  125. run: FirebaseFunctions/Backend/start.sh synchronous
  126. - name: PodLibLint Functions Cron
  127. run: |
  128. scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb \
  129. FirebaseFunctions.podspec --platforms=${{ matrix.target }} --use-static-frameworks