Skip to content

Commit 7f11826

Browse files
Merge branch 'master' into mrschmidt/userdatareader
2 parents 5c1e66f + 6eaf761 commit 7f11826

File tree

6 files changed

+119
-61
lines changed

6 files changed

+119
-61
lines changed

.github/workflows/prerelease.yml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
- cron: '0 7 * * *'
1212

1313
jobs:
14-
buildup_SpecsReleasing_repo:
14+
buildup_SpecsTesting_repo:
1515
# Don't run on private repo unless it is a PR.
1616
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
1717
env:
@@ -31,17 +31,17 @@ jobs:
3131
oss-bot-access.txt "$bot_token_secret"
3232
scripts/decrypt_gha_secret.sh scripts/gha-encrypted/bot-access.txt.gpg \
3333
bot-access.txt "$bot_token_secret"
34-
- name: Update SpecsReleasing repo setup
34+
- name: Update SpecsTesting repo setup
3535
run: |
3636
ossbotaccess=`cat oss-bot-access.txt`
3737
BOT_TOKEN="${ossbotaccess}" test_version="${nightly_version}" sdk_version_config="${GITHUB_WORKSPACE}/scripts/create_spec_repo/RC_firebase_sdk.textproto" local_sdk_repo_dir="${local_sdk_repo_dir}" podspec_repo_branch="${podspec_repo_branch}" scripts/release_testing_setup.sh prerelease_testing
38-
- name: Update SpecsReleasing repo
38+
- name: Update SpecsTesting repo
3939
run: |
4040
botaccess=`cat bot-access.txt`
4141
cd scripts/create_spec_repo/
4242
swift build
43-
pod repo add --silent "${local_repo}" https://"$botaccess"@github.com/FirebasePrivate/SpecsReleasing.git
44-
BOT_TOKEN="${botaccess}" .build/debug/spec-repo-builder --sdk-repo "${local_sdk_repo_dir}" --local-spec-repo-name "${local_repo}" --sdk-repo-name SpecsReleasing --pod-sources 'https://${BOT_TOKEN}@github.com/FirebasePrivate/SpecsReleasing' --pod-sources "https://github.com/firebase/SpecsDev.git" --pod-sources "https://github.com/firebase/SpecsStaging.git" --pod-sources "https://cdn.cocoapods.org/"
43+
pod repo add --silent "${local_repo}" https://"$botaccess"@github.com/Firebase/SpecsTesting.git
44+
BOT_TOKEN="${botaccess}" .build/debug/spec-repo-builder --sdk-repo "${local_sdk_repo_dir}" --local-spec-repo-name "${local_repo}" --sdk-repo-name SpecsTesting --github-account Firebase --pod-sources 'https://${BOT_TOKEN}@github.com/Firebase/SpecsTesting' --pod-sources "https://github.com/firebase/SpecsDev.git" --pod-sources "https://github.com/firebase/SpecsStaging.git" --pod-sources "https://cdn.cocoapods.org/"
4545
- name: Clean Artifacts
4646
if: ${{ always() }}
4747
run: |
@@ -52,7 +52,7 @@ jobs:
5252
# Don't run on private repo unless it is a PR.
5353
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
5454

