diff --git a/.github/workflows/storage.yml b/.github/workflows/storage.yml index c1a9a22434d..940cb5a4816 100644 --- a/.github/workflows/storage.yml +++ b/.github/workflows/storage.yml @@ -20,9 +20,17 @@ jobs: storage: # Don't run on private repo unless it is a PR. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' + strategy: + matrix: + include: + # Only one os to avoid contention in the integration tests. + # - os: macos-12 + # xcode: Xcode_14.2 + - os: macos-13 + xcode: xcode_15.0.1 env: plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }} - runs-on: macos-12 + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126 @@ -43,18 +51,29 @@ jobs: run: | scripts/decrypt_gha_secret.sh scripts/gha-encrypted/Storage/Credentials.swift.gpg \ FirebaseStorage/Tests/Integration/Credentials.swift "$plist_secret" + - name: Xcode + run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer - name: BuildAndTest # can be replaced with pod lib lint with CocoaPods 1.10 run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/build.sh Storage all) spm: # Don't run on private repo unless it is a PR. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' - runs-on: macos-12 + strategy: + matrix: + include: + - os: macos-12 + xcode: Xcode_14.2 + - os: macos-13 + xcode: xcode_15.0.1 + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126 with: cache_key: ${{ matrix.os }} + - name: Xcode + run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer - name: Initialize xcodebuild run: scripts/setup_spm_tests.sh - name: Swift Unit Tests @@ -62,16 +81,26 @@ jobs: spm-cron: # Don't run on private repo. - if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk' - runs-on: macos-12 +# if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk' strategy: matrix: target: [tvOS, macOS, catalyst, watchOS] + os: [macos-12, macos-13] + include: + - os: macos-12 + xcode: Xcode_14.2 + - os: macos-13 + xcode: xcode_15.0.1 + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126 with: cache_key: ${{ matrix.os }} + - name: Xcodes + run: ls -l /Applications/Xcode* + - name: Xcode + run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer - name: Initialize xcodebuild run: scripts/setup_spm_tests.sh - name: Unit Tests @@ -80,11 +109,18 @@ jobs: quickstart: # Don't run on private repo unless it is a PR. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' + strategy: + matrix: + include: + - os: macos-12 + xcode: Xcode_14.2 + - os: macos-13 + xcode: xcode_15.0.1 env: plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }} signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }} LEGACY: true - runs-on: macos-12 + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 - uses: ruby/setup-ruby@v1 @@ -93,6 +129,8 @@ jobs: - name: Install Secret GoogleService-Info.plist run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-storage.plist.gpg \ quickstart-ios/storage/GoogleService-Info.plist "$plist_secret" + - name: Xcode + run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer - name: Test objc quickstart run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Storage true) - name: Test swift quickstart @@ -128,31 +166,49 @@ jobs: pod-lib-lint: # Don't run on private repo unless it is a PR. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' - runs-on: macos-12 strategy: matrix: target: [ios, tvos, macos, watchos] + os: [macos-12, macos-13] + include: + - os: macos-12 + xcode: Xcode_14.2 + - os: macos-13 + xcode: xcode_15.0.1 + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 - uses: ruby/setup-ruby@v1 - name: Setup Bundler run: scripts/setup_bundler.sh + - name: Xcodes + run: ls -l /Applications/Xcode* + - name: Xcode + run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer - name: Build and test run: | scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseStorage.podspec --test-specs=unit --platforms=${{ matrix.target }} storage-cron-only: # Don't run on private repo. - if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk' - runs-on: macos-12 +# if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk' strategy: matrix: target: [ios, tvos, macos, watchos] + os: [macos-12, macos-13] + include: + - os: macos-12 + xcode: Xcode_14.2 + - os: macos-13 + xcode: xcode_15.0.1 + runs-on: ${{ matrix.os }} needs: pod-lib-lint steps: - uses: actions/checkout@v3 - uses: ruby/setup-ruby@v1 - name: Setup Bundler run: scripts/setup_bundler.sh + - name: Xcode + run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer - name: PodLibLint Storage Cron run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseStorage.podspec --platforms=${{ matrix.target }} --use-static-frameworks --skip-tests diff --git a/CocoapodsIntegrationTest/scripts/build_with_environment.sh b/CocoapodsIntegrationTest/scripts/build_with_environment.sh index b78d70c0ec1..f413c9ed5b2 100755 --- a/CocoapodsIntegrationTest/scripts/build_with_environment.sh +++ b/CocoapodsIntegrationTest/scripts/build_with_environment.sh @@ -27,7 +27,7 @@ function runXcodebuild() { -workspace 'CocoapodsIntegrationTest.xcworkspace' -scheme 'CocoapodsIntegrationTest' -sdk 'iphonesimulator' - -destination 'platform=iOS Simulator,name=iPhone 11' + -destination 'platform=iOS Simulator,name=iPhone 14' CODE_SIGNING_REQUIRED=NO clean build diff --git a/scripts/build.sh b/scripts/build.sh index 82f9184dc48..361d2426092 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -137,15 +137,15 @@ function ExportLogs() { python "${scripts_dir}/xcresult_logs.py" "$@" } -if [[ "$xcode_major" -lt 11 ]]; then +if [[ "$xcode_major" -lt 15 ]]; then ios_flags=( -sdk 'iphonesimulator' - -destination 'platform=iOS Simulator,name=iPhone 7' + -destination 'platform=iOS Simulator,name=iPhone 14' ) else ios_flags=( -sdk 'iphonesimulator' - -destination 'platform=iOS Simulator,name=iPhone 11' + -destination 'platform=iOS Simulator,name=iPhone 15' ) fi diff --git a/scripts/xcresult_logs.py b/scripts/xcresult_logs.py index 744734ebfa7..de73f926a45 100755 --- a/scripts/xcresult_logs.py +++ b/scripts/xcresult_logs.py @@ -54,27 +54,19 @@ def main(): scheme = flags['-scheme'] xcresult_path = find_xcresult_path(project, scheme) - version = find_xcode_major_version() - if version <= 10: - files = find_legacy_log_files(xcresult_path) - cat_files(files, sys.stdout) - + log_id = find_log_id(xcresult_path) + log = export_log(xcresult_path, log_id) + + # Avoid a potential UnicodeEncodeError raised by sys.stdout.write() by + # doing a relaxed encoding ourselves. + if hasattr(sys.stdout, 'buffer'): + log_encoded = log.encode('utf8', errors='backslashreplace') + sys.stdout.flush() + sys.stdout.buffer.write(log_encoded) else: - # Xcode 11 and up ship xcresult tool which standardizes the xcresult format - # but also makes it harder to deal with. - log_id = find_log_id(xcresult_path) - log = export_log(xcresult_path, log_id) - - # Avoid a potential UnicodeEncodeError raised by sys.stdout.write() by - # doing a relaxed encoding ourselves. - if hasattr(sys.stdout, 'buffer'): - log_encoded = log.encode('utf8', errors='backslashreplace') - sys.stdout.flush() - sys.stdout.buffer.write(log_encoded) - else: - log_encoded = log.encode('ascii', errors='backslashreplace') - log_decoded = log_encoded.decode('ascii', errors='strict') - sys.stdout.write(log_decoded) + log_encoded = log.encode('ascii', errors='backslashreplace') + log_decoded = log_encoded.decode('ascii', errors='strict') + sys.stdout.write(log_decoded) # Most flags on the xcodebuild command-line are uninteresting, so only pull @@ -277,18 +269,6 @@ def collect_log_output(activity_log, result): collect_log_output(subsection, result) -def find_xcode_major_version(): - """Determines the major version number of Xcode.""" - cmd = ['xcodebuild', '-version'] - command_trace.log(cmd) - - result = str(subprocess.check_output(cmd)) - version = result.split('\n', 1)[0] - version = re.sub(r'Xcode ', '', version) - version = re.sub(r'\..*', '', version) - return int(version) - - def xcresulttool(*args): """Runs xcresulttool and returns its output as a string.""" cmd = ['xcrun', 'xcresulttool'] diff --git a/scripts/zip_quickstart_test.sh b/scripts/zip_quickstart_test.sh index 9aec359fa4d..d1e8e8a8b43 100755 --- a/scripts/zip_quickstart_test.sh +++ b/scripts/zip_quickstart_test.sh @@ -34,7 +34,7 @@ fi xcodebuild \ -project ${SAMPLE}Example.xcodeproj \ -scheme ${SAMPLE}Example${SWIFT_SUFFIX} \ --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' \ +-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' \ build \ test \ ) || EXIT_STATUS=$?