Skip to content

Commit

Permalink
Stop flooding Swift Package Manager projects with Firebase test schemes
Browse files Browse the repository at this point in the history
  • Loading branch information
paulb777 committed Jun 7, 2021
1 parent 500ea2d commit 2b04d4a
Show file tree
Hide file tree
Showing 39 changed files with 62 additions and 32 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/abtesting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Initialize xcodebuild
run: xcodebuild -list
run: scripts/setup_spm_tests.sh
- name: iOS Unit Tests
run: scripts/third_party/travis/retry.sh ./scripts/build.sh ABTestingUnit iOS spm

Expand All @@ -50,7 +50,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Initialize xcodebuild
run: xcodebuild -list
run: scripts/setup_spm_tests.sh
- name: Unit Tests
run: scripts/third_party/travis/retry.sh ./scripts/build.sh ABTestingUnit ${{ matrix.target }} spm

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/app_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Initialize xcodebuild
run: xcodebuild -list
run: scripts/setup_spm_tests.sh
- name: iOS Unit Tests
run: scripts/third_party/travis/retry.sh ./scripts/build.sh AppCheckUnit iOS spm ${{ matrix.diagnostic }}
- name: Upload raw logs if failed
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/appdistribution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Initialize xcodebuild
run: xcodebuild -list
run: scripts/setup_spm_tests.sh
- name: iOS Unit Tests
run: scripts/third_party/travis/retry.sh ./scripts/build.sh AppDistributionUnit iOS spm

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/auth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Initialize xcodebuild
run: xcodebuild -list
run: scripts/setup_spm_tests.sh
- name: Unit Tests
run: scripts/third_party/travis/retry.sh ./scripts/build.sh AuthUnit ${{ matrix.target }} spm

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/core-diagnostics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Initialize xcodebuild
run: xcodebuild -list
run: scripts/setup_spm_tests.sh
- name: iOS Unit Tests
run: scripts/third_party/travis/retry.sh ./scripts/build.sh CoreUnit iOS spm

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Initialize xcodebuild
run: xcodebuild -list
run: scripts/setup_spm_tests.sh
- name: iOS Unit Tests
run: scripts/third_party/travis/retry.sh ./scripts/build.sh CoreUnit iOS spm

Expand All @@ -49,7 +49,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Initialize xcodebuild
run: xcodebuild -list
run: scripts/setup_spm_tests.sh
- name: Unit Tests
run: scripts/third_party/travis/retry.sh ./scripts/build.sh CoreUnit ${{ matrix.target }} spm

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/crashlytics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Initialize xcodebuild
run: xcodebuild -list
run: scripts/setup_spm_tests.sh
- name: iOS Unit Tests
run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseCrashlytics iOS spmbuildonly

Expand All @@ -52,7 +52,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Initialize xcodebuild
run: xcodebuild -list
run: scripts/setup_spm_tests.sh
- name: Unit Tests
run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseCrashlytics ${{ matrix.target }} spmbuildonly

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Initialize xcodebuild
run: xcodebuild -list
run: scripts/setup_spm_tests.sh
- name: iOS Unit Tests
run: scripts/third_party/travis/retry.sh ./scripts/build.sh DatabaseUnit iOS spm

Expand All @@ -62,7 +62,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Initialize xcodebuild
run: xcodebuild -list
run: scripts/setup_spm_tests.sh
- name: Unit Tests
run: scripts/third_party/travis/retry.sh ./scripts/build.sh DatabaseUnit ${{ matrix.target }} spm

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dynamiclinks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Initialize xcodebuild
run: xcodebuild -list
run: scripts/setup_spm_tests.sh
- name: iOS Unit Tests
run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseDynamicLinks iOS spmbuildonly

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/firestore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Initialize xcodebuild
run: xcodebuild -list
run: scripts/setup_spm_tests.sh
- name: iOS Build Test
run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseFirestore iOS spmbuildonly
- name: Swift Build
Expand All @@ -216,7 +216,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Initialize xcodebuild
run: xcodebuild -list
run: scripts/setup_spm_tests.sh
- name: Build Test
run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseFirestore ${{ matrix.target }} spmbuildonly
- name: Swift Build
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/functions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Initialize xcodebuild
run: xcodebuild -list
run: scripts/setup_spm_tests.sh
- name: iOS Unit Tests
run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseFunctions iOS spmbuildonly
- name: Combine Unit Tests
Expand All @@ -59,7 +59,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Initialize xcodebuild
run: xcodebuild -list
run: scripts/setup_spm_tests.sh
- name: Unit Tests
run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseFunctions ${{ matrix.target }} spmbuildonly

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/inappmessaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Initialize xcodebuild
run: xcodebuild -list
run: scripts/setup_spm_tests.sh
- name: iOS Unit Tests
run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseInAppMessaging-Beta iOS spmbuildonly

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/installations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Initialize xcodebuild
run: xcodebuild -list
run: scripts/setup_spm_tests.sh
- name: iOS Unit Tests
run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseInstallations iOS spmbuildonly