55-
needs: buildup_SpecsReleasing_repo
55+
needs: buildup_SpecsTesting_repo
5656
env:
5757
plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
5858
signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
@@ -86,7 +86,7 @@ jobs:
8686
auth_quickstart:
8787
# Don't run on private repo unless it is a PR.
8888
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
89-
needs: buildup_SpecsReleasing_repo
89+
needs: buildup_SpecsTesting_repo
9090
env:
9191
plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
9292
signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
@@ -120,7 +120,7 @@ jobs:
120120
crashlytics_quickstart:
121121
# Don't run on private repo unless it is a PR.
122122
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
123-
needs: buildup_SpecsReleasing_repo
123+
needs: buildup_SpecsTesting_repo
124124
env:
125125
plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
126126
signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
@@ -163,7 +163,7 @@ jobs:
163163
database_quickstart:
164164
# Don't run on private repo unless it is a PR.
165165
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
166-
needs: buildup_SpecsReleasing_repo
166+
needs: buildup_SpecsTesting_repo
167167
env:
168168
plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
169169
signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
@@ -201,7 +201,7 @@ jobs:
201201
dynamiclinks_quickstart:
202202
# Don't run on private repo unless it is a PR.
203203
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
204-
needs: buildup_SpecsReleasing_repo
204+
needs: buildup_SpecsTesting_repo
205205
env:
206206
plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
207207
signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
@@ -245,7 +245,7 @@ jobs:
245245
firestore_quickstart:
246246
# Don't run on private repo unless it is a PR.
247247
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
248-
needs: buildup_SpecsReleasing_repo
248+
needs: buildup_SpecsTesting_repo
249249
env:
250250
plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
251251
signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
@@ -282,7 +282,7 @@ jobs:
282282
functions_quickstart:
283283
# Don't run on private repo unless it is a PR.
284284
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
285-
needs: buildup_SpecsReleasing_repo
285+
needs: buildup_SpecsTesting_repo
286286
env:
287287
plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
288288
signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
@@ -324,7 +324,7 @@ jobs:
324324
inappmessaging_quickstart:
325325
# Don't run on private repo unless it is a PR.
326326
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
327-
needs: buildup_SpecsReleasing_repo
327+
needs: buildup_SpecsTesting_repo
328328
env:
329329
plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
330330
signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
@@ -364,7 +364,7 @@ jobs:
364364
messaging_quickstart:
365365
# Don't run on private repo unless it is a PR.
366366
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
367-
needs: buildup_SpecsReleasing_repo
367+
needs: buildup_SpecsTesting_repo
368368
env:
369369
plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
370370
signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
@@ -404,7 +404,7 @@ jobs:
404404
remoteconfig_quickstart:
405405
# Don't run on private repo unless it is a PR.
406406
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
407-
needs: buildup_SpecsReleasing_repo
407+
needs: buildup_SpecsTesting_repo
408408
env:
409409
plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
410410
signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
@@ -438,7 +438,7 @@ jobs:
438438
storage_quickstart:
439439
# Don't run on private repo unless it is a PR.
440440
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
441-
needs: buildup_SpecsReleasing_repo
441+
needs: buildup_SpecsTesting_repo
442442
env:
443443
plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
444444
signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
@@ -476,7 +476,7 @@ jobs:
476476
performance_quickstart:
477477
# Don't run on private repo unless it is a PR.
478478
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
479-
needs: buildup_SpecsReleasing_repo
479+
needs: buildup_SpecsTesting_repo
480480
env:
481481
plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
482482
signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}

.github/workflows/storage.yml

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,14 +117,17 @@ jobs:
117117
# watchos is disabled since pod lib lint cannot handle test Auth dep even if the dep is only
118118
# specified for the other three platforms.
119119
target: [ios, tvos, macos]
120+
spec: [
121+
'FirebaseStorage.podspec --test-specs=unit', # The integration tests need more set up.
122+
'FirebaseStorageSwift.podspec --skip-tests' # No current unit tests.
123+
]
120124
steps:
121125
- uses: actions/checkout@v2
122126
- name: Setup Bundler
123127
run: scripts/setup_bundler.sh
124128
- name: Build and test
125129
run: |
126-
scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseStorage.podspec --skip-tests --platforms=${{ matrix.target }}
127-
scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseStorageSwift.podspec --skip-tests --platforms=${{ matrix.target }}
130+
scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb ${{ matrix.spec }} --platforms=${{ matrix.target }}
128131
129132
storage-cron-only:
130133
# Don't run on private repo.
@@ -134,8 +137,8 @@ jobs:
134137
matrix:
135138
target: [ios, tvos, macos]
136139
flags: [
137-
'--skip-tests --use-static-frameworks',
138-
'--skip-tests --use-libraries'
140+
'--use-static-frameworks --skip-tests ',
141+
'--use-libraries --skip-tests '
139142
]
140143
needs: pod-lib-lint
141144
steps:
@@ -145,4 +148,22 @@ jobs:
145148
- name: PodLibLint Storage Cron
146149
run: |
147150
scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseStorage.podspec --platforms=${{ matrix.target }} ${{ matrix.flags }}
148-
scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseStorage.podspec --platforms=${{ matrix.target }} ${{ matrix.flags }}
151+
152+
storageswift-cron-only:
153+
# Don't run on private repo.
154+
if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
155+
runs-on: macos-latest
156+
strategy:
157+
matrix:
158+
target: [ios, tvos, macos]
159+
flags: [
160+
'--use-static-frameworks --skip-tests', # Swift pods do not support --use-libraries
161+
]
162+
needs: pod-lib-lint
163+
steps:
164+
- uses: actions/checkout@v2
165+
- name: Setup Bundler
166+
run: scripts/setup_bundler.sh
167+
- name: PodLibLint Storage Cron
168+
run: |
169+
scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseStorageSwift.podspec --platforms=${{ matrix.target }} ${{ matrix.flags }}

