|
| 1 | +name: React Native — Run iOS Tests |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_call: |
| 5 | + workflow_dispatch: |
| 6 | + |
| 7 | +jobs: |
| 8 | + test-ios: |
| 9 | + name: Run iOS Tests |
| 10 | + runs-on: ${{ vars.MACOS_RUNNER }} |
| 11 | + timeout-minutes: 30 |
| 12 | + defaults: |
| 13 | + run: |
| 14 | + working-directory: platforms/react-native |
| 15 | + steps: |
| 16 | + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 17 | + |
| 18 | + - name: Display Xcode info |
| 19 | + run: | |
| 20 | + echo "Xcode Path: $(xcode-select -p)" |
| 21 | + echo "Xcode Version: $(xcrun xcodebuild -version)" |
| 22 | +
|
| 23 | + - name: Setup iOS Simulator |
| 24 | + run: | |
| 25 | + xcrun simctl list runtimes |
| 26 | + xcrun simctl list devicetypes | grep iPhone |
| 27 | + xcrun simctl delete all |
| 28 | + CURRENT_SIMULATOR_UUID=$(xcrun simctl create TestDevice "iPhone 16 Pro") |
| 29 | + echo "CURRENT_SIMULATOR_UUID=$CURRENT_SIMULATOR_UUID" >> "$GITHUB_ENV" |
| 30 | +
|
| 31 | + - name: Setup Node.js and pnpm |
| 32 | + uses: shop/setup-javascript-action@main |
| 33 | + with: |
| 34 | + node-version-file: platforms/react-native/package.json |
| 35 | + cache-dependency-path: platforms/react-native/pnpm-lock.yaml |
| 36 | + |
| 37 | + - name: Cache turbo build setup |
| 38 | + uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 |
| 39 | + with: |
| 40 | + path: platforms/react-native/.turbo |
| 41 | + key: ${{ runner.os }}-turbo-${{ github.sha }} |
| 42 | + restore-keys: | |
| 43 | + ${{ runner.os }}-turbo- |
| 44 | +
|
| 45 | + - name: Install dependencies |
| 46 | + run: pnpm install --frozen-lockfile |
| 47 | + |
| 48 | + - name: Setup Ruby |
| 49 | + uses: ruby/setup-ruby@c4e5b1316158f92e3d49443a9d58b31d25ac0f8f # v1.306.0 |
| 50 | + with: |
| 51 | + ruby-version: 3.3.6 |
| 52 | + bundler-cache: true |
| 53 | + working-directory: platforms/react-native/sample |
| 54 | + |
| 55 | + - name: Cache cocoapods |
| 56 | + uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 |
| 57 | + with: |
| 58 | + path: platforms/react-native/sample/ios/Pods |
| 59 | + key: ${{ runner.os }}-cocoapods-${{ hashFiles('platforms/react-native/sample/ios/Podfile.lock', 'platforms/react-native/sample/Gemfile.lock', 'platforms/react-native/sample/Gemfile', 'platforms/react-native/package.json', 'platforms/react-native/sample/package.json', 'platforms/react-native/modules/@shopify/checkout-sheet-kit/package.json', 'platforms/react-native/pnpm-lock.yaml') }} |
| 60 | + |
| 61 | + - name: Install cocoapods |
| 62 | + working-directory: platforms/react-native/sample |
| 63 | + run: | |
| 64 | + set -euo pipefail |
| 65 | + bundle install |
| 66 | + cd ios |
| 67 | + bundle exec pod install --deployment --repo-update |
| 68 | +
|
| 69 | + - name: Build module |
| 70 | + run: pnpm module build |
| 71 | + |
| 72 | + - name: Run iOS tests |
| 73 | + run: pnpm sample test:ios |
0 commit comments