|
| 1 | +name: React Native CI |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + branches: main |
| 6 | + push: |
| 7 | + branches: main |
| 8 | + schedule: |
| 9 | + - cron: '0 0 * * *' # Runs at 00:00 UTC every day |
| 10 | + |
| 11 | +jobs: |
| 12 | + ios-build: |
| 13 | + name: iOS Build |
| 14 | + runs-on: macos-latest |
| 15 | + defaults: |
| 16 | + run: |
| 17 | + working-directory: example |
| 18 | + |
| 19 | + steps: |
| 20 | + - name: Checkout repository |
| 21 | + uses: actions/checkout@v3 |
| 22 | + |
| 23 | + - name: Setup Node.js |
| 24 | + uses: actions/setup-node@v3 |
| 25 | + with: |
| 26 | + node-version: '22' |
| 27 | + |
| 28 | + - name: Install dependencies |
| 29 | + run: | |
| 30 | + npm install --frozen-lockfile |
| 31 | + cd ios && pod install |
| 32 | +
|
| 33 | + - name: Bundle iOS |
| 34 | + run: npm run build:ios |
| 35 | + |
| 36 | + - name: Build iOS |
| 37 | + run: | |
| 38 | + npx react-native run-ios --mode Release --no-packager --list-devices |
| 39 | +
|
| 40 | + - name: Run iOS tests |
| 41 | + run: npm run test:e2e:ios |
| 42 | + |
| 43 | + android-build: |
| 44 | + name: Android Build |
| 45 | + runs-on: ubuntu-latest |
| 46 | + defaults: |
| 47 | + run: |
| 48 | + working-directory: example |
| 49 | + |
| 50 | + steps: |
| 51 | + - name: Checkout repository |
| 52 | + uses: actions/checkout@v3 |
| 53 | + |
| 54 | + - name: Setup Node.js |
| 55 | + uses: actions/setup-node@v3 |
| 56 | + with: |
| 57 | + node-version: '18' |
| 58 | + cache: 'npm' |
| 59 | + cache-dependency-path: example/package-lock.json |
| 60 | + |
| 61 | + - name: Setup Java |
| 62 | + uses: actions/setup-java@v3 |
| 63 | + with: |
| 64 | + distribution: 'zulu' |
| 65 | + java-version: '17' |
| 66 | + |
| 67 | + - name: Install dependencies |
| 68 | + run: npm install --frozen-lockfile |
| 69 | + |
| 70 | + - name: Bundle Android |
| 71 | + run: npm run build:android |
| 72 | + |
| 73 | + - name: Create AVD and generate snapshot for caching |
| 74 | + uses: reactivecircus/android-emulator-runner@v2 |
| 75 | + with: |
| 76 | + target: aosp_atd |
| 77 | + api-level: 30 |
| 78 | + arch: x86 |
| 79 | + ram-size: 4096M |
| 80 | + channel: canary |
| 81 | + profile: pixel |
| 82 | + avd-name: Pixel_3a_API_30_AOSP |
| 83 | + force-avd-creation: false |
| 84 | + emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none |
| 85 | + emulator-boot-timeout: 12000 |
| 86 | + disable-animations: false |
| 87 | + script: | |
| 88 | + cd example |
| 89 | + npm run android:release |
| 90 | + npm run test:e2e:android |
0 commit comments