Skip to content

Commit 60ac2d8

Browse files
authored
Add Xcode 15 CI for Storage (#11983)
1 parent a64205b commit 60ac2d8

File tree

5 files changed

+81
-45
lines changed

5 files changed

+81
-45
lines changed

.github/workflows/storage.yml

Lines changed: 64 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,17 @@ jobs:
2020
storage:
2121
# Don't run on private repo unless it is a PR.
2222
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
23+
strategy:
24+
matrix:
25+
include:
26+
# Only one os to avoid contention in the integration tests.
27+
# - os: macos-12
28+
# xcode: Xcode_14.2
29+
- os: macos-13
30+
xcode: xcode_15.0.1
2331
env:
2432
plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
25-
runs-on: macos-12
33+
runs-on: ${{ matrix.os }}
2634
steps:
2735
- uses: actions/checkout@v3
2836
- uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
@@ -43,35 +51,56 @@ jobs:
4351
run: |
4452
scripts/decrypt_gha_secret.sh scripts/gha-encrypted/Storage/Credentials.swift.gpg \
4553
FirebaseStorage/Tests/Integration/Credentials.swift "$plist_secret"
54+
- name: Xcode
55+
run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
4656
- name: BuildAndTest # can be replaced with pod lib lint with CocoaPods 1.10
4757
run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/build.sh Storage all)
4858

4959
spm:
5060
# Don't run on private repo unless it is a PR.
5161
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
52-
runs-on: macos-12
62+
strategy:
63+
matrix:
64+
include:
65+
- os: macos-12
66+
xcode: Xcode_14.2
67+
- os: macos-13
68+
xcode: xcode_15.0.1
69+
runs-on: ${{ matrix.os }}
5370
steps:
5471
- uses: actions/checkout@v3
5572
- uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
5673
with:
5774
cache_key: ${{ matrix.os }}
75+
- name: Xcode
76+
run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
5877
- name: Initialize xcodebuild
5978
run: scripts/setup_spm_tests.sh
6079
- name: Swift Unit Tests
6180
run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseStorageUnit iOS spm
6281

6382
spm-cron:
6483
# Don't run on private repo.
65-
if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
66-
runs-on: macos-12
84+
# if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
6785
strategy:
6886
matrix:
6987
target: [tvOS, macOS, catalyst, watchOS]
88+
os: [macos-12, macos-13]
89+
include:
90+
- os: macos-12
91+
xcode: Xcode_14.2
92+
- os: macos-13
93+
xcode: xcode_15.0.1
94+
runs-on: ${{ matrix.os }}
7095
steps:
7196
- uses: actions/checkout@v3
7297
- uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
7398
with:
7499
cache_key: ${{ matrix.os }}
100+
- name: Xcodes
101+
run: ls -l /Applications/Xcode*
102+
- name: Xcode
103+
run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
75104
- name: Initialize xcodebuild
76105
run: scripts/setup_spm_tests.sh
77106
- name: Unit Tests
@@ -80,11 +109,18 @@ jobs:
80109
quickstart:
81110
# Don't run on private repo unless it is a PR.
82111
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
112+
strategy:
113+
matrix:
114+
include:
115+
- os: macos-12
116+
xcode: Xcode_14.2
117+
- os: macos-13
118+
xcode: xcode_15.0.1
83119
env:
84120
plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
85121
signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
86122
LEGACY: true
87-
runs-on: macos-12
123+
runs-on: ${{ matrix.os }}
88124
steps:
89125
- uses: actions/checkout@v3
90126
- uses: ruby/setup-ruby@v1
@@ -93,6 +129,8 @@ jobs:
93129
- name: Install Secret GoogleService-Info.plist
94130
run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-storage.plist.gpg \
95131
quickstart-ios/storage/GoogleService-Info.plist "$plist_secret"
132+
- name: Xcode
133+
run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
96134
- name: Test objc quickstart
97135
run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Storage true)
98136
- name: Test swift quickstart
@@ -128,31 +166,49 @@ jobs:
128166
pod-lib-lint:
129167
# Don't run on private repo unless it is a PR.
130168
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
131-
runs-on: macos-12
132169
strategy:
133170
matrix:
134171
target: [ios, tvos, macos, watchos]
172+
os: [macos-12, macos-13]
173+
include:
174+
- os: macos-12
175+
xcode: Xcode_14.2
176+
- os: macos-13
177+
xcode: xcode_15.0.1
178+
runs-on: ${{ matrix.os }}
135179
steps:
136180
- uses: actions/checkout@v3
137181
- uses: ruby/setup-ruby@v1
138182
- name: Setup Bundler
139183
run: scripts/setup_bundler.sh
184+
- name: Xcodes
185+
run: ls -l /Applications/Xcode*
186+
- name: Xcode
187+
run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
140188
- name: Build and test
141189
run: |
142190
scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseStorage.podspec --test-specs=unit --platforms=${{ matrix.target }}
143191
144192
storage-cron-only:
145193
# Don't run on private repo.
146-
if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
147-
runs-on: macos-12
194+
# if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
148195
strategy:
149196
matrix:
150197
target: [ios, tvos, macos, watchos]
198+
os: [macos-12, macos-13]
199+
include:
200+
- os: macos-12
201+
xcode: Xcode_14.2
202+
- os: macos-13
203+
xcode: xcode_15.0.1
204+
runs-on: ${{ matrix.os }}
151205
needs: pod-lib-lint
152206
steps:
153207
- uses: actions/checkout@v3
154208
- uses: ruby/setup-ruby@v1
155209
- name: Setup Bundler
156210
run: scripts/setup_bundler.sh
211+
- name: Xcode
212+
run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
157213
- name: PodLibLint Storage Cron
158214
run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseStorage.podspec --platforms=${{ matrix.target }} --use-static-frameworks --skip-tests

