Run test app on CI #165
Workflow file for this run
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
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: lts/jod | |
- run: npm ci | |
- run: npm run lint | |
test: | |
strategy: | |
matrix: | |
runner: | |
- ubuntu-latest | |
- windows-latest | |
- macos-latest | |
variant: | |
- unit-tests | |
- android-tests | |
- ios-tests | |
exclude: | |
- runner: ubuntu-latest | |
variant: ios-tests | |
- runner: windows-latest | |
variant: ios-tests | |
name: Test (${{ matrix.variant }} on ${{ matrix.runner }}) | |
runs-on: ${{ matrix.runner }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: lts/jod | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: "17" | |
distribution: "temurin" | |
- name: Setup Android SDK | |
uses: android-actions/setup-android@v3 | |
# Version here should match the one in React Native template and packages/cmake-rn/src/cli.ts | |
- run: sdkmanager --install "ndk;27.1.12297006" | |
- run: npm ci | |
- run: npm run bootstrap | |
# Unit tests | |
- if: matrix.variant == 'unit-tests' | |
run: npm test | |
# Integration tests (iOS) | |
- if: matrix.variant == 'ios-tests' | |
run: npm run pod-install | |
working-directory: apps/test-app | |
- if: matrix.variant == 'ios-tests' | |
run: npm run test:ios | |
working-directory: apps/test-app | |
# Integration tests (Android) | |
- if: matrix.variant == 'android-tests' | |
run: echo "REACT_NATIVE_OVERRIDE_HERMES_DIR=`npx react-native-node-api vendor-hermes --silent`" >> $GITHUB_ENV | |
working-directory: apps/test-app | |
- if: matrix.variant == 'android-tests' | |
run: adb reverse tcp:8090 tcp:8090 | |
- if: matrix.variant == 'android-tests' | |
run: npm run test:android | |
working-directory: apps/test-app |