From 9d4dd3684147ae567941bece82009e8ba82c53de Mon Sep 17 00:00:00 2001 From: Nick Cooke Date: Mon, 10 Mar 2025 18:50:27 -0400 Subject: [PATCH 1/6] [Swift 6] Add Swift 6 testing for Functions --- .github/workflows/shared-swift.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/shared-swift.yml b/.github/workflows/shared-swift.yml index fd775bbd065..155b59bb1f3 100644 --- a/.github/workflows/shared-swift.yml +++ b/.github/workflows/shared-swift.yml @@ -27,8 +27,13 @@ jobs: build-env: - os: macos-14 xcode: Xcode_15.2 + swift_version: 5.9 - os: macos-15 xcode: Xcode_16.2 + swift_version: 5.9 + - os: macos-15 + xcode: Xcode_16.2 + swift_version: 6.0 runs-on: ${{ matrix.build-env.os }} steps: - uses: actions/checkout@v4 @@ -37,6 +42,8 @@ jobs: run: scripts/setup_bundler.sh - name: Xcode run: sudo xcode-select -s /Applications/${{ matrix.build-env.xcode }}.app/Contents/Developer + - name: Set Swift swift_version + run: sed -i "" "s#s.swift_version = '5.9'#s.swift_version = '${{ matrix.swift_version}}'#" FirebaseSharedSwift.podspec - name: Build and test run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseSharedSwift.podspec --platforms=${{ matrix.target }} From 82b7aa20977d7898d1e5f43e064e26f6503c774d Mon Sep 17 00:00:00 2001 From: Nick Cooke Date: Mon, 10 Mar 2025 19:49:08 -0400 Subject: [PATCH 2/6] spaces --- .github/workflows/shared-swift.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/shared-swift.yml b/.github/workflows/shared-swift.yml index 155b59bb1f3..304255d1b50 100644 --- a/.github/workflows/shared-swift.yml +++ b/.github/workflows/shared-swift.yml @@ -43,7 +43,7 @@ jobs: - name: Xcode run: sudo xcode-select -s /Applications/${{ matrix.build-env.xcode }}.app/Contents/Developer - name: Set Swift swift_version - run: sed -i "" "s#s.swift_version = '5.9'#s.swift_version = '${{ matrix.swift_version}}'#" FirebaseSharedSwift.podspec + run: sed -i "" "s/s.swift_version[[:space:]]*=[[:space:]]*'5.9'/s.swift_version = '${{ matrix.swift_version }}'/" FirebaseSharedSwift.podspec - name: Build and test run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseSharedSwift.podspec --platforms=${{ matrix.target }} From 13e27ffadc0027f343c936edd871da697ca64967 Mon Sep 17 00:00:00 2001 From: Nick Cooke <36927374+ncooke3@users.noreply.github.com> Date: Tue, 11 Mar 2025 10:30:38 -0400 Subject: [PATCH 3/6] Update shared-swift.yml --- .github/workflows/shared-swift.yml | 110 ++++++++++++++--------------- 1 file changed, 55 insertions(+), 55 deletions(-) diff --git a/.github/workflows/shared-swift.yml b/.github/workflows/shared-swift.yml index 304255d1b50..4accc84d5c5 100644 --- a/.github/workflows/shared-swift.yml +++ b/.github/workflows/shared-swift.yml @@ -23,7 +23,7 @@ jobs: strategy: matrix: - target: [ios, tvos, macos, watchos] + target: [ios] #, tvos, macos, watchos] build-env: - os: macos-14 xcode: Xcode_15.2 @@ -38,60 +38,60 @@ jobs: steps: - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 - - name: Setup Bundler - run: scripts/setup_bundler.sh - - name: Xcode - run: sudo xcode-select -s /Applications/${{ matrix.build-env.xcode }}.app/Contents/Developer + # - name: Setup Bundler + # run: scripts/setup_bundler.sh + # - name: Xcode + # run: sudo xcode-select -s /Applications/${{ matrix.build-env.xcode }}.app/Contents/Developer - name: Set Swift swift_version - run: sed -i "" "s/s.swift_version[[:space:]]*=[[:space:]]*'5.9'/s.swift_version = '${{ matrix.swift_version }}'/" FirebaseSharedSwift.podspec - - name: Build and test - run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseSharedSwift.podspec --platforms=${{ matrix.target }} + run: sed -i "" "s/s.swift_version[[:space:]]*=[[:space:]]*'5.9'/s.swift_version = '${{ matrix.swift_version }}'/" FirebaseSharedSwift.podspec; cat FirebaseSharedSwift.podspec + # - name: Build and test + # run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseSharedSwift.podspec --platforms=${{ matrix.target }} - spm-package-resolved: - env: - FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1 - runs-on: macos-14 - outputs: - cache_key: ${{ steps.generate_cache_key.outputs.cache_key }} - steps: - - uses: actions/checkout@v4 - - name: Generate Swift Package.resolved - id: swift_package_resolve - run: | - swift package resolve - - name: Generate cache key - id: generate_cache_key - run: | - cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}" - echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT" - - uses: actions/cache/save@v4 - id: cache - with: - path: .build - key: ${{ steps.generate_cache_key.outputs.cache_key }} + # spm-package-resolved: + # env: + # FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1 + # runs-on: macos-14 + # outputs: + # cache_key: ${{ steps.generate_cache_key.outputs.cache_key }} + # steps: + # - uses: actions/checkout@v4 + # - name: Generate Swift Package.resolved + # id: swift_package_resolve + # run: | + # swift package resolve + # - name: Generate cache key + # id: generate_cache_key + # run: | + # cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}" + # echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT" + # - uses: actions/cache/save@v4 + # id: cache + # with: + # path: .build + # key: ${{ steps.generate_cache_key.outputs.cache_key }} - 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' - needs: [spm-package-resolved] - strategy: - matrix: - target: [iOS, tvOS, macOS, catalyst, watchOS] - build-env: - - os: macos-14 - xcode: Xcode_15.2 - - os: macos-15 - xcode: Xcode_16.2 - runs-on: ${{ matrix.build-env.os }} - steps: - - uses: actions/checkout@v4 - - uses: actions/cache/restore@v4 - with: - path: .build - key: ${{needs.spm-package-resolved.outputs.cache_key}} - - name: Xcode - run: sudo xcode-select -s /Applications/${{ matrix.build-env.xcode }}.app/Contents/Developer - - name: Initialize xcodebuild - run: scripts/setup_spm_tests.sh - - name: Unit Tests - run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseSharedSwiftTests ${{ matrix.target }} spm + # 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' + # needs: [spm-package-resolved] + # strategy: + # matrix: + # target: [iOS, tvOS, macOS, catalyst, watchOS] + # build-env: + # - os: macos-14 + # xcode: Xcode_15.2 + # - os: macos-15 + # xcode: Xcode_16.2 + # runs-on: ${{ matrix.build-env.os }} + # steps: + # - uses: actions/checkout@v4 + # - uses: actions/cache/restore@v4 + # with: + # path: .build + # key: ${{needs.spm-package-resolved.outputs.cache_key}} + # - name: Xcode + # run: sudo xcode-select -s /Applications/${{ matrix.build-env.xcode }}.app/Contents/Developer + # - name: Initialize xcodebuild + # run: scripts/setup_spm_tests.sh + # - name: Unit Tests + # run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseSharedSwiftTests ${{ matrix.target }} spm From e88bc20e6904587cb3ffa36e73582bffc7cae8ca Mon Sep 17 00:00:00 2001 From: Nick Cooke <36927374+ncooke3@users.noreply.github.com> Date: Tue, 11 Mar 2025 10:36:50 -0400 Subject: [PATCH 4/6] Update shared-swift.yml --- .github/workflows/shared-swift.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/shared-swift.yml b/.github/workflows/shared-swift.yml index 4accc84d5c5..2e6764fb8e7 100644 --- a/.github/workflows/shared-swift.yml +++ b/.github/workflows/shared-swift.yml @@ -43,7 +43,7 @@ jobs: # - name: Xcode # run: sudo xcode-select -s /Applications/${{ matrix.build-env.xcode }}.app/Contents/Developer - name: Set Swift swift_version - run: sed -i "" "s/s.swift_version[[:space:]]*=[[:space:]]*'5.9'/s.swift_version = '${{ matrix.swift_version }}'/" FirebaseSharedSwift.podspec; cat FirebaseSharedSwift.podspec + run: sed -i "" "s/s.swift_version[[:space:]]*=[[:space:]]*'5.9'/s.swift_version = '${{ matrix.build-env.swift_version }}'/" FirebaseSharedSwift.podspec; cat FirebaseSharedSwift.podspec # - name: Build and test # run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseSharedSwift.podspec --platforms=${{ matrix.target }} From 9131e3312115d618542a583a902a6be09b7e728e Mon Sep 17 00:00:00 2001 From: Nick Cooke <36927374+ncooke3@users.noreply.github.com> Date: Tue, 11 Mar 2025 10:41:30 -0400 Subject: [PATCH 5/6] Update shared-swift.yml --- .github/workflows/shared-swift.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/shared-swift.yml b/.github/workflows/shared-swift.yml index 2e6764fb8e7..6f756d46f30 100644 --- a/.github/workflows/shared-swift.yml +++ b/.github/workflows/shared-swift.yml @@ -38,14 +38,14 @@ jobs: steps: - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 - # - name: Setup Bundler - # run: scripts/setup_bundler.sh - # - name: Xcode - # run: sudo xcode-select -s /Applications/${{ matrix.build-env.xcode }}.app/Contents/Developer + - name: Setup Bundler + run: scripts/setup_bundler.sh + - name: Xcode + run: sudo xcode-select -s /Applications/${{ matrix.build-env.xcode }}.app/Contents/Developer - name: Set Swift swift_version - run: sed -i "" "s/s.swift_version[[:space:]]*=[[:space:]]*'5.9'/s.swift_version = '${{ matrix.build-env.swift_version }}'/" FirebaseSharedSwift.podspec; cat FirebaseSharedSwift.podspec - # - name: Build and test - # run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseSharedSwift.podspec --platforms=${{ matrix.target }} + run: sed -i "" "s/s.swift_version[[:space:]]*=[[:space:]]*'5.9'/s.swift_version = '${{ matrix.build-env.swift_version }}'/" FirebaseSharedSwift.podspec + - name: Build and test + run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseSharedSwift.podspec --platforms=${{ matrix.target }} # spm-package-resolved: # env: From e78c1caa8ec816a2d7c191bef80d8024672fa6bf Mon Sep 17 00:00:00 2001 From: Nick Cooke <36927374+ncooke3@users.noreply.github.com> Date: Tue, 11 Mar 2025 10:48:12 -0400 Subject: [PATCH 6/6] Update shared-swift.yml --- .github/workflows/shared-swift.yml | 102 ++++++++++++++--------------- 1 file changed, 51 insertions(+), 51 deletions(-) diff --git a/.github/workflows/shared-swift.yml b/.github/workflows/shared-swift.yml index 6f756d46f30..18c1671915b 100644 --- a/.github/workflows/shared-swift.yml +++ b/.github/workflows/shared-swift.yml @@ -23,7 +23,7 @@ jobs: strategy: matrix: - target: [ios] #, tvos, macos, watchos] + target: [ios, tvos, macos, watchos] build-env: - os: macos-14 xcode: Xcode_15.2 @@ -31,9 +31,9 @@ jobs: - os: macos-15 xcode: Xcode_16.2 swift_version: 5.9 - - os: macos-15 - xcode: Xcode_16.2 - swift_version: 6.0 + # - os: macos-15 + # xcode: Xcode_16.2 + # swift_version: 6.0 runs-on: ${{ matrix.build-env.os }} steps: - uses: actions/checkout@v4 @@ -47,51 +47,51 @@ jobs: - name: Build and test run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseSharedSwift.podspec --platforms=${{ matrix.target }} - # spm-package-resolved: - # env: - # FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1 - # runs-on: macos-14 - # outputs: - # cache_key: ${{ steps.generate_cache_key.outputs.cache_key }} - # steps: - # - uses: actions/checkout@v4 - # - name: Generate Swift Package.resolved - # id: swift_package_resolve - # run: | - # swift package resolve - # - name: Generate cache key - # id: generate_cache_key - # run: | - # cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}" - # echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT" - # - uses: actions/cache/save@v4 - # id: cache - # with: - # path: .build - # key: ${{ steps.generate_cache_key.outputs.cache_key }} + spm-package-resolved: + env: + FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1 + runs-on: macos-14 + outputs: + cache_key: ${{ steps.generate_cache_key.outputs.cache_key }} + steps: + - uses: actions/checkout@v4 + - name: Generate Swift Package.resolved + id: swift_package_resolve + run: | + swift package resolve + - name: Generate cache key + id: generate_cache_key + run: | + cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}" + echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT" + - uses: actions/cache/save@v4 + id: cache + with: + path: .build + key: ${{ steps.generate_cache_key.outputs.cache_key }} - # 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' - # needs: [spm-package-resolved] - # strategy: - # matrix: - # target: [iOS, tvOS, macOS, catalyst, watchOS] - # build-env: - # - os: macos-14 - # xcode: Xcode_15.2 - # - os: macos-15 - # xcode: Xcode_16.2 - # runs-on: ${{ matrix.build-env.os }} - # steps: - # - uses: actions/checkout@v4 - # - uses: actions/cache/restore@v4 - # with: - # path: .build - # key: ${{needs.spm-package-resolved.outputs.cache_key}} - # - name: Xcode - # run: sudo xcode-select -s /Applications/${{ matrix.build-env.xcode }}.app/Contents/Developer - # - name: Initialize xcodebuild - # run: scripts/setup_spm_tests.sh - # - name: Unit Tests - # run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseSharedSwiftTests ${{ matrix.target }} spm + 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' + needs: [spm-package-resolved] + strategy: + matrix: + target: [iOS, tvOS, macOS, catalyst, watchOS] + build-env: + - os: macos-14 + xcode: Xcode_15.2 + - os: macos-15 + xcode: Xcode_16.2 + runs-on: ${{ matrix.build-env.os }} + steps: + - uses: actions/checkout@v4 + - uses: actions/cache/restore@v4 + with: + path: .build + key: ${{needs.spm-package-resolved.outputs.cache_key}} + - name: Xcode + run: sudo xcode-select -s /Applications/${{ matrix.build-env.xcode }}.app/Contents/Developer + - name: Initialize xcodebuild + run: scripts/setup_spm_tests.sh + - name: Unit Tests + run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseSharedSwiftTests ${{ matrix.target }} spm