CocoapodsIntegrationTest/scripts/build_with_environment.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function runXcodebuild() {
2727
-workspace 'CocoapodsIntegrationTest.xcworkspace'
2828
-scheme 'CocoapodsIntegrationTest'
2929
-sdk 'iphonesimulator'
30-
-destination 'platform=iOS Simulator,name=iPhone 11'
30+
-destination 'platform=iOS Simulator,name=iPhone 14'
3131
CODE_SIGNING_REQUIRED=NO
3232
clean
3333
build

scripts/build.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,15 +137,15 @@ function ExportLogs() {
137137
python "${scripts_dir}/xcresult_logs.py" "$@"
138138
}
139139

140-
if [[ "$xcode_major" -lt 11 ]]; then
140+
if [[ "$xcode_major" -lt 15 ]]; then
141141
ios_flags=(
142142
-sdk 'iphonesimulator'
143-
-destination 'platform=iOS Simulator,name=iPhone 7'
143+
-destination 'platform=iOS Simulator,name=iPhone 14'
144144
)
145145
else
146146
ios_flags=(
147147
-sdk 'iphonesimulator'
148-
-destination 'platform=iOS Simulator,name=iPhone 11'
148+
-destination 'platform=iOS Simulator,name=iPhone 15'
149149
)
150150
fi
151151

scripts/xcresult_logs.py

Lines changed: 12 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -54,27 +54,19 @@ def main():
5454
scheme = flags['-scheme']
5555
xcresult_path = find_xcresult_path(project, scheme)
5656

57-
version = find_xcode_major_version()
58-
if version <= 10:
59-
files = find_legacy_log_files(xcresult_path)
60-
cat_files(files, sys.stdout)
61-
57+
log_id = find_log_id(xcresult_path)
58+
log = export_log(xcresult_path, log_id)
59+
60+
# Avoid a potential UnicodeEncodeError raised by sys.stdout.write() by
61+
# doing a relaxed encoding ourselves.
62+
if hasattr(sys.stdout, 'buffer'):
63+
log_encoded = log.encode('utf8', errors='backslashreplace')
64+
sys.stdout.flush()
65+
sys.stdout.buffer.write(log_encoded)
6266
else:
63-
# Xcode 11 and up ship xcresult tool which standardizes the xcresult format
64-
# but also makes it harder to deal with.
65-
log_id = find_log_id(xcresult_path)
66-
log = export_log(xcresult_path, log_id)
67-
68-
# Avoid a potential UnicodeEncodeError raised by sys.stdout.write() by
69-
# doing a relaxed encoding ourselves.
70-
if hasattr(sys.stdout, 'buffer'):
71-
log_encoded = log.encode('utf8', errors='backslashreplace')
72-
sys.stdout.flush()
73-
sys.stdout.buffer.write(log_encoded)
74-
else:
75-
log_encoded = log.encode('ascii', errors='backslashreplace')
76-
log_decoded = log_encoded.decode('ascii', errors='strict')
77-
sys.stdout.write(log_decoded)
67+
log_encoded = log.encode('ascii', errors='backslashreplace')
68+
log_decoded = log_encoded.decode('ascii', errors='strict')
69+
sys.stdout.write(log_decoded)
7870

7971

8072
# Most flags on the xcodebuild command-line are uninteresting, so only pull
@@ -277,18 +269,6 @@ def collect_log_output(activity_log, result):
277269
collect_log_output(subsection, result)
278270

279271

280-
def find_xcode_major_version():
281-
"""Determines the major version number of Xcode."""
282-
cmd = ['xcodebuild', '-version']
283-
command_trace.log(cmd)
284-
285-
result = str(subprocess.check_output(cmd))
286-
version = result.split('\n', 1)[0]
287-
version = re.sub(r'Xcode ', '', version)
288-
version = re.sub(r'\..*', '', version)
289-
return int(version)
290-
291-
292272
def xcresulttool(*args):
293273
"""Runs xcresulttool and returns its output as a string."""
294274
cmd = ['xcrun', 'xcresulttool']

scripts/zip_quickstart_test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ fi
3434
xcodebuild \
3535
-project ${SAMPLE}Example.xcodeproj \
3636
-scheme ${SAMPLE}Example${SWIFT_SUFFIX} \
37-
-destination 'platform=iOS Simulator,name=iPhone 11 Pro' "SWIFT_VERSION=5.3" "OTHER_LDFLAGS=\$(OTHER_LDFLAGS) -ObjC" "FRAMEWORK_SEARCH_PATHS= \$(PROJECT_DIR)/Firebase/" HEADER_SEARCH_PATHS='$(PROJECT_DIR)/Firebase' \
37+
-destination 'platform=iOS Simulator,name=iPhone 15' "SWIFT_VERSION=5.3" "OTHER_LDFLAGS=\$(OTHER_LDFLAGS) -ObjC" "FRAMEWORK_SEARCH_PATHS= \$(PROJECT_DIR)/Firebase/" HEADER_SEARCH_PATHS='$(PROJECT_DIR)/Firebase' \
3838
build \
3939
test \
4040
) || EXIT_STATUS=$?

0 commit comments

Comments
 (0)