Expand All @@ -59,7 +59,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Initialize xcodebuild
run: xcodebuild -list
run: scripts/setup_spm_tests.sh
- name: Unit Tests
run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseInstallations ${{ matrix.target }} spmbuildonly

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/messaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Initialize xcodebuild
run: xcodebuild -list
run: scripts/setup_spm_tests.sh
- name: Unit Tests
run: scripts/third_party/travis/retry.sh ./scripts/build.sh MessagingUnit ${{ matrix.target }} spm

Expand All @@ -77,7 +77,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Initialize xcodebuild
run: xcodebuild -list
run: scripts/setup_spm_tests.sh
- name: Unit Tests
run: scripts/third_party/travis/retry.sh ./scripts/build.sh MessagingUnit ${{ matrix.target }} spm

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/mlmodeldownloader.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Initialize xcodebuild
run: xcodebuild -list
run: scripts/setup_spm_tests.sh
- name: iOS Unit Tests
run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseMLModelDownloaderUnit iOS spm

Expand All @@ -73,7 +73,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Initialize xcodebuild
run: xcodebuild -list
run: scripts/setup_spm_tests.sh
- name: Unit Tests
run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseMLModelDownloaderUnit ${{ matrix.target }} spm

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/remoteconfig.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Initialize xcodebuild
run: xcodebuild -list
run: scripts/setup_spm_tests.sh
- name: iOS Unit Tests
run: scripts/third_party/travis/retry.sh ./scripts/build.sh RemoteConfigUnit iOS spm

Expand All @@ -79,7 +79,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Initialize xcodebuild
run: xcodebuild -list
run: scripts/setup_spm_tests.sh
- name: Unit Tests
run: scripts/third_party/travis/retry.sh ./scripts/build.sh RemoteConfigUnit ${{ matrix.target }} spm

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/spm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Initialize xcodebuild
run: xcodebuild -list
run: scripts/setup_spm_tests.sh
- name: iOS Unit Tests
run: scripts/third_party/travis/retry.sh ./scripts/build.sh Firebase-Package iOS spm

Expand All @@ -34,7 +34,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Initialize xcodebuild
run: xcodebuild -list
run: scripts/setup_spm_tests.sh
- name: iOS Unit Tests
# TODO (#7785) Change to Firebase-Package when #7785 is resolved.
run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseFirestoreSwift-Beta iOS-device spmbuildonly
Expand All @@ -52,6 +52,6 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Initialize xcodebuild
run: xcodebuild -list
run: scripts/setup_spm_tests.sh
- name: Unit Tests
run: scripts/third_party/travis/retry.sh ./scripts/build.sh ${{ matrix.test }} ${{ matrix.target }} spm
4 changes: 2 additions & 2 deletions .github/workflows/storage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Initialize xcodebuild
run: xcodebuild -list
run: scripts/setup_spm_tests.sh
- name: iOS Unit Tests
run: scripts/third_party/travis/retry.sh ./scripts/build.sh StorageUnit iOS spm
- name: Swift Build
Expand All @@ -64,7 +64,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Initialize xcodebuild
run: xcodebuild -list
run: scripts/setup_spm_tests.sh
- name: Unit Tests
run: scripts/third_party/travis/retry.sh ./scripts/build.sh StorageUnit ${{ matrix.target }} spm
- name: Swift Build
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ scripts/code_coverage_report/*/Package.resolved
scripts/code_coverage_report/*/.build

# Bad sorts get generated if the package .xcscheme is not regenerated.
.swiftpm/xcode/xcshareddata/xcschemes/Firebase-Package.xcscheme
# Anything committed to xcshareddata gets propagated to clients. (#8167)
.swiftpm/xcode/xcshareddata/

# Mint package manager
Mint
Expand Down
3 changes: 3 additions & 0 deletions FirebaseCore/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Firebase 8.2.0
- [fixed] Stop flooding Swift Package Manager projects with Firebase test schemes. (#8167)

# Firebase 8.0.0
- [removed] The deprecated Firebase InstanceID has been removed. Use Firebase Installations to manage
app instance and use Firebase Messaging to manage FCM registration token instead. (#7970)
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ Alternatively disable signing in each target:
* Add `CODE_SIGNING_REQUIRED` setting with a value of `NO`

### Swift Package Manager
* To enable test schemes: `./scripts/setup_spm_tests.sh`
* `open Package.swift` or double click `Package.swift` in Finder.
* Xcode will open the project
* Choose a scheme for a library to build or test suite to run
Expand Down
25 changes: 25 additions & 0 deletions scripts/setup_spm_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Move schemes into place to run Swift Package Manager tests
# These cannot be stored in the correct location because they cause
# clutter for SDK clients.
# Details in https://github.com/firebase/firebase-ios-sdk/issues/8167 and
# https://forums.swift.org/t/swiftpm-and-library-unit-testing/26255/21

mkdir -p .swiftpm/xcode/xcshareddata/xcschemes
cp scripts/spm_test_schemes/* .swiftpm/xcode/xcshareddata/xcschemes/
xcodebuild -list
File renamed without changes.
File renamed without changes.

0 comments on commit 2b04d4a

Please sign in to comment.