Skip to content
40 changes: 38 additions & 2 deletions .github/workflows/vertexai.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,47 @@ concurrency:
cancel-in-progress: true

jobs:
spm-package-resolved:
runs-on: macos-14
outputs:
cache_key: ${{ steps.generate_cache_key.outputs.cache_key }}
env:
FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
steps:
- uses: actions/checkout@v4
- name: Generate Swift Package.resolved
id: swift_package_resolve
run: |
swift package resolve
- name: Generate cache key
id: generate_cache_key
run: |
cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}"
echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT"
- uses: actions/cache/save@v4
id: cache
with:
path: .build
key: ${{ steps.generate_cache_key.outputs.cache_key }}

spm-unit:
strategy:
max-parallel: 1
matrix:
target: [iOS, macOS, catalyst, tvOS, visionOS, watchOS]
os: [macos-14]
include:
- os: macos-14
xcode: Xcode_15.2
runs-on: ${{ matrix.os }}
needs: spm-package-resolved
env:
FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
steps:
- uses: actions/checkout@v4
- uses: actions/cache/restore@v4
with:
path: .build
key: ${{needs.spm-package-resolved.outputs.cache_key}}
- name: Clone mock responses
run: scripts/update_vertexai_responses.sh
- name: Xcode
Expand All @@ -45,20 +72,24 @@ jobs:

spm-integration:
strategy:
max-parallel: 1
matrix:
target: [iOS]
os: [macos-14]
include:
- os: macos-14
xcode: Xcode_15.2
runs-on: ${{ matrix.os }}
needs: spm-package-resolved
env:
TEST_RUNNER_VertexAIRunIntegrationTests: 1
FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
steps:
- uses: actions/checkout@v4
- uses: actions/cache/restore@v4
with:
path: .build
key: ${{needs.spm-package-resolved.outputs.cache_key}}
- name: Install Secret GoogleService-Info.plist
run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/vertexai-integration.plist.gpg \
FirebaseVertexAI/Tests/Integration/Resources/GoogleService-Info.plist "$plist_secret"
Expand Down Expand Up @@ -108,10 +139,15 @@ jobs:
- os: macos-14
xcode: Xcode_15.2
runs-on: ${{ matrix.os }}
needs: spm-package-resolved
env:
FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
steps:
- uses: actions/checkout@v4
- uses: actions/cache/restore@v4
with:
path: .build
key: ${{needs.spm-package-resolved.outputs.cache_key}}
- name: Xcode
run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
- name: Initialize xcodebuild
Expand Down
Loading