functions.yml 5.0 KB

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