vertexai.yml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. name: vertexai
  2. on:
  3. pull_request:
  4. paths:
  5. - 'FirebaseAI**'
  6. - 'FirebaseVertexAI**'
  7. - '.github/workflows/vertexai.yml'
  8. - 'Gemfile*'
  9. schedule:
  10. # Run every day at 11pm (PST) - cron uses UTC times
  11. - cron: '0 7 * * *'
  12. workflow_dispatch:
  13. concurrency:
  14. group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
  15. cancel-in-progress: true
  16. jobs:
  17. spm-package-resolved:
  18. runs-on: macos-14
  19. outputs:
  20. cache_key: ${{ steps.generate_cache_key.outputs.cache_key }}
  21. env:
  22. FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
  23. steps:
  24. - uses: actions/checkout@v4
  25. - name: Generate Swift Package.resolved
  26. id: swift_package_resolve
  27. run: |
  28. swift package resolve
  29. - name: Generate cache key
  30. id: generate_cache_key
  31. run: |
  32. cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}"
  33. echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT"
  34. - uses: actions/cache/save@v4
  35. id: cache
  36. with:
  37. path: .build
  38. key: ${{ steps.generate_cache_key.outputs.cache_key }}
  39. spm-unit:
  40. strategy:
  41. matrix:
  42. include:
  43. - os: macos-14
  44. xcode: Xcode_16.2
  45. target: iOS
  46. - os: macos-15
  47. xcode: Xcode_16.3
  48. target: iOS
  49. - os: macos-15
  50. xcode: Xcode_16.3
  51. target: tvOS
  52. - os: macos-15
  53. xcode: Xcode_16.3
  54. target: macOS
  55. - os: macos-15
  56. xcode: Xcode_16.3
  57. target: watchOS
  58. - os: macos-15
  59. xcode: Xcode_16.3
  60. target: catalyst
  61. - os: macos-15
  62. xcode: Xcode_16.3
  63. target: visionOS
  64. runs-on: ${{ matrix.os }}
  65. needs: spm-package-resolved
  66. env:
  67. FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
  68. steps:
  69. - uses: actions/checkout@v4
  70. - uses: actions/cache/restore@v4
  71. with:
  72. path: .build
  73. key: ${{needs.spm-package-resolved.outputs.cache_key}}
  74. - name: Xcode
  75. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  76. - name: Install visionOS, if needed.
  77. if: matrix.target == 'visionOS'
  78. run: xcodebuild -downloadPlatform visionOS
  79. - name: Initialize xcodebuild
  80. run: scripts/setup_spm_tests.sh
  81. - uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # 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. pod-lib-lint:
  89. # Don't run on private repo unless it is a PR.
  90. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  91. strategy:
  92. matrix:
  93. include:
  94. - os: macos-14
  95. xcode: Xcode_16.2
  96. swift_version: 5.9
  97. warnings:
  98. - os: macos-15
  99. xcode: Xcode_16.3
  100. swift_version: 5.9
  101. warnings:
  102. - os: macos-15
  103. xcode: Xcode_16.3
  104. swift_version: 6.0
  105. warnings:
  106. runs-on: ${{ matrix.os }}
  107. steps:
  108. - uses: actions/checkout@v4
  109. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  110. - name: Setup Bundler
  111. run: scripts/setup_bundler.sh
  112. - name: Xcode
  113. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  114. - name: Set Swift swift_version
  115. run: sed -i "" "s#s.swift_version = '5.9'#s.swift_version = '${{ matrix.swift_version}}'#" FirebaseVertexAI.podspec
  116. - name: Build and test
  117. run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseVertexAI.podspec --platforms=${{ matrix.target }} ${{ matrix.warnings }}