test(ios): stop reason-storage tests from reloading the host app (#311) #27
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: CI | |
| on: | |
| push: | |
| branches: [master] | |
| pull_request: | |
| branches: [master] | |
| # Least-privilege token for all jobs (addresses actions/missing-workflow-permissions). | |
| permissions: | |
| contents: read | |
| jobs: | |
| lint: | |
| name: Lint & typecheck | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| - run: npm ci | |
| - run: npm run lint | |
| - run: npm run typescript | |
| test: | |
| name: JS unit tests | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| - run: npm ci | |
| - run: npm test | |
| android: | |
| name: Android (unit tests + build, both architectures) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 40 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| - uses: actions/setup-java@v5 | |
| with: | |
| distribution: temurin | |
| java-version: "17" | |
| - uses: gradle/actions/wrapper-validation@v4 | |
| - name: Install dependencies | |
| run: | | |
| npm ci | |
| cd Example && npm ci | |
| - name: Native unit tests (debug + release) | |
| run: | | |
| cd Example/android | |
| ./gradlew :react-native-restart:testDebugUnitTest :react-native-restart:testReleaseUnitTest | |
| - name: Build example (New Architecture) | |
| run: cd Example/android && ./gradlew assembleDebug | |
| - name: Build example (legacy architecture) | |
| run: cd Example/android && ./gradlew assembleDebug -PnewArchEnabled=false | |
| ios: | |
| name: iOS (unit tests, Release) | |
| runs-on: macos-latest | |
| timeout-minutes: 90 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| - name: Install dependencies | |
| run: | | |
| npm ci | |
| cd Example && npm ci | |
| - name: Install pods | |
| run: cd Example/ios && pod install | |
| - name: Select an available iPhone simulator | |
| id: sim | |
| run: | | |
| NAME=$(xcrun simctl list devices available | grep -oE 'iPhone [0-9]+( Pro)?' | head -1) | |
| echo "Using simulator: $NAME" | |
| echo "name=$NAME" >> "$GITHUB_OUTPUT" | |
| - name: Unit tests (Release — the host app needs the embedded JS bundle) | |
| run: | | |
| cd Example/ios | |
| xcodebuild test \ | |
| -workspace HelloWorld.xcworkspace \ | |
| -scheme HelloWorld \ | |
| -configuration Release \ | |
| -sdk iphonesimulator \ | |
| -destination "platform=iOS Simulator,name=${{ steps.sim.outputs.name }}" \ | |
| CODE_SIGNING_ALLOWED=NO |