Skip to content

Commit 82d7335

Browse files
paulb777andrewheard
authored andcommitted
Build Sample in CI (#12616)
1 parent e70550d commit 82d7335

File tree

3 files changed

+46
-5
lines changed

3 files changed

+46
-5
lines changed

.github/workflows/vertexai.yml

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ name: vertexai
33
on:
44
pull_request:
55
paths:
6-
- 'FirebaseVertexAI**'
7-
- '.github/workflows/vertexai.yml'
8-
- 'Gemfile*'
6+
- 'FirebaseVertexAI**'
7+
- '.github/workflows/vertexai.yml'
8+
- 'Gemfile*'
99
schedule:
1010
# Run every day at 11pm (PST) - cron uses UTC times
1111
- cron: '0 7 * * *'
@@ -32,5 +32,37 @@ jobs:
3232
run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
3333
- name: Initialize xcodebuild
3434
run: scripts/setup_spm_tests.sh
35-
- name: Build and run tests
36-
run: scripts/third_party/travis/retry.sh scripts/build.sh FirebaseVertexAIUnit ${{ matrix.target }} spm
35+
- uses: nick-fields/retry@v3
36+
with:
37+
timeout_minutes: 120
38+
max_attempts: 3
39+
retry_on: error
40+
retry_wait_seconds: 120
41+
command: scripts/build.sh FirebaseVertexAIUnit ${{ matrix.target }} spm
42+
43+
sample:
44+
strategy:
45+
matrix:
46+
# Test build with debug and release configs (whether or not DEBUG is set and optimization level)
47+
build: [build]
48+
include:
49+
- os: macos-13
50+
xcode: Xcode_15.0.1
51+
- os: macos-14
52+
xcode: Xcode_15.2
53+
runs-on: ${{ matrix.os }}
54+
steps:
55+
- uses: actions/checkout@v4
56+
- name: Xcode
57+
run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
58+
- name: Initialize xcodebuild
59+
run: xcodebuild -list
60+
- name: Placeholder GoogleService-Info.plist for build testing
61+
run: cp FirebaseCore/Tests/Unit/Resources/GoogleService-Info.plist FirebaseVertexAI/Sample/
62+
- uses: nick-fields/retry@v3
63+
with:
64+
timeout_minutes: 120
65+
max_attempts: 3
66+
retry_on: error
67+
retry_wait_seconds: 120
68+
command: scripts/build.sh VertexSample iOS

FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -995,6 +995,7 @@ private extension URLRequest {
995995
}
996996
}
997997

998+
@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, *)
998999
class AppCheckInteropFake: NSObject, AppCheckInterop {
9991000
/// The placeholder token value returned when an error occurs
10001001
static let placeholderTokenValue = "placeholder-token"

scripts/build.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,14 @@ case "$product-$platform-$method" in
490490
build
491491
;;
492492

493+
VertexSample-*-*)
494+
RunXcodebuild \
495+
-project 'FirebaseVertexAI/Sample/GenerativeAISample.xcodeproj' \
496+
-scheme "GenerativeAISample" \
497+
"${xcb_flags[@]}" \
498+
build
499+
;;
500+
493501
Sessions-*-integration)
494502
# Perform "pod install" to install the relevant dependencies
495503
# ./FirebaseSessions/generate_testapp.sh

0 commit comments

Comments
 (0)