|
| 1 | +name: Test iOS build |
| 2 | +on: |
| 3 | + pull_request: |
| 4 | + branches: |
| 5 | + - main |
| 6 | + - main-labs |
| 7 | + paths: |
| 8 | + - '.github/workflows/ios-build-test.yml' |
| 9 | + - 'RNScreens.podspec' |
| 10 | + - 'package.json' |
| 11 | + - 'ios/**' |
| 12 | + - 'common/**' |
| 13 | + - 'Example/**' |
| 14 | + push: |
| 15 | + branches: |
| 16 | + - main |
| 17 | + - main-labs |
| 18 | + workflow_dispatch: |
| 19 | +jobs: |
| 20 | + build: |
| 21 | + runs-on: macos-14 |
| 22 | + timeout-minutes: 60 |
| 23 | + env: |
| 24 | + WORKING_DIRECTORY: Example |
| 25 | + RNS_GAMMA_ENABLED: 0 |
| 26 | + concurrency: |
| 27 | + group: ios-${{ github.ref }} |
| 28 | + cancel-in-progress: true |
| 29 | + steps: |
| 30 | + - name: checkout |
| 31 | + uses: actions/checkout@v4 |
| 32 | + - name: Setup Node.js (version from .nvmrc) |
| 33 | + uses: actions/setup-node@v4 |
| 34 | + with: |
| 35 | + node-version-file: '.nvmrc' |
| 36 | + cache: 'yarn' |
| 37 | + cache-dependency-path: ${{ env.WORKING_DIRECTORY }}/yarn.lock |
| 38 | + - name: Use latest stable Xcode |
| 39 | + uses: maxim-lobanov/setup-xcode@v1 |
| 40 | + with: |
| 41 | + xcode-version: '16.1' |
| 42 | + - name: Install node dependencies |
| 43 | + working-directory: ${{ env.WORKING_DIRECTORY }} |
| 44 | + run: yarn |
| 45 | + # This step is required due to the bug introduced in 1.15.0 version of cocoapods |
| 46 | + # that breaks the pod installation for cached packages. |
| 47 | + # see https://github.com/facebook/react-native/issues/42698 |
| 48 | + # This step should be removed once this issue will be resolved: |
| 49 | + # https://github.com/actions/runner-images/issues/9308 |
| 50 | + - name: Install Ruby gems |
| 51 | + run: gem install cocoapods -v 1.15.2 |
| 52 | + - name: Install pods |
| 53 | + id: install_pods |
| 54 | + continue-on-error: true |
| 55 | + working-directory: ${{ env.WORKING_DIRECTORY }}/ios |
| 56 | + run: pod install |
| 57 | + - if: steps.install_pods.outcome == 'failure' |
| 58 | + id: remove_pods |
| 59 | + name: Remove pods |
| 60 | + working-directory: ${{ env.WORKING_DIRECTORY }}/ios |
| 61 | + run: rm -fr build Pods Podfile.lock |
| 62 | + - if: steps.remove_pods.outcome == 'success' |
| 63 | + id: reinstall_pods |
| 64 | + name: Reinstall pods |
| 65 | + working-directory: ${{ env.WORKING_DIRECTORY }}/ios |
| 66 | + run: pod install |
| 67 | + - name: Build app |
| 68 | + working-directory: ${{ env.WORKING_DIRECTORY }} |
| 69 | + run: npx react-native run-ios --no-packager --simulator="iPhone 15" |
0 commit comments