WIP fix: only ship one transpile of typescript packages, and do not use package.json:exports #1728
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Testing E2E Other | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| iterations: | |
| description: "Number of iterations to run. Default 1. Max 256." | |
| required: true | |
| default: 1 | |
| type: number | |
| pull_request: | |
| branches: | |
| - '**' | |
| paths-ignore: | |
| - 'docs/**' | |
| - 'website/**' | |
| - '.spellcheck.dict.txt' | |
| - '**/*.md' | |
| push: | |
| branches: | |
| - main | |
| - v14-release | |
| paths-ignore: | |
| - 'docs/**' | |
| - 'website/**' | |
| - '.spellcheck.dict.txt' | |
| - '**/*.md' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| # We want to generate our matrix dynamically | |
| # Initial job generates the matrix as a JSON, and following job will use deserialize and use the result | |
| matrix_prep: | |
| # Do not run the scheduled jobs on forks | |
| if: (github.event_name == 'schedule' && github.repository == 'invertase/react-native-firebase') || (github.event_name != 'schedule') | |
| runs-on: ubuntu-latest | |
| outputs: | |
| matrix: ${{ steps.build-matrix.outputs.result }} | |
| steps: | |
| - id: build-matrix | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| // by default, we will run one iteration | |
| let iterationArray = [0] | |
| // workflow dispatch will be a drop-down of different options | |
| if (context.eventName === "workflow_dispatch") { | |
| const inputs = ${{ toJSON(inputs) }} | |
| console.log('inputs is: ' + JSON.stringify(inputs)) | |
| const iterationInput = inputs.iterations | |
| console.log('iterations input is: ' + iterationInput) | |
| // this will expand for example with input 5 => [0, 1, 2, 3, 4] | |
| iterationArray = [] | |
| for (let i = 0; i < iterationInput; i++) { | |
| iterationArray.push(i); | |
| } | |
| console.log('iterationArray is: ' + iterationArray) | |
| } | |
| // If we are running on a schedule it's our periodic passive scan for flakes | |
| // Goal is to run enough iterations on all systems that we have confidence there are no flakes | |
| if (context.eventName === "schedule") { | |
| const iterationCount = 15 | |
| for (let i = 0; i < iterationCount; i++) { | |
| iterationArray.push(i); | |
| } | |
| } | |
| return { | |
| "iteration": iterationArray | |
| } | |
| - name: Debug Output | |
| run: echo "${{ steps.build-matrix.outputs.result }}" | |
| # This uses the matrix generated from the matrix-prep stage | |
| # it will run unit tests on whatever OS combinations are desired | |
| other: | |
| name: Other (${{ matrix.iteration }}) | |
| runs-on: macos-26 | |
| needs: matrix_prep | |
| timeout-minutes: 100 | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| CCACHE_SLOPPINESS: clang_index_store,file_stat_matches,include_file_ctime,include_file_mtime,ivfsoverlay,pch_defines,modules,system_headers,time_macros | |
| CCACHE_FILECLONE: true | |
| CCACHE_DEPEND: true | |
| CCACHE_INODECACHE: true | |
| CCACHE_LIMIT_MULTIPLE: 0.95 | |
| strategy: | |
| fail-fast: false | |
| matrix: ${{fromJson(needs.matrix_prep.outputs.matrix)}} | |
| steps: | |
| - name: Setup Environment for Screen Recording | |
| uses: guidepup/setup-action@0.17.3 | |
| continue-on-error: true | |
| with: | |
| record: true | |
| - name: Upload Screen Recording Environment Setup | |
| uses: actions/upload-artifact@v4 | |
| continue-on-error: true | |
| if: always() | |
| with: | |
| name: screenrecording-setup-${{ matrix.iteration }}.mov | |
| path: ./recordings/ | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| - name: Configure JDK | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '21' | |
| - uses: maxim-lobanov/setup-xcode@v1 | |
| with: | |
| xcode-version: 'latest-stable' | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 50 | |
| # Set path variables needed for caches | |
| - name: Set workflow variables | |
| id: workflow-variables | |
| run: | | |
| echo "metro-cache=$HOME/.metro" >> $GITHUB_OUTPUT | |
| echo "xcode-version=$(xcodebuild -version|tail -1|cut -f3 -d' ')" >> $GITHUB_OUTPUT | |
| - name: Yarn Cache Restore | |
| uses: actions/cache/restore@v4 | |
| id: yarn-cache | |
| continue-on-error: true | |
| with: | |
| path: .yarn/cache | |
| key: ${{ runner.os }}-macos-yarn-v1-${{ hashFiles('yarn.lock') }} | |
| restore-keys: ${{ runner.os }}-macos-yarn-v1 | |
| - uses: hendrikmuhs/ccache-action@v1 | |
| name: Xcode Compile Cache | |
| with: | |
| key: ${{ runner.os }}-macos-v2 | |
| save: "${{ github.ref == 'refs/heads/main' }}" | |
| create-symlink: true | |
| max-size: 1500M | |
| - name: Yarn Install | |
| uses: nick-fields/retry@v3 | |
| with: | |
| timeout_minutes: 15 | |
| retry_wait_seconds: 60 | |
| max_attempts: 3 | |
| command: DETOX_DISABLE_POSTINSTALL=1 yarn | |
| - name: Setup Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: 3 | |
| - name: Update Ruby build tools | |
| uses: nick-fields/retry@v3 | |
| with: | |
| timeout_minutes: 2 | |
| retry_wait_seconds: 60 | |
| max_attempts: 3 | |
| command: gem update cocoapods xcodeproj | |
| - name: Pods Cache Restore | |
| uses: actions/cache/restore@v4 | |
| id: pods-cache | |
| continue-on-error: true | |
| with: | |
| path: tests/ios/Pods | |
| key: ${{ runner.os }}-macos-pods-v3-${{ hashFiles('tests/ios/Podfile.lock') }} | |
| restore-keys: ${{ runner.os }}-macos-pods-v3 | |
| - name: Pod Install | |
| uses: nick-fields/retry@v3 | |
| with: | |
| timeout_minutes: 20 | |
| retry_wait_seconds: 30 | |
| max_attempts: 3 | |
| command: yarn tests:macos:pod:install | |
| - name: Firestore Emulator Cache Restore | |
| uses: actions/cache/restore@v4 | |
| id: firestore-emulator-cache | |
| continue-on-error: true | |
| with: | |
| # The firebase emulators are pure javascript and java, OS-independent | |
| enableCrossOsArchive: true | |
| path: ~/.cache/firebase/emulators | |
| key: firebase-emulators-v1-${{ github.run_id }} | |
| restore-keys: firebase-emulators-v1 | |
| - name: Start Firestore Emulator | |
| run: yarn tests:emulator:start-ci | |
| - name: Install brew utilities | |
| uses: nick-fields/retry@v3 | |
| with: | |
| timeout_minutes: 5 | |
| retry_wait_seconds: 60 | |
| max_attempts: 3 | |
| command: HOMEBREW_NO_AUTO_UPDATE=1 brew tap wix/brew && HOMEBREW_NO_AUTO_UPDATE=1 brew install xcbeautify | |
| - name: Build macos App | |
| run: | | |
| ccache -s | |
| export SKIP_BUNDLING=1 | |
| export RCT_NO_LAUNCH_PACKAGER=1 | |
| set -o pipefail | |
| echo $PATH | |
| which clang | |
| yarn tests:macos:build | |
| ccache -s | |
| shell: bash | |
| - name: Metro Bundler Cache Restore | |
| uses: actions/cache/restore@v4 | |
| id: metro-bundler-cache | |
| continue-on-error: true | |
| with: | |
| path: ${{ steps.workflow-variables.outputs.metro-cache }} | |
| key: ${{ runner.os }}-macos-metro-v1-${{ github.run_id }} | |
| restore-keys: ${{ runner.os }}-macos-metro-v1 | |
| - name: Pre-fetch Javascript bundle | |
| run: | | |
| nohup sh -c "yarn tests:packager:jet-ci > metro.log 2>&1 &" | |
| printf 'Waiting for packager to come online' | |
| until curl --output /dev/null --silent --head --fail http://localhost:8081/status; do | |
| printf '.' | |
| sleep 2 | |
| done | |
| echo "Packager is online! Preparing bundle..." | |
| curl --output /dev/null --silent --head --fail "http://localhost:8081/index.bundle?platform=macos&dev=true&minify=false&inlineSourceMap=true" | |
| echo "...javascript bundle ready" | |
| - name: Start Screen Recording and System Logging | |
| continue-on-error: true | |
| run: | | |
| nohup sh -c "sleep 314159265 | screencapture -v -C -k -T0 -g screenrecording.mov > screenrecording.log 2>&1 &" | |
| nohup sh -c "log stream --backtrace --color none --style syslog > syslog.log 2>&1 &" | |
| - name: Jet Test | |
| timeout-minutes: 20 | |
| run: yarn tests:macos:test-cover | |
| - uses: codecov/codecov-action@v5 | |
| continue-on-error: true | |
| with: | |
| verbose: true | |
| - name: Stop Screen Recording and System Logging | |
| continue-on-error: true | |
| if: always() | |
| run: | | |
| killall -int screencapture | |
| killall -int log | |
| - name: Upload Metro Log | |
| uses: actions/upload-artifact@v4 | |
| continue-on-error: true | |
| if: always() | |
| with: | |
| name: metro-${{ matrix.iteration }}_log | |
| path: metro.log | |
| - name: Upload Screen Recording | |
| uses: actions/upload-artifact@v4 | |
| continue-on-error: true | |
| if: always() | |
| with: | |
| name: screenrecording-${{ matrix.iteration }} | |
| path: screenrecording.* | |
| - name: Upload System Log | |
| uses: actions/upload-artifact@v4 | |
| continue-on-error: true | |
| if: always() | |
| with: | |
| name: syslog-${{ matrix.iteration }} | |
| path: syslog.log | |
| - name: Yarn Cache Save | |
| uses: actions/cache/save@v4 | |
| if: "${{ github.ref == 'refs/heads/main' }}" | |
| continue-on-error: true | |
| with: | |
| path: .yarn/cache | |
| key: ${{ steps.yarn-cache.outputs.cache-primary-key }} | |
| - name: Pods Cache Save | |
| uses: actions/cache/save@v4 | |
| if: "${{ github.ref == 'refs/heads/main' }}" | |
| continue-on-error: true | |
| with: | |
| path: tests/ios/Pods | |
| key: ${{ steps.pods-cache.outputs.cache-primary-key }} | |
| - name: Firestore Emulator Cache Save | |
| uses: actions/cache/save@v4 | |
| if: "${{ github.ref == 'refs/heads/main' }}" | |
| continue-on-error: true | |
| with: | |
| # The firebase emulators are pure javascript and java, OS-independent | |
| enableCrossOsArchive: true | |
| path: ~/.cache/firebase/emulators | |
| key: ${{ steps.firestore-emulator-cache.outputs.cache-primary-key }} | |
| - name: Metro Bundler Cache Save | |
| uses: actions/cache/save@v4 | |
| if: "${{ github.ref == 'refs/heads/main' }}" | |
| continue-on-error: true | |
| with: | |
| path: ${{ steps.workflow-variables.outputs.metro-cache }} | |
| key: ${{ steps.metro-bundler-cache.outputs.cache-primary-key }} |