From c970daaa389037b2cdf206ea4bef2f1784feddd4 Mon Sep 17 00:00:00 2001 From: Paul Beusterien Date: Fri, 22 Mar 2024 16:03:10 -0700 Subject: [PATCH 1/4] Build Sample in CI --- .github/workflows/vertexai.yml | 40 +++++++++++++++++++++++++++++----- scripts/build.sh | 8 +++++++ 2 files changed, 43 insertions(+), 5 deletions(-) diff --git a/.github/workflows/vertexai.yml b/.github/workflows/vertexai.yml index 4f0880de320..2d9d9c1cd1c 100644 --- a/.github/workflows/vertexai.yml +++ b/.github/workflows/vertexai.yml @@ -3,9 +3,9 @@ name: vertexai on: pull_request: paths: - - 'FirebaseVertexAI**' - - '.github/workflows/vertexai.yml' - - 'Gemfile*' + - 'FirebaseVertexAI**' + - '.github/workflows/vertexai.yml' + - 'Gemfile*' schedule: # Run every day at 11pm (PST) - cron uses UTC times - cron: '0 7 * * *' @@ -32,5 +32,35 @@ jobs: run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer - name: Initialize xcodebuild run: scripts/setup_spm_tests.sh - - name: Build and run tests - run: scripts/third_party/travis/retry.sh scripts/build.sh FirebaseVertexAIUnit ${{ matrix.target }} spm + - uses: nick-fields/retry@v3 + with: + timeout_minutes: 120 + max_attempts: 3 + retry_on: error + retry_wait_seconds: 120 + command: scripts/build.sh FirebaseVertexAIUnit ${{ matrix.target }} spm + +sample: + strategy: + matrix: + # Test build with debug and release configs (whether or not DEBUG is set and optimization level) + build: [build] + include: + - os: macos-13 + xcode: Xcode_15.0.1 + - os: macos-14 + xcode: Xcode_15.2 + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - name: Xcode + run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer + - name: Initialize xcodebuild + run: xcodebuild -list + - uses: nick-fields/retry@v3 + with: + timeout_minutes: 120 + max_attempts: 3 + retry_on: error + retry_wait_seconds: 120 + command: scripts/build.sh VertexSample iOS diff --git a/scripts/build.sh b/scripts/build.sh index d4caa635ebf..75935652c98 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -490,6 +490,14 @@ case "$product-$platform-$method" in build ;; + VertexSample-*-*) + RunXcodebuild \ + -project 'FirebaseVertexAI/Sample/GenerativeAISample.xcodeproj' \ + -scheme "GenerativeAISample" \ + "${xcb_flags[@]}" \ + build + ;; + Sessions-*-integration) # Perform "pod install" to install the relevant dependencies # ./FirebaseSessions/generate_testapp.sh From 08eda82d49c466cdd3b534a225b9f003c50c2fe0 Mon Sep 17 00:00:00 2001 From: Paul Beusterien Date: Fri, 22 Mar 2024 16:05:12 -0700 Subject: [PATCH 2/4] syntax --- .github/workflows/vertexai.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vertexai.yml b/.github/workflows/vertexai.yml index 2d9d9c1cd1c..b23be8a00d3 100644 --- a/.github/workflows/vertexai.yml +++ b/.github/workflows/vertexai.yml @@ -40,7 +40,7 @@ jobs: retry_wait_seconds: 120 command: scripts/build.sh FirebaseVertexAIUnit ${{ matrix.target }} spm -sample: + sample: strategy: matrix: # Test build with debug and release configs (whether or not DEBUG is set and optimization level) From 8a71f278416ce5371d9e96daacedaeffb3e88bee Mon Sep 17 00:00:00 2001 From: Paul Beusterien Date: Fri, 22 Mar 2024 16:18:04 -0700 Subject: [PATCH 3/4] placeholder plist --- .github/workflows/vertexai.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/vertexai.yml b/.github/workflows/vertexai.yml index b23be8a00d3..ebf58529f54 100644 --- a/.github/workflows/vertexai.yml +++ b/.github/workflows/vertexai.yml @@ -57,6 +57,8 @@ jobs: run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer - name: Initialize xcodebuild run: xcodebuild -list + - name: Placeholder GoogleService-Info.plist for build testing + run: cp FirebaseCore/Tests/Unit/Resources/GoogleService-Info.plist FirebaseVertexAI/Sample/ - uses: nick-fields/retry@v3 with: timeout_minutes: 120 From f225ce9910cb06a3f6633b1d45e6acbe4510a68a Mon Sep 17 00:00:00 2001 From: Andrew Heard Date: Mon, 25 Mar 2024 10:44:22 -0400 Subject: [PATCH 4/4] Fix `AppCheckInteropFake` availability --- FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift b/FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift index c249613f9e9..d2e4f95c0af 100644 --- a/FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift +++ b/FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift @@ -995,6 +995,7 @@ private extension URLRequest { } } +@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, *) class AppCheckInteropFake: NSObject, AppCheckInterop { /// The placeholder token value returned when an error occurs static let placeholderTokenValue = "placeholder-token"