vertexai.yml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. name: vertexai
  2. on:
  3. pull_request:
  4. paths:
  5. - 'FirebaseVertexAI**'
  6. - '.github/workflows/vertexai.yml'
  7. - 'Gemfile*'
  8. schedule:
  9. # Run every day at 11pm (PST) - cron uses UTC times
  10. - cron: '0 7 * * *'
  11. concurrency:
  12. group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
  13. cancel-in-progress: true
  14. jobs:
  15. spm-package-resolved:
  16. runs-on: macos-14
  17. outputs:
  18. cache_key: ${{ steps.generate_cache_key.outputs.cache_key }}
  19. env:
  20. FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
  21. steps:
  22. - uses: actions/checkout@v4
  23. - name: Generate Swift Package.resolved
  24. id: swift_package_resolve
  25. run: |
  26. swift package resolve
  27. - name: Generate cache key
  28. id: generate_cache_key
  29. run: |
  30. cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}"
  31. echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT"
  32. - uses: actions/cache/save@v4
  33. id: cache
  34. with:
  35. path: .build
  36. key: ${{ steps.generate_cache_key.outputs.cache_key }}
  37. spm-unit:
  38. strategy:
  39. matrix:
  40. include:
  41. - os: macos-13
  42. xcode: Xcode_15.2
  43. target: iOS
  44. - os: macos-14
  45. xcode: Xcode_15.4
  46. target: iOS
  47. - os: macos-15
  48. xcode: Xcode_16
  49. target: iOS
  50. - os: macos-15
  51. xcode: Xcode_16
  52. target: tvOS
  53. - os: macos-15
  54. xcode: Xcode_16
  55. target: macOS
  56. - os: macos-15
  57. xcode: Xcode_16
  58. target: watchOS
  59. - os: macos-15
  60. xcode: Xcode_16
  61. target: catalyst
  62. - os: macos-15
  63. xcode: Xcode_16
  64. target: visionOS
  65. runs-on: ${{ matrix.os }}
  66. needs: spm-package-resolved
  67. env:
  68. FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
  69. steps:
  70. - uses: actions/checkout@v4
  71. - uses: actions/cache/restore@v4
  72. with:
  73. path: .build
  74. key: ${{needs.spm-package-resolved.outputs.cache_key}}
  75. - name: Clone mock responses
  76. run: scripts/update_vertexai_responses.sh
  77. - name: Xcode
  78. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  79. - name: Initialize xcodebuild
  80. run: scripts/setup_spm_tests.sh
  81. - uses: nick-fields/retry@v3
  82. with:
  83. timeout_minutes: 120
  84. max_attempts: 3
  85. retry_on: error
  86. retry_wait_seconds: 120
  87. command: scripts/build.sh FirebaseVertexAIUnit ${{ matrix.target }} spm
  88. spm-integration:
  89. strategy:
  90. matrix:
  91. target: [iOS]
  92. os: [macos-14]
  93. include:
  94. - os: macos-14
  95. xcode: Xcode_15.2
  96. runs-on: ${{ matrix.os }}
  97. needs: spm-package-resolved
  98. env:
  99. TEST_RUNNER_VertexAIRunIntegrationTests: 1
  100. FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
  101. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  102. steps:
  103. - uses: actions/checkout@v4
  104. - uses: actions/cache/restore@v4
  105. with:
  106. path: .build
  107. key: ${{needs.spm-package-resolved.outputs.cache_key}}
  108. - name: Install Secret GoogleService-Info.plist
  109. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/vertexai-integration.plist.gpg \
  110. FirebaseVertexAI/Tests/Integration/Resources/GoogleService-Info.plist "$plist_secret"
  111. - name: Xcode
  112. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  113. - name: Initialize xcodebuild
  114. run: scripts/setup_spm_tests.sh
  115. - uses: nick-fields/retry@v3
  116. with:
  117. timeout_minutes: 120
  118. max_attempts: 3
  119. retry_on: error
  120. retry_wait_seconds: 120
  121. command: scripts/build.sh FirebaseVertexAIIntegration ${{ matrix.target }} spm
  122. pod-lib-lint:
  123. # Don't run on private repo unless it is a PR.
  124. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  125. strategy:
  126. matrix:
  127. target: [ios]
  128. os: [macos-14]
  129. include:
  130. - os: macos-14
  131. xcode: Xcode_15.2
  132. runs-on: ${{ matrix.os }}
  133. steps:
  134. - uses: actions/checkout@v4
  135. - name: Clone mock responses
  136. run: scripts/update_vertexai_responses.sh
  137. - uses: ruby/setup-ruby@v1
  138. - name: Setup Bundler
  139. run: scripts/setup_bundler.sh
  140. - name: Xcode
  141. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  142. - name: Build and test
  143. run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseVertexAI.podspec --platforms=${{ matrix.target }}
  144. sample:
  145. strategy:
  146. matrix:
  147. include:
  148. - os: macos-13
  149. xcode: Xcode_15.2
  150. - os: macos-14
  151. xcode: Xcode_15.4
  152. - os: macos-15
  153. xcode: Xcode_16
  154. runs-on: ${{ matrix.os }}
  155. needs: spm-package-resolved
  156. env:
  157. FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
  158. steps:
  159. - uses: actions/checkout@v4
  160. - uses: actions/cache/restore@v4
  161. with:
  162. path: .build
  163. key: ${{needs.spm-package-resolved.outputs.cache_key}}
  164. - name: Xcode
  165. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  166. - name: Placeholder GoogleService-Info.plist for build testing
  167. run: cp FirebaseCore/Tests/Unit/Resources/GoogleService-Info.plist FirebaseVertexAI/Sample/
  168. - uses: nick-fields/retry@v3
  169. with:
  170. timeout_minutes: 120
  171. max_attempts: 3
  172. retry_on: error
  173. retry_wait_seconds: 120
  174. command: scripts/build.sh VertexSample iOS