diff --git a/.github/workflows/scripts/compute-xcode-ccache-key.sh b/.github/workflows/scripts/compute-xcode-ccache-key.sh new file mode 100755 index 0000000000..6a9b583092 --- /dev/null +++ b/.github/workflows/scripts/compute-xcode-ccache-key.sh @@ -0,0 +1,80 @@ +#!/usr/bin/env bash +# Content hash for ccache-action keys without actions/hashFiles. +# hashFiles re-runs on Post-cache and can exceed the 120s limit on dirty CI trees +# (DerivedData, SPM checkouts under packages/*/ios). git ls-files only sees tracked +# sources, so Post can reuse the step output with no filesystem walk. +set -euo pipefail + +usage() { + echo "usage: $0 " >&2 + exit 2 +} + +[[ $# -eq 1 ]] || usage + +case "$1" in + rn-bare) + PATHSPECS=( + yarn.lock + ':(glob)test-rn-bare/*' + ':(glob)test-rn-bare/ios/*' + ':(glob)test-rn-bare/ios/testrnbare/**' + ':(glob)test-rn-bare/ios/*.xcodeproj/**' + ':(glob)packages/app/*' + ':(glob)packages/app/ios/RNFB*/**' + ':(glob)packages/app/ios/generated/**' + ':(glob)packages/app/plugin/**' + ':(exclude,glob)packages/app/ios/**/build/**' + ) + ;; + expo) + PATHSPECS=( + yarn.lock + ':(glob)test-expo/*' + ':(glob)test-expo/app/**' + ':(glob)test-expo/src/**' + ':(glob)test-expo/assets/**' + ':(glob)packages/app/*' + ':(glob)packages/app/ios/RNFB*/**' + ':(glob)packages/app/ios/generated/**' + ':(glob)packages/app/plugin/**' + ':(exclude,glob)packages/app/ios/**/build/**' + ) + ;; + e2e-ios) + PATHSPECS=( + yarn.lock + ':(glob)packages/*/*.podspec' + ':(glob)packages/*/package.json' + ':(glob)packages/*/ios/RNFB*/**' + ':(glob)packages/*/ios/generated/**' + ':(glob)packages/app/plugin/**' + tests/ios/Podfile.lock + ':(exclude,glob)packages/*/ios/**/build/**' + ) + ;; + e2e-macos) + PATHSPECS=( + yarn.lock + ':(glob)packages/*/*.podspec' + ':(glob)packages/*/package.json' + ':(glob)packages/*/ios/RNFB*/**' + ':(glob)packages/*/ios/generated/**' + ':(glob)packages/app/plugin/**' + tests-macos/macos/Podfile.lock + ':(exclude,glob)packages/*/ios/**/build/**' + ) + ;; + *) + usage + ;; +esac + +# Stable order; each line is " " so renames invalidate. +{ + git ls-files -z -- "${PATHSPECS[@]}" \ + | sort -z \ + | while IFS= read -r -d '' f; do + shasum -a 256 -- "$f" + done +} | shasum -a 256 | awk '{print $1}' diff --git a/.github/workflows/test_expo_ios_link.yml b/.github/workflows/test_expo_ios_link.yml index a069823deb..c64cb62d13 100644 --- a/.github/workflows/test_expo_ios_link.yml +++ b/.github/workflows/test_expo_ios_link.yml @@ -9,6 +9,7 @@ on: - '**' paths: - 'test-expo/**' + - 'packages/app/package.json' - 'packages/app/firebase_spm.rb' - 'packages/app/firebase_json.rb' - 'packages/app/RNFBApp.podspec' @@ -27,6 +28,7 @@ on: - release-v* paths: - 'test-expo/**' + - 'packages/app/package.json' - 'packages/app/firebase_spm.rb' - 'packages/app/firebase_json.rb' - 'packages/app/RNFBApp.podspec' @@ -52,7 +54,7 @@ jobs: test-expo-ios-link: name: test-expo iOS link + launch smoke runs-on: xcode-27 - timeout-minutes: 60 + timeout-minutes: 90 env: XCODE_VERSION: '27.0' RNFB_IOS_SIM_RUNTIME: iOS 27.0 @@ -81,12 +83,17 @@ jobs: - name: Configure Apple CI (Xcode 27 + iOS 27 runtime) run: bash .github/workflows/scripts/configure-apple-ci.sh + # Precompute key: hashFiles re-runs on Post-cache and can exceed 120s on dirty trees. + - name: Compute Xcode compile cache key + id: xcode_cache_key + run: echo "key=$(bash .github/workflows/scripts/compute-xcode-ccache-key.sh expo)" >> "$GITHUB_OUTPUT" + # Sticky content-hash key (append-timestamp: false). Distinct from e2e (`expo-link` app id). # https://github.com/hendrikmuhs/ccache-action/releases - uses: hendrikmuhs/ccache-action@f09c25b45002a07be2955cbe52e8cee55643f89d # v1.2.24 name: Xcode Compile Cache with: - key: ${{ runner.os }}-expo-link-ios-v1-xcode27-${{ hashFiles('yarn.lock', 'test-expo/**', 'packages/app/ios/**', 'packages/app/*.podspec', 'packages/app/firebase_spm.rb', 'packages/app/firebase_json.rb', 'packages/app/plugin/**', 'packages/app/app.plugin.js') }} + key: ${{ runner.os }}-expo-link-ios-v4-xcode27-${{ steps.xcode_cache_key.outputs.key }} append-timestamp: false save: ${{ github.ref == 'refs/heads/main' }} create-symlink: true diff --git a/.github/workflows/test_rn_bare_ios_build.yml b/.github/workflows/test_rn_bare_ios_build.yml index 033f427251..b97fe45ed9 100644 --- a/.github/workflows/test_rn_bare_ios_build.yml +++ b/.github/workflows/test_rn_bare_ios_build.yml @@ -26,6 +26,7 @@ on: - '.github/workflows/scripts/lib/rn-bare-probe-launch-assertions.sh' - '.github/workflows/scripts/test-rn-bare-ios-launch-smoke.sh' - '.github/workflows/scripts/configure-apple-ci.sh' + - '.github/workflows/scripts/compute-xcode-ccache-key.sh' - 'packages/app/__tests__/rnfb_app_ios_objc_import_guard_test.rb' - 'packages/app/__tests__/iosProbeSdkPin.test.js' - 'packages/app/__tests__/iosProbeSingleCopyAssertions.test.js' @@ -52,6 +53,7 @@ on: - '.github/workflows/scripts/lib/rn-bare-probe-launch-assertions.sh' - '.github/workflows/scripts/test-rn-bare-ios-launch-smoke.sh' - '.github/workflows/scripts/configure-apple-ci.sh' + - '.github/workflows/scripts/compute-xcode-ccache-key.sh' - 'packages/app/__tests__/rnfb_app_ios_objc_import_guard_test.rb' - 'packages/app/__tests__/iosProbeSdkPin.test.js' - 'packages/app/__tests__/iosProbeSingleCopyAssertions.test.js' @@ -99,12 +101,17 @@ jobs: - name: Configure Apple CI (Xcode 27 + iOS 27 runtime) run: bash .github/workflows/scripts/configure-apple-ci.sh + # Precompute key: hashFiles re-runs on Post-cache and can exceed 120s on dirty trees. + - name: Compute Xcode compile cache key + id: xcode_cache_key + run: echo "key=$(bash .github/workflows/scripts/compute-xcode-ccache-key.sh rn-bare)" >> "$GITHUB_OUTPUT" + # Sticky content-hash key (append-timestamp: false). Distinct from e2e/expo (`rn-bare` app id). # https://github.com/hendrikmuhs/ccache-action/releases - uses: hendrikmuhs/ccache-action@f09c25b45002a07be2955cbe52e8cee55643f89d # v1.2.24 name: Xcode Compile Cache with: - key: ${{ runner.os }}-rn-bare-ios-v1-xcode27-${{ hashFiles('yarn.lock', 'test-rn-bare/**', 'packages/app/ios/**', 'packages/app/*.podspec', 'packages/app/firebase_spm.rb', 'packages/app/firebase_json.rb', 'packages/app/plugin/**', 'packages/app/app.plugin.js') }} + key: ${{ runner.os }}-rn-bare-ios-v3-xcode27-${{ steps.xcode_cache_key.outputs.key }} append-timestamp: false save: ${{ github.ref == 'refs/heads/main' }} create-symlink: true @@ -173,12 +180,17 @@ jobs: - name: Configure Apple CI (Xcode 27 + iOS 27 runtime) run: bash .github/workflows/scripts/configure-apple-ci.sh + # Precompute key: hashFiles re-runs on Post-cache and can exceed 120s on dirty trees. + - name: Compute Xcode compile cache key + id: xcode_cache_key + run: echo "key=$(bash .github/workflows/scripts/compute-xcode-ccache-key.sh rn-bare)" >> "$GITHUB_OUTPUT" + # Sticky content-hash key (append-timestamp: false). Distinct from shipped-path job (`rn-bare-dynfb`). # https://github.com/hendrikmuhs/ccache-action/releases - uses: hendrikmuhs/ccache-action@f09c25b45002a07be2955cbe52e8cee55643f89d # v1.2.24 name: Xcode Compile Cache with: - key: ${{ runner.os }}-rn-bare-dynfb-ios-v1-xcode27-${{ hashFiles('yarn.lock', 'test-rn-bare/**', 'packages/app/ios/**', 'packages/app/*.podspec', 'packages/app/firebase_spm.rb', 'packages/app/firebase_json.rb', 'packages/app/plugin/**', 'packages/app/app.plugin.js', 'packages/app/package.json') }} + key: ${{ runner.os }}-rn-bare-dynfb-ios-v3-xcode27-${{ steps.xcode_cache_key.outputs.key }} append-timestamp: false save: ${{ github.ref == 'refs/heads/main' }} create-symlink: true diff --git a/.github/workflows/tests_e2e_ios.yml b/.github/workflows/tests_e2e_ios.yml index 4506f71321..f2a5b8ff3c 100644 --- a/.github/workflows/tests_e2e_ios.yml +++ b/.github/workflows/tests_e2e_ios.yml @@ -193,13 +193,18 @@ jobs: path: ~/Library/Detox/ios key: ${{ runner.os }}-detox-framework-cache-${{ steps.workflow-variables.outputs.xcode-version }} + # Precompute key: hashFiles re-runs on Post-cache and can exceed 120s on dirty trees. + - name: Compute Xcode compile cache key + id: xcode_cache_key + run: echo "key=$(bash .github/workflows/scripts/compute-xcode-ccache-key.sh e2e-ios)" >> "$GITHUB_OUTPUT" + # Detox is compiled during yarn install, using Xcode, set up cache first # https://github.com/hendrikmuhs/ccache-action/releases - uses: hendrikmuhs/ccache-action@f09c25b45002a07be2955cbe52e8cee55643f89d # v1.2.24 name: Xcode Compile Cache with: # Sticky content-hash key (append-timestamp: false). SPM-only matrix (no cocoapods leg); debug/release stay distinct. - key: ${{ runner.os }}-e2e-${{ matrix.buildmode }}-ios-v5-xcode27-${{ hashFiles('yarn.lock', 'packages/*/*.podspec', 'packages/*/ios/**', 'tests/ios/Podfile.lock') }} + key: ${{ runner.os }}-e2e-${{ matrix.buildmode }}-ios-v7-xcode27-${{ steps.xcode_cache_key.outputs.key }} save: "${{ github.ref == 'refs/heads/main' && matrix.iteration == 0 }}" append-timestamp: false create-symlink: true @@ -642,11 +647,15 @@ jobs: key: ${{ runner.os }}-ios-yarn-v1-${{ hashFiles('yarn.lock') }} restore-keys: ${{ runner.os }}-ios-yarn-v1 + - name: Compute Xcode compile cache key + id: xcode_cache_key + run: echo "key=$(bash .github/workflows/scripts/compute-xcode-ccache-key.sh e2e-ios)" >> "$GITHUB_OUTPUT" + - uses: hendrikmuhs/ccache-action@f09c25b45002a07be2955cbe52e8cee55643f89d # v1.2.24 name: Xcode Compile Cache with: # Sticky content-hash key (append-timestamp: false). SPM-only archive job. - key: ${{ runner.os }}-e2e-archive-ios-v3-xcode27-${{ hashFiles('yarn.lock', 'packages/*/*.podspec', 'packages/*/ios/**', 'tests/ios/Podfile.lock') }} + key: ${{ runner.os }}-e2e-archive-ios-v5-xcode27-${{ steps.xcode_cache_key.outputs.key }} save: "${{ github.ref == 'refs/heads/main' }}" append-timestamp: false create-symlink: true diff --git a/.github/workflows/tests_e2e_other.yml b/.github/workflows/tests_e2e_other.yml index 2a03f955b4..e6dfa59bdb 100644 --- a/.github/workflows/tests_e2e_other.yml +++ b/.github/workflows/tests_e2e_other.yml @@ -167,12 +167,17 @@ jobs: key: ${{ runner.os }}-macos-yarn-v1-${{ hashFiles('yarn.lock') }} restore-keys: ${{ runner.os }}-macos-yarn-v1 + # Precompute key: hashFiles re-runs on Post-cache and can exceed 120s on dirty trees. + - name: Compute Xcode compile cache key + id: xcode_cache_key + run: echo "key=$(bash .github/workflows/scripts/compute-xcode-ccache-key.sh e2e-macos)" >> "$GITHUB_OUTPUT" + # https://github.com/hendrikmuhs/ccache-action/releases - uses: hendrikmuhs/ccache-action@f09c25b45002a07be2955cbe52e8cee55643f89d # v1.2.24 name: Xcode Compile Cache with: # Sticky content-hash key (append-timestamp: false). Native sources live under packages/*/ios (no packages/*/macos tree). - key: ${{ runner.os }}-e2e-macos-v3-xcode27-${{ hashFiles('yarn.lock', 'packages/*/*.podspec', 'packages/*/ios/**', 'tests-macos/macos/Podfile.lock') }} + key: ${{ runner.os }}-e2e-macos-v5-xcode27-${{ steps.xcode_cache_key.outputs.key }} save: "${{ github.ref == 'refs/heads/main' && matrix.iteration == 0 }}" append-timestamp: false create-symlink: true diff --git a/docs/index.mdx b/docs/index.mdx index f084700667..ed73247bd6 100644 --- a/docs/index.mdx +++ b/docs/index.mdx @@ -360,12 +360,12 @@ Open your projects `/ios/Podfile` and add any of the globals shown below to the ```ruby # Override Firebase Apple SDK SPM exact pin if desired (see /ios-spm) -$FirebaseSDKVersion = '13.0.0' +$FirebaseSDKVersion = '13.1.0' ``` Once changed, reinstall your projects pods via pod install and rebuild your project with `npx react-native run-ios`. -Alternatively, if you cannot edit the Podfile easily (as when using Expo), you may add the environment variable `FIREBASE_SDK_VERSION=13.0.0` (or whatever SPM exact pin you need) to the command line that installs pods. For example `FIREBASE_SDK_VERSION=13.0.0 yarn expo prebuild --clean` +Alternatively, if you cannot edit the Podfile easily (as when using Expo), you may add the environment variable `FIREBASE_SDK_VERSION=13.1.0` (or whatever SPM exact pin you need) to the command line that installs pods. For example `FIREBASE_SDK_VERSION=13.1.0 yarn expo prebuild --clean` ### Android Performance diff --git a/docs/ios-spm.mdx b/docs/ios-spm.mdx index aa708621be..45ec74f7fa 100644 --- a/docs/ios-spm.mdx +++ b/docs/ios-spm.mdx @@ -25,7 +25,7 @@ CocoaPods**. The last CocoaPods release is **12.19.0**. See Google's - SPM requires CocoaPods 1.10 or newer for the React Native pod integration. React Native 0.75+ templates already satisfy this requirement. - SPM pins the Firebase iOS SDK to the exact version in - `sdkVersions.ios.firebase` in `@react-native-firebase/app` (currently **13.0.0**). + `sdkVersions.ios.firebase` in `@react-native-firebase/app` (currently **13.1.0**). SPM requires dynamic framework linkage: diff --git a/packages/app/ios/RNFBFirebase/Package.swift b/packages/app/ios/RNFBFirebase/Package.swift index 784840c267..275445288d 100644 --- a/packages/app/ios/RNFBFirebase/Package.swift +++ b/packages/app/ios/RNFBFirebase/Package.swift @@ -28,7 +28,7 @@ let package = Package( dependencies: [ .package( url: "https://github.com/firebase/firebase-ios-sdk.git", - exact: "13.0.0" + exact: "13.1.0" ), ], targets: [ diff --git a/packages/app/package.json b/packages/app/package.json index 54e0cf4c59..e353782e60 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -131,7 +131,7 @@ }, "sdkVersions": { "ios": { - "firebase": "13.0.0", + "firebase": "13.1.0", "firebaseSpmUrl": "https://github.com/firebase/firebase-ios-sdk.git", "iosTarget": "15.0", "macosTarget": "11.0", diff --git a/test-rn-bare/ios/testrnbare.xcodeproj/project.pbxproj b/test-rn-bare/ios/testrnbare.xcodeproj/project.pbxproj index a82b33a83e..0377728a0e 100644 --- a/test-rn-bare/ios/testrnbare.xcodeproj/project.pbxproj +++ b/test-rn-bare/ios/testrnbare.xcodeproj/project.pbxproj @@ -622,7 +622,7 @@ repositoryURL = "https://github.com/firebase/firebase-ios-sdk.git"; requirement = { kind = exactVersion; - version = 13.0.0; + version = 13.1.0; }; }; /* End XCRemoteSwiftPackageReference section */ diff --git a/tests/ios/testing.xcodeproj/project.pbxproj b/tests/ios/testing.xcodeproj/project.pbxproj index b9781bc1e9..4577254d6b 100644 --- a/tests/ios/testing.xcodeproj/project.pbxproj +++ b/tests/ios/testing.xcodeproj/project.pbxproj @@ -832,7 +832,7 @@ repositoryURL = "https://github.com/firebase/firebase-ios-sdk.git"; requirement = { kind = exactVersion; - version = 13.0.0; + version = 13.1.0; }; }; /* End XCRemoteSwiftPackageReference section */