scripts/build.sh

Lines changed: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -496,13 +496,11 @@ case "$product-$platform-$method" in
496496

497497
Storage-*-xcodebuild)
498498
pod_gen FirebaseStorage.podspec --platforms=ios
499-
RunXcodebuild \
500-
-workspace 'gen/FirebaseStorage/FirebaseStorage.xcworkspace' \
501-
-scheme "FirebaseStorage-Unit-unit" \
502-
"${ios_flags[@]}" \
503-
"${xcb_flags[@]}" \
504-
build \
505-
test
499+
500+
# Add GoogleService-Info.plist to generated Test Wrapper App.
501+
ruby ./scripts/update_xcode_target.rb gen/FirebaseStorage/Pods/Pods.xcodeproj \
502+
AppHost-FirebaseStorage-Unit-Tests \
503+
../../../FirebaseStorage/Tests/Integration/Resources/GoogleService-Info.plist
506504

507505
if check_secrets; then
508506
# Integration tests are only run on iOS to minimize flake failures.
@@ -522,28 +520,16 @@ case "$product-$platform-$method" in
522520
build \
523521
test
524522
fi
525-
526-
pod_gen FirebaseStorage.podspec --platforms=macos --clean
527-
RunXcodebuild \
528-
-workspace 'gen/FirebaseStorage/FirebaseStorage.xcworkspace' \
529-
-scheme "FirebaseStorage-Unit-unit" \
530-
"${macos_flags[@]}" \
531-
"${xcb_flags[@]}" \
532-
build \
533-
test
534-
535-
pod_gen FirebaseStorage.podspec --platforms=tvos --clean
536-
RunXcodebuild \
537-
-workspace 'gen/FirebaseStorage/FirebaseStorage.xcworkspace' \
538-
-scheme "FirebaseStorage-Unit-unit" \
539-
"${tvos_flags[@]}" \
540-
"${xcb_flags[@]}" \
541-
build \
542-
test
543523
;;
544524

545525
StorageSwift-*-xcodebuild)
546526
pod_gen FirebaseStorageSwift.podspec --platforms=ios
527+
528+
# Add GoogleService-Info.plist to generated Test Wrapper App.
529+
ruby ./scripts/update_xcode_target.rb gen/FirebaseStorageSwift/Pods/Pods.xcodeproj \
530+
AppHost-FirebaseStorageSwift-Unit-Tests \
531+
../../../FirebaseStorage/Tests/Integration/Resources/GoogleService-Info.plist
532+
547533
if check_secrets; then
548534
# Integration tests are only run on iOS to minimize flake failures.
549535
RunXcodebuild \

