Harness iOS #1
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: Harness iOS | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: harness-ios-${{ github.ref }} | |
| cancel-in-progress: ${{ github.ref_name != 'main' }} | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| device_model: | |
| description: 'iOS Simulator device model' | |
| required: false | |
| default: 'iPhone 17 Pro' | |
| type: string | |
| ios_version: | |
| description: 'iOS version' | |
| required: false | |
| default: '26.5' | |
| type: string | |
| xcode_version: | |
| description: 'Xcode version' | |
| required: false | |
| default: '26.5' | |
| type: string | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - '.github/workflows/harness-ios.yml' | |
| - 'example/ios/**' | |
| - 'example/__tests__/**' | |
| - 'example/src/**' | |
| - 'example/App.tsx' | |
| - 'example/index.js' | |
| - 'example/index.business-runtime.ts' | |
| - 'example/jest.harness.config.mjs' | |
| - 'example/rn-harness.config.mjs' | |
| - 'example/metro.config.js' | |
| - 'example/babel.config.js' | |
| - 'example/package.json' | |
| - 'packages/*/cpp/**' | |
| - 'packages/*/ios/**' | |
| - 'packages/*/src/**' | |
| - 'packages/*/nitrogen/generated/shared/**' | |
| - 'packages/*/nitrogen/generated/ios/**' | |
| - 'packages/*/package.json' | |
| - 'bun.lock' | |
| - '**/Podfile.lock' | |
| - '**/*.podspec' | |
| - '**/react-native.config.js' | |
| - '**/nitro.json' | |
| pull_request: | |
| paths: | |
| - '.github/workflows/harness-ios.yml' | |
| - 'example/ios/**' | |
| - 'example/__tests__/**' | |
| - 'example/src/**' | |
| - 'example/App.tsx' | |
| - 'example/index.js' | |
| - 'example/index.business-runtime.ts' | |
| - 'example/jest.harness.config.mjs' | |
| - 'example/rn-harness.config.mjs' | |
| - 'example/metro.config.js' | |
| - 'example/babel.config.js' | |
| - 'example/package.json' | |
| - 'packages/*/cpp/**' | |
| - 'packages/*/ios/**' | |
| - 'packages/*/src/**' | |
| - 'packages/*/nitrogen/generated/shared/**' | |
| - 'packages/*/nitrogen/generated/ios/**' | |
| - 'packages/*/package.json' | |
| - 'bun.lock' | |
| - '**/Podfile.lock' | |
| - '**/*.podspec' | |
| - '**/react-native.config.js' | |
| - '**/nitro.json' | |
| env: | |
| # Device configuration - can be overridden by workflow_dispatch inputs. | |
| # These are read by example/rn-harness.config.mjs. | |
| DEVICE_MODEL: ${{ github.event.inputs.device_model || 'iPhone 17 Pro' }} | |
| IOS_VERSION: ${{ github.event.inputs.ios_version || '26.5' }} | |
| XCODE_VERSION: ${{ github.event.inputs.xcode_version || '26.5' }} | |
| USE_CCACHE: 1 | |
| DEVELOPER_DIR: /Applications/Xcode_${{ github.event.inputs.xcode_version || '26.5' }}.app/Contents/Developer | |
| HARNESS_DEBUG: 1 | |
| jobs: | |
| harness_ios: | |
| name: Harness Tests iOS | |
| runs-on: macOS-26 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 1 | |
| - uses: oven-sh/setup-bun@v2 | |
| - name: Install npm dependencies (bun) | |
| run: bun install | |
| - name: Install Ccache | |
| uses: hendrikmuhs/ccache-action@v1.2 | |
| with: | |
| max-size: 1.5G | |
| key: ${{ runner.os }}-${{ runner.arch }}-xcode${{ env.XCODE_VERSION }}-ccache-example-ios | |
| create-symlink: true | |
| - name: Setup ccache behavior | |
| run: | | |
| echo "CCACHE_SLOPPINESS=clang_index_store,file_stat_matches,include_file_ctime,include_file_mtime,ivfsoverlay,pch_defines,modules,system_headers,time_macros" >> $GITHUB_ENV | |
| echo "CCACHE_FILECLONE=true" >> $GITHUB_ENV | |
| echo "CCACHE_DEPEND=true" >> $GITHUB_ENV | |
| echo "CCACHE_INODECACHE=true" >> $GITHUB_ENV | |
| - name: Setup Ruby (bundle) | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: '3.2' | |
| bundler-cache: true | |
| working-directory: example | |
| - name: Select Xcode ${{ env.XCODE_VERSION }} | |
| run: sudo xcode-select -s "/Applications/Xcode_${{ env.XCODE_VERSION }}.app/Contents/Developer" | |
| - name: Restore Pods cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: example/ios/Pods | |
| key: ${{ runner.os }}-${{ runner.arch }}-pods-${{ hashFiles('bun.lock', 'example/Gemfile.lock', 'example/ios/Podfile.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-${{ runner.arch }}-pods- | |
| - name: Install Pods | |
| working-directory: example | |
| run: cd ios && bundle exec pod install | |
| - name: Restore DerivedData cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: example/ios/build | |
| key: ${{ runner.os }}-${{ runner.arch }}-xcode${{ env.XCODE_VERSION }}-dd-${{ hashFiles('bun.lock', 'example/Gemfile.lock', 'example/ios/Podfile.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-${{ runner.arch }}-xcode${{ env.XCODE_VERSION }}-dd- | |
| - name: Build iOS app | |
| working-directory: example/ios | |
| run: | | |
| set -o pipefail | |
| xcodebuild \ | |
| CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ \ | |
| -derivedDataPath build -UseModernBuildSystem=YES \ | |
| -workspace NativeComposeChat.xcworkspace \ | |
| -scheme NativeComposeChat \ | |
| -sdk iphonesimulator \ | |
| -configuration Debug \ | |
| -destination 'platform=iOS Simulator,arch=arm64,name=${{ env.DEVICE_MODEL }}' \ | |
| -showBuildTimingSummary \ | |
| ONLY_ACTIVE_ARCH=YES \ | |
| build \ | |
| CODE_SIGNING_ALLOWED=NO | xcbeautify --renderer github-actions | |
| - name: Install Watchman | |
| run: brew install watchman | |
| - name: Run Harness E2E tests | |
| uses: callstackincubator/react-native-harness@v1.2.0 | |
| with: | |
| runner: ios | |
| projectRoot: example | |
| app: ios/build/Build/Products/Debug-iphonesimulator/NativeComposeChat.app | |
| packageManager: bun |