Skip to content

Commit 5b87ff7

Browse files
authored
feat: migrate AI zip qs job to reusable workflow (#15597)
1 parent 1079454 commit 5b87ff7

File tree

8 files changed

+144
-300
lines changed

8 files changed

+144
-300
lines changed

.github/workflows/common_quickstart_framework.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,15 @@ permissions:
66
on:
77
workflow_call:
88
inputs:
9-
# The product to test be tested (e.g. `ABTesting`).
9+
# The product to be tested (e.g. `ABTesting`).
1010
product:
1111
required: true
1212
type: string
13+
# Optional. The scheme to be tested (e.g. `ABTesting (tvOS)`).
14+
scheme:
15+
required: false
16+
type: string
17+
default: ''
1318
# The Run ID of a successful zip packaging workflow.
1419
zip_run_id:
1520
required: true
@@ -53,6 +58,7 @@ jobs:
5358
env:
5459
plist_secret: ${{ secrets.plist_secret }}
5560
SDK: ${{ inputs.product }}
61+
SCHEME: ${{ inputs.scheme }}
5662
runs-on: ${{ inputs.os }}
5763
steps:
5864
- uses: actions/checkout@v4
@@ -82,7 +88,7 @@ jobs:
8288
timeout_minutes: 15
8389
max_attempts: 2
8490
retry_wait_seconds: 120
85-
command: ([ -z $plist_secret ] || scripts/test_quickstart_framework.sh "${SDK}")
91+
command: ([ -z $plist_secret ] || scripts/test_quickstart_framework.sh "${SDK}" "${SCHEME}")
8692
# Failure sequence to upload artifact.
8793
- uses: actions/upload-artifact@v4
8894
if: failure()

.github/workflows/zip.yml

Lines changed: 123 additions & 290 deletions
Large diffs are not rendered by default.

scripts/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Script used by CI jobs to wrap xcodebuild invocations with options.
5959

6060
CI script to build binary versions of non-Firebase SDKs for QuickStart testing.
6161

62-
### [build_zip.sh](https://github.com/firebase/firebase-ios-sdk/blob/main/scripts/build_zip.sh)
62+
### [build_zip.sh](https://github.com/firebase/firebase-ios-sdk/blob/main/scripts/zip/build_zip.sh)
6363

6464
CI script for building the zip distribution.
6565

@@ -151,7 +151,7 @@ Install tooling for the check workflow.
151151

152152
Set up a QuickStart for integration testing.
153153

154-
### [setup_quickstart_framework.sh](https://github.com/firebase/firebase-ios-sdk/blob/main/scripts/setup_quickstart_framework.sh)
154+
### [setup_quickstart_framework.sh](https://github.com/firebase/firebase-ios-sdk/blob/main/scripts/zip/setup_quickstart_framework.sh)
155155

156156
Set up a QuickStart for zip distribution testing.
157157

@@ -191,7 +191,7 @@ Downloads mock response files for the Firebase AI Logic unit tests.
191191

192192
Tooling used by `build.sh` to get the log output for an `xcodebuild` invocation.
193193

194-
### [zip_quickstart_test.sh](https://github.com/firebase/firebase-ios-sdk/blob/main/scripts/zip_quickstart_test.sh)
194+
### [zip_quickstart_test.sh](https://github.com/firebase/firebase-ios-sdk/blob/main/scripts/zip/zip_quickstart_test.sh)
195195

196196
Run the tests associated with a QuickStart with a zip distribution.
197197

scripts/test_quickstart_framework.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
set -xeuo pipefail
2222

2323
sample="$1"
24-
platform="${2-}"
24+
scheme="${2-}"
2525

2626
REPO=`pwd`
2727

@@ -30,5 +30,5 @@ source scripts/check_secrets.sh
3030

3131
if check_secrets; then
3232
cd quickstart-ios
33-
have_secrets=true SAMPLE="$sample" "${REPO}"/scripts/zip_quickstart_test.sh
33+
have_secrets=true SAMPLE="$sample" SCHEME="${scheme}" ${REPO}"/scripts/zip/zip_quickstart_test.sh"
3434
fi
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ touch foo.swift
4343
mkdir -p Firebase/
4444
# Create non Firebase Frameworks and move to Firebase/ dir.
4545
if [[ ! -z "$NON_FIREBASE_SDKS" ]]; then
46-
REPO="${REPO}" NON_FIREBASE_SDKS="${NON_FIREBASE_SDKS}" "${REPO}"/scripts/build_non_firebase_sdks.sh
46+
REPO="${REPO}" NON_FIREBASE_SDKS="${NON_FIREBASE_SDKS}" "${REPO}"/scripts/zip/build_non_firebase_sdks.sh
4747
fi
4848
if [ ! -f "Firebase/Firebase.h" ]; then
4949
cp "${HOME}"/ios_frameworks/Firebase/Firebase.h Firebase/
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,14 @@ else
3838
device_name="iPhone 16"
3939
fi
4040

41-
# Define project and scheme names
41+
# Define project and, if needed, scheme.
4242
PROJECT_NAME="${SAMPLE}Example.xcodeproj"
43-
SCHEME_NAME="${SAMPLE}Example${SWIFT_SUFFIX}"
43+
SCHEME_NAME="${SCHEME}"
44+
45+
if [[ -z "$SCHEME_NAME" ]]; then
46+
SCHEME_NAME="${SAMPLE}Example"
47+
echo "Defaulting scheme name to $SCHEME_NAME"
48+
fi
4449

4550
# Check if the scheme exists before attempting to build.
4651
# The `awk` command prints all lines from "Schemes:" to the end of the output.

0 commit comments

Comments
 (0)