scripts/code_coverage_report/code_coverage_file_list.json

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,6 @@
4646
"FirebaseFirestore\\.podspec",
4747
"CMakeLists\\.txt",
4848
"cmake/.*",
49-
"scripts/binary_to_array\\.py",
50-
"scripts/build\\.sh",
51-
"scripts/install_prereqs\\.sh",
52-
"scripts/localize_podfile\\.swift",
53-
"scripts/pod_lib_lint\\.rb",
54-
"scripts/run_firestore_emulator\\.sh",
55-
"scripts/setup_[^/]+",
56-
"scripts/sync_project\\.rb",
57-
"scripts/test_quickstart\\.sh",
58-
"scripts/xcresult_logs\\.py",
5949
"\\.github/workflows/firestore\\.yml",
6050
"Gemfile"
6151
]

scripts/create_spec_repo/Sources/SpecRepoBuilder/main.swift

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ extension Constants {
2323
static let skipLinesWithWords = ["unit_tests", "test_spec"]
2424
static let dependencyLineSeparators = CharacterSet(charactersIn: " ,/")
2525
static let podSources = [
26-
"https://${BOT_TOKEN}@github.com/FirebasePrivate/SpecsTesting",
26+
"https://${BOT_TOKEN}@github.com/Firebase/SpecsTesting",
2727
"https://github.com/firebase/SpecsStaging.git",
2828
"https://cdn.cocoapods.org/",
2929
]
@@ -100,6 +100,8 @@ enum SpecRepoBuilderError: Error {
100100
case failedToPush(pods: [String])
101101
// Error occurs when a podspec is not found in the repo.
102102
case podspecNotFound(_ podspec: String, from: String)
103+
// Error occurs when a direotyr path cannot be determined.
104+
case pathNotFound(_ path: String)
103105
}
104106

105107
struct SpecRepoBuilder: ParsableCommand {
@@ -258,10 +260,31 @@ struct SpecRepoBuilder: ParsableCommand {
258260
)
259261
let fileManager = FileManager.default
260262
do {
261-
let dirs = try fileManager.contentsOfDirectory(atPath: "\(repoPath)/\(sdkRepoName)")
263+
let sdk_repo_path = "\(repoPath)/\(sdkRepoName)"
264+
print("The repo path is \(sdk_repo_path)")
265+
guard let repo_url = URL(string: sdk_repo_path) else {
266+
print("Error: cannot find \(sdk_repo_path).")
267+
Self
268+
.exit(withError: SpecRepoBuilderError
269+
.pathNotFound(sdk_repo_path))
270+
}
271+
// Skip hidden files, e.g. /.git
272+
let dirs = try fileManager.contentsOfDirectory(
273+
at: repo_url,
274+
includingPropertiesForKeys: nil,
275+
options: [.skipsHiddenFiles]
276+
)
277+
print("Found following unhidden dirs: \(dirs)")
262278
for dir in dirs {
263-
if dir != ".git" {
264-
shell.run("cd \(sdkRepoName); git rm -r \(dir)")
279+
guard let isDir = (try dir.resourceValues(forKeys: [.isDirectoryKey])).isDirectory else {
280+
print("Error: cannot determine if \(dir.path) is a directory or not.")
281+
Self
282+
.exit(withError: SpecRepoBuilderError
283+
.pathNotFound(dir.path))
284+
}
285+
if isDir {
286+
print("Removing \(dir.path)")
287+
shell.run("cd \(sdkRepoName); git rm -r \(dir.path)")
265288
}
266289
}
267290
shell.run("cd \(sdkRepoName); git commit -m 'Empty repo'; git push")

scripts/update_xcode_target.rb

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/usr/bin/env ruby
2+
3+
# Copyright 2021 Google LLC
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
# Script to add a file to an Xcode target.
18+
# Adapted from https://github.com/firebase/quickstart-ios/blob/master/scripts/info_script.rb
19+
20+
require 'xcodeproj'
21+
project_path = ARGV[0]
22+
target = ARGV[1]
23+
file_name = ARGV[2]
24+
25+
project = Xcodeproj::Project.open(project_path)
26+
27+
# Add a file to the project in the main group
28+
file = project.new_file(file_name)
29+
30+
# Add the file to the all targets
31+
project.targets.each do |t|
32+
if t.to_s == target
33+
t.add_file_references([file])
34+
end
35+
end
36+
37+
# Save project
38+
project.save()

0 commit comments

Comments
 (0)