Skip to content

Commit bb3a034

Browse files
committed
Merge branch 'main' into ai-structured-output
2 parents b51c279 + beda7f4 commit bb3a034

File tree

86 files changed

+1189
-882
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+1189
-882
lines changed

.github/workflows/README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# GitHub Actions Workflow Naming Conventions
2+
3+
This document outlines the naming conventions for GitHub Actions workflows within
4+
this repository. Adhering to these conventions helps maintain clarity and
5+
consistency for maintainers and automated systems.
6+
7+
The workflows are categorized into four groups, identified by their file name
8+
prefixes.
9+
10+
## 1. Reusable Workflows (`_*.yml`)
11+
12+
**Pattern:** `_*.yml`
13+
14+
Files prefixed with an underscore (`_`) are modular workflows intended to be
15+
called by other workflows (using `workflow_call`). They encapsulate common
16+
build steps or testing logic to reduce duplication.
17+
18+
* **Example:** `_build.yml` (Generic build logic used by multiple SDKs)
19+
20+
## 2. Infrastructure Workflows (`infra.*.yml`)
21+
22+
**Pattern:** `infra.<task>.yml`
23+
24+
Workflows in this category handle general CI/CD infrastructure tasks. They are
25+
not specific to a single SDK but support the overall repository health,
26+
compliance, and tooling.
27+
28+
* **Example:** `infra.check.yml` (Runs repo-wide style and quality checks)
29+
30+
## 3. Release Workflows (`release.*.yml`)
31+
32+
**Pattern:** `release.<package_manager>.[method].yml`
33+
34+
These workflows manage the building and testing of SDK releases. They
35+
typically handle interactions with package managers (CocoaPods, SPM) or generate
36+
release artifacts (Zip).
37+
38+
* **Example:** `release.cocoapods.yml` (Manages CocoaPods release testing)
39+
40+
## 4. SDK-Specific Workflows (`sdk.*.yml`)
41+
42+
**Pattern:** `sdk.<product>[.suffix].yml`
43+
44+
These workflows are dedicated to building and testing specific Firebase SDKs.
45+
46+
* **Basic:** `sdk.<product>.yml` (e.g., `sdk.auth.yml`) - Standard CI for the SDK.
47+
* **Nightly:** `sdk.<product>.nightly.yml` - Scheduled, resource-intensive tests.
48+
* **Integration:** `sdk.<product>.integration.yml` - Integration-specific test suites.

.github/workflows/_build.yml

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
name: _build
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
workflow_call:
8+
inputs:
9+
product:
10+
required: true
11+
type: string
12+
platform:
13+
required: true
14+
type: string
15+
method:
16+
required: true
17+
type: string
18+
sanitizers:
19+
required: false
20+
type: string
21+
description: "Space-separated list of sanitizers (asan, tsan, ubsan)"
22+
setup_command:
23+
required: false
24+
type: string
25+
description: "Command to run before build (e.g., for setting up secrets or prerequisites)"
26+
xcode:
27+
required: false
28+
type: string
29+
default: 'Xcode_16.4'
30+
os:
31+
required: false
32+
type: string
33+
default: 'macos-15'
34+
timeout_minutes:
35+
required: false
36+
type: number
37+
default: 120
38+
max_attempts:
39+
required: false
40+
type: number
41+
default: 3
42+
43+
# IMPORTANT: When adding new secrets to this workflow, update the
44+
# 'has_secrets' logic in the 'check_secrets' job to include the new secret.
45+
secrets:
46+
plist_secret:
47+
required: false
48+
49+
jobs:
50+
check_secrets:
51+
runs-on: ubuntu-latest
52+
outputs:
53+
should_run: ${{ steps.determine_run.outputs.should_run }}
54+
has_secrets: ${{ steps.determine_run.outputs.has_secrets }}
55+
env:
56+
plist_secret: ${{ secrets.plist_secret }}
57+
steps:
58+
- name: Determine if build should run and if secrets are present
59+
id: determine_run
60+
run: |
61+
# 1. Check for secrets.
62+
# - IMPORTANT: Extend this logic if adding new secrets.
63+
if [[ -n "$plist_secret" ]]; then
64+
has_secrets="true"
65+
else
66+
has_secrets="false"
67+
fi
68+
echo "has_secrets=$has_secrets" >> $GITHUB_OUTPUT
69+
70+
# 2. Determine if the build job should run.
71+
# - Skip if on a fork AND secrets are present.
72+
repo_full_name=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')
73+
if [[ "$repo_full_name" != "firebase/firebase-ios-sdk" && "$has_secrets" == "true" ]]; then
74+
echo "should_run=false" >> $GITHUB_OUTPUT
75+
else
76+
echo "should_run=true" >> $GITHUB_OUTPUT
77+
fi
78+
79+
build:
80+
needs: check_secrets
81+
# Run on the main repo's scheduled jobs or pull requests and manual workflow invocations.
82+
if: |
83+
needs.check_secrets.outputs.should_run == 'true' &&
84+
(
85+
(github.repository == 'firebase/firebase-ios-sdk' && github.event_name == 'schedule') ||
86+
contains(fromJSON('["pull_request", "workflow_dispatch"]'), github.event_name)
87+
)
88+
runs-on: ${{ inputs.os }}
89+
env:
90+
SANITIZERS: ${{ inputs.sanitizers }}
91+
plist_secret: ${{ secrets.plist_secret }}
92+
FIREBASECI_SECRETS_PRESENT: ${{ needs.check_secrets.outputs.has_secrets }}
93+
FIREBASECI_IS_TRUSTED_ENV: ${{ github.repository == 'firebase/firebase-ios-sdk' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) }}
94+
FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
95+
steps:
96+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
97+
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
98+
if: inputs.method != 'spm' && inputs.method != 'spmbuildonly' && inputs.method != 'cmake'
99+
- name: Setup Bundler
100+
if: inputs.method != 'spm' && inputs.method != 'spmbuildonly' && inputs.method != 'cmake'
101+
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3
102+
with:
103+
timeout_minutes: 10
104+
max_attempts: 5
105+
retry_wait_seconds: 300
106+
command: scripts/setup_bundler.sh
107+
- name: Xcode
108+
run: sudo xcode-select -s /Applications/${{ inputs.xcode }}.app/Contents/Developer
109+
- name: Install simulators
110+
if: inputs.platform != 'macOS' && inputs.platform != 'catalyst'
111+
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3
112+
with:
113+
timeout_minutes: 15
114+
max_attempts: 5
115+
retry_wait_seconds: 120
116+
continue_on_error: true
117+
command: |
118+
if [[ "${{ inputs.platform }}" == "all" ]]; then
119+
xcodebuild -downloadAllPlatforms
120+
else
121+
xcodebuild -downloadPlatform ${{ inputs.platform }}
122+
fi
123+
- name: Run setup command
124+
if: inputs.setup_command != ''
125+
run: ${{ inputs.setup_command }}
126+
- name: Build
127+
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3
128+
with:
129+
timeout_minutes: ${{ inputs.timeout_minutes }}
130+
max_attempts: ${{ inputs.max_attempts }}
131+
retry_wait_seconds: 120
132+
command: |
133+
scripts/build.sh "${{ inputs.product }}" "${{ inputs.platform }}" "${{ inputs.method }}"
134+
- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
135+
if: ${{ failure() }}
136+
with:
137+
name: xcodebuild-logs-${{ inputs.product }}-${{ inputs.platform }}-${{ inputs.method }}
138+
path: xcodebuild-*.log
139+
if-no-files-found: error
Lines changed: 37 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: infra.samples.client_app
22

3+
permissions:
4+
contents: read
5+
36
on:
47
workflow_dispatch:
58
pull_request:
@@ -25,7 +28,6 @@ concurrency:
2528

2629
jobs:
2730
client-app-spm:
28-
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
2931
strategy:
3032
matrix:
3133
#TODO(ncooke3): Add multi-platform support: tvOS, macOS, catalyst
@@ -37,41 +39,36 @@ jobs:
3739
xcode: Xcode_16.2
3840
- os: macos-15
3941
xcode: Xcode_16.4
40-
runs-on: ${{ matrix.os }}
41-
steps:
42-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
43-
- name: Xcode
44-
run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
45-
- name: Build Client App - ${{ matrix.platform }}
46-
run: scripts/third_party/travis/retry.sh ./scripts/build.sh ${{ matrix.scheme }} ${{ matrix.platform }} xcodebuild
42+
uses: ./.github/workflows/_build.yml
43+
with:
44+
product: ${{ matrix.scheme }}
45+
platform: ${{ matrix.platform }}
46+
method: xcodebuild
47+
os: ${{ matrix.os }}
48+
xcode: ${{ matrix.xcode }}
4749

4850
client-app-spm-source-firestore:
49-
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
50-
env:
51-
FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
52-
FIREBASE_SOURCE_FIRESTORE: 1
53-
strategy:
54-
matrix:
55-
#TODO(ncooke3): Add multi-platform support: tvOS, macOS, catalyst
56-
platform: [iOS]
57-
scheme: [ClientApp]
58-
os: [macos-14, macos-15]
59-
include:
60-
- os: macos-14
61-
xcode: Xcode_16.2
62-
- os: macos-15
63-
xcode: Xcode_16.4
64-
runs-on: ${{ matrix.os }}
65-
steps:
66-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
67-
- name: Xcode
68-
run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
69-
- name: Build Client App - ${{ matrix.platform }}
70-
run: scripts/third_party/travis/retry.sh ./scripts/build.sh ${{ matrix.scheme }} ${{ matrix.platform }} xcodebuild
51+
strategy:
52+
matrix:
53+
#TODO(ncooke3): Add multi-platform support: tvOS, macOS, catalyst
54+
platform: [iOS]
55+
scheme: [ClientApp]
56+
os: [macos-14, macos-15]
57+
include:
58+
- os: macos-14
59+
xcode: Xcode_16.2
60+
- os: macos-15
61+
xcode: Xcode_16.4
62+
uses: ./.github/workflows/_build.yml
63+
with:
64+
product: ${{ matrix.scheme }}
65+
platform: ${{ matrix.platform }}
66+
method: xcodebuild
67+
os: ${{ matrix.os }}
68+
xcode: ${{ matrix.xcode }}
69+
setup_command: echo "FIREBASE_SOURCE_FIRESTORE=1" >> $GITHUB_ENV
7170

7271
client-app-cocoapods:
73-
# Don't run on private repo unless it is a PR.
74-
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
7572
strategy:
7673
matrix:
7774
scheme: [ClientApp-CocoaPods]
@@ -81,15 +78,11 @@ jobs:
8178
xcode: Xcode_16.2
8279
- os: macos-15
8380
xcode: Xcode_16.4
84-
runs-on: ${{ matrix.os }}
85-
steps:
86-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
87-
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
88-
- name: Setup Bundler
89-
run: scripts/setup_bundler.sh
90-
- name: Xcode
91-
run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
92-
- name: Prereqs
93-
run: scripts/install_prereqs.sh ClientApp iOS xcodebuild
94-
- name: Build
95-
run: scripts/build.sh ${{ matrix.scheme }} iOS xcodebuild
81+
uses: ./.github/workflows/_build.yml
82+
with:
83+
product: ${{ matrix.scheme }}
84+
platform: iOS
85+
method: xcodebuild
86+
os: ${{ matrix.os }}
87+
xcode: ${{ matrix.xcode }}
88+
setup_command: scripts/install_prereqs.sh ClientApp iOS xcodebuild
Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: infra.samples.symbolcollision
22

3+
permissions:
4+
contents: read
5+
36
# Tests the Pods listed in SymbolCollisionTest/Podfile for symbol collisions.
47

58
on:
@@ -19,25 +22,9 @@ concurrency:
1922

2023
jobs:
2124
installation-test:
22-
# Don't run on private repo unless it is a PR.
23-
if: github.repository == 'Firebase/firebase-ios-sdk' || github.event_name == 'pull_request'
24-
runs-on: macos-15
25-
26-
steps:
27-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
28-
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
29-
- name: Setup Bundler
30-
run: scripts/setup_bundler.sh
31-
- name: Xcode
32-
run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer
33-
- name: Install simulators in case they are missing.
34-
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3
35-
with:
36-
timeout_minutes: 15
37-
max_attempts: 5
38-
retry_wait_seconds: 120
39-
command: sudo xcodebuild -downloadPlatform iOS
40-
- name: Prereqs
41-
run: scripts/install_prereqs.sh SymbolCollision iOS
42-
- name: Build
43-
run: scripts/build.sh SymbolCollision iOS
25+
uses: ./.github/workflows/_build.yml
26+
with:
27+
product: SymbolCollision
28+
platform: iOS
29+
method: xcodebuild
30+
setup_command: scripts/install_prereqs.sh SymbolCollision iOS

.github/workflows/release.zip.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ env:
1919
# When specified, build jobs will be skipped and the specified
2020
# run's artifacts will be used for testing.
2121
PINNED_RUN_ID: ''
22+
# Firebase's minimum supported Xcode. This is what the binary artifacts are
23+
# built with. Changing this version must only be done in alignment with
24+
# updates to the minimum supported Xcode supported for App Store submissions.
25+
MIN_XCODE: Xcode_16.2 # WARNING: Read above comment.
2226

2327
on:
2428
pull_request:
@@ -81,8 +85,8 @@ jobs:
8185
runs-on: macos-14
8286
steps:
8387
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
84-
- name: Xcode 16.2
85-
run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
88+
- name: Xcode
89+
run: sudo xcode-select -s /Applications/${{ env.MIN_XCODE }}.app/Contents/Developer
8690
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
8791
- name: Setup Bundler
8892
run: ./scripts/setup_bundler.sh
@@ -110,8 +114,8 @@ jobs:
110114
runs-on: macos-14
111115
steps:
112116
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
113-
- name: Xcode 16.2
114-
run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
117+
- name: Xcode
118+
run: sudo xcode-select -s /Applications/${{ env.MIN_XCODE }}.app/Contents/Developer
115119
- name: Build
116120
run: |
117121
cd ReleaseTooling
@@ -126,8 +130,8 @@ jobs:
126130
runs-on: macos-14
127131
steps:
128132
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
129-
- name: Xcode 16.2
130-
run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
133+
- name: Xcode
134+
run: sudo xcode-select -s /Applications/${{ env.MIN_XCODE }}.app/Contents/Developer
131135
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
132136
- name: Setup Bundler
133137
run: ./scripts/setup_bundler.sh
@@ -176,8 +180,8 @@ jobs:
176180
FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
177181
runs-on: macos-14
178182
steps:
179-
- name: Xcode 16.2
180-
run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
183+
- name: Xcode
184+
run: sudo xcode-select -s /Applications/${{ env.MIN_XCODE }}.app/Contents/Developer
181185
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
182186
- name: Get framework dir
183187
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0

0 commit comments

Comments
 (0)