vertexai.yml 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  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. testapp-integration:
  89. strategy:
  90. matrix:
  91. target: [iOS]
  92. os: [macos-15]
  93. include:
  94. - os: macos-15
  95. xcode: Xcode_16
  96. runs-on: ${{ matrix.os }}
  97. needs: spm-package-resolved
  98. env:
  99. TEST_RUNNER_FIRAAppCheckDebugToken: ${{ secrets.VERTEXAI_INTEGRATION_FAC_DEBUG_TOKEN }}
  100. FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
  101. secrets_passphrase: ${{ 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/TestApp-GoogleService-Info.plist.gpg \
  110. FirebaseVertexAI/Tests/TestApp/Resources/GoogleService-Info.plist "$secrets_passphrase"
  111. - name: Install Secret Credentials.swift
  112. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/VertexAI/TestApp-Credentials.swift.gpg \
  113. FirebaseVertexAI/Tests/TestApp/Tests/Integration/Credentials.swift "$secrets_passphrase"
  114. - name: Xcode
  115. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  116. - name: Run IntegrationTests
  117. run: scripts/build.sh VertexIntegration ${{ matrix.target }}
  118. pod-lib-lint:
  119. # Don't run on private repo unless it is a PR.
  120. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  121. strategy:
  122. matrix:
  123. target: [ios]
  124. os: [macos-14]
  125. include:
  126. - os: macos-14
  127. xcode: Xcode_15.2
  128. runs-on: ${{ matrix.os }}
  129. steps:
  130. - uses: actions/checkout@v4
  131. - name: Clone mock responses
  132. run: scripts/update_vertexai_responses.sh
  133. - uses: ruby/setup-ruby@v1
  134. - name: Setup Bundler
  135. run: scripts/setup_bundler.sh
  136. - name: Xcode
  137. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  138. - name: Build and test
  139. run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseVertexAI.podspec --platforms=${{ matrix.target }}
  140. sample:
  141. strategy:
  142. matrix:
  143. include:
  144. - os: macos-13
  145. xcode: Xcode_15.2
  146. - os: macos-14
  147. xcode: Xcode_15.4
  148. - os: macos-15
  149. xcode: Xcode_16
  150. runs-on: ${{ matrix.os }}
  151. needs: spm-package-resolved
  152. env:
  153. FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
  154. steps:
  155. - uses: actions/checkout@v4
  156. - uses: actions/cache/restore@v4
  157. with:
  158. path: .build
  159. key: ${{needs.spm-package-resolved.outputs.cache_key}}
  160. - name: Xcode
  161. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  162. - name: Placeholder GoogleService-Info.plist for build testing
  163. run: cp FirebaseCore/Tests/Unit/Resources/GoogleService-Info.plist FirebaseVertexAI/Sample/
  164. - uses: nick-fields/retry@v3
  165. with:
  166. timeout_minutes: 120
  167. max_attempts: 3
  168. retry_on: error
  169. retry_wait_seconds: 120
  170. command: scripts/build.sh VertexSample iOS