diff --git a/.github/workflows/sdk.ai.yml b/.github/workflows/sdk.ai.yml index 1d691ed20b7..019677a3d52 100644 --- a/.github/workflows/sdk.ai.yml +++ b/.github/workflows/sdk.ai.yml @@ -43,15 +43,18 @@ jobs: - os: macos-15 target: iOS xcode: Xcode_26.2 + action: build - os: macos-26 target: iOS # TODO: Bump to 26.4 when "Unable to find a destination matching the provided destination specifier" is resolved. xcode: Xcode_26.2 + action: test runs-on: ${{ matrix.os }} needs: spm env: TEST_RUNNER_FIRAAppCheckDebugToken: ${{ secrets.VERTEXAI_INTEGRATION_FAC_DEBUG_TOKEN }} - TEST_RUNNER_VTXIntegrationImagen: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} + TEST_RUNNER_FALIntegrationImagen: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} + TEST_RUNNER_FALIntegrationLiveSession: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1 secrets_passphrase: ${{ secrets.GHASecretsGPGPassphrase1 }} steps: @@ -60,8 +63,19 @@ jobs: with: path: .build key: ${{ needs.spm.outputs.cache_key }} - - name: Run integration tests - run: scripts/repo.sh tests run --secrets ./scripts/secrets/AI.json --platforms ${{ matrix.target }} --xcode ${{ matrix.xcode }} AI + - name: Install Secret GoogleService-Info.plist + run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/FirebaseAI/TestApp-GoogleService-Info.plist.gpg \ + FirebaseAI/Tests/TestApp/Resources/GoogleService-Info.plist "$secrets_passphrase" + - name: Install Secret GoogleService-Info-Spark.plist + run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/FirebaseAI/TestApp-GoogleService-Info-Spark.plist.gpg \ + FirebaseAI/Tests/TestApp/Resources/GoogleService-Info-Spark.plist "$secrets_passphrase" + - name: Install Secret Credentials.swift + run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/FirebaseAI/TestApp-Credentials.swift.gpg \ + FirebaseAI/Tests/TestApp/Tests/Integration/Credentials.swift "$secrets_passphrase" + - name: Xcode + run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer + - name: Run IntegrationTests + run: scripts/build.sh FirebaseAIIntegration ${{ matrix.target }} ${{ matrix.action }} - name: Upload xcodebuild logs if: failure() uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 diff --git a/FirebaseAI/Tests/TestApp/Tests/Integration/ImagenIntegrationTests.swift b/FirebaseAI/Tests/TestApp/Tests/Integration/ImagenIntegrationTests.swift index c8a288cc20c..133d0310c0b 100644 --- a/FirebaseAI/Tests/TestApp/Tests/Integration/ImagenIntegrationTests.swift +++ b/FirebaseAI/Tests/TestApp/Tests/Integration/ImagenIntegrationTests.swift @@ -25,8 +25,8 @@ import Testing @Suite( .enabled( - if: ProcessInfo.processInfo.environment["VTXIntegrationImagen"] != nil, - "Only runs if the environment variable VTXIntegrationImagen is set." + if: ProcessInfo.processInfo.environment["FALIntegrationImagen"] == "true", + "Only runs if the environment variable FALIntegrationImagen is set to true." ), .serialized ) diff --git a/FirebaseAI/Tests/TestApp/Tests/Integration/LiveSessionTests.swift b/FirebaseAI/Tests/TestApp/Tests/Integration/LiveSessionTests.swift index d213fa51cb0..92951cf19af 100644 --- a/FirebaseAI/Tests/TestApp/Tests/Integration/LiveSessionTests.swift +++ b/FirebaseAI/Tests/TestApp/Tests/Integration/LiveSessionTests.swift @@ -19,7 +19,13 @@ import Testing @testable import struct FirebaseAILogic.APIConfig -@Suite(.serialized) +@Suite( + .enabled( + if: ProcessInfo.processInfo.environment["FALIntegrationLiveSession"] == "true", + "Only runs if the environment variable FALIntegrationLiveSession is set to true." + ), + .serialized +) struct LiveSessionTests { private static let arguments = InstanceConfig.liveConfigs.flatMap { config in switch config.apiConfig.service { diff --git a/scripts/build.sh b/scripts/build.sh index 3b211a452d2..d032e25880c 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -123,7 +123,12 @@ function RunXcodebuild() { local xcbeautify_cmd if command -v xcbeautify &> /dev/null; then - xcbeautify_cmd=(xcbeautify --renderer github-actions --disable-logging) + xcbeautify_cmd=( + env NSUnbufferedIO=YES + xcbeautify + --renderer github-actions + --disable-logging + ) else echo "xcbeautify not found, using raw xcodebuild output." xcbeautify_cmd=(cat) @@ -566,15 +571,15 @@ case "$product-$platform-$method" in build ;; - FirebaseAIIntegration-*-*) - # Build + FirebaseAIIntegration-*-build) RunXcodebuild \ -project 'FirebaseAI/Tests/TestApp/FirebaseAITestApp.xcodeproj' \ -scheme "FirebaseAITestApp-SPM" \ "${xcb_flags[@]}" \ build-for-testing + ;; - # Run tests + FirebaseAIIntegration-*-test) RunXcodebuild \ -project 'FirebaseAI/Tests/TestApp/FirebaseAITestApp.xcodeproj' \ -scheme "FirebaseAITestApp-SPM" \ @@ -582,7 +587,7 @@ case "$product-$platform-$method" in -parallel-testing-enabled NO \ -retry-tests-on-failure \ -test-iterations 3 \ - test-without-building + test ;; Sessions-*-integration)