Skip to content

Install test (React Native) #732

Install test (React Native)

Install test (React Native) #732

name: Install test (React Native)
on:
# Every monday at 7:00 CET
schedule:
- cron: "0 6 * * 1"
# You can also activate this workflow manually from the Actions tab
workflow_dispatch:
defaults:
run:
working-directory: install-tests/react-native
jobs:
install:
name: Install Test on React Native ${{ matrix.platform == 'ios' && 'iOS' || 'Android' }} realm@${{ matrix.realm-version }}, react-native@${{ matrix.react-native-version }} new architecture ${{ matrix.new-architecture && 'enabled' || 'disabled' }} running ${{ matrix.engine }}
runs-on: ${{ matrix.platform == 'ios' && 'macos-13-xlarge' || 'macos-13-large' }}
timeout-minutes: 120
strategy:
fail-fast: false
matrix:
platform:
#- ios
- android
realm-version:
#- v11 # Enable if we feel the need
- latest
#- next
react-native-version:
#- latest
- next
# - nightly # Enable if it's not too noizy
new-architecture:
#- true
- false
engine:
#- jsc
- hermes
# See https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md#xcode
xcode:
- 15.0
#- 13.1
node:
# RN bumped minimum Node version: https://github.com/huntie/react-native/blob/6cb6b81dd1c6b74a0f4bac5b06fa5aef93b48fe4/CHANGELOG.md?plain=1#L15
- 18
# env:
# DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: install-test-${{ matrix.platform }}-r@${{ matrix.realm-version }}-rn@${{ matrix.react-native-version }}-${{ matrix.new-architecture && 'new' || 'old' }}-arch
max-size: '2.0G'
- name: Prepend ccache executables to the PATH
run: echo "/usr/local/opt/ccache/libexec" >> $GITHUB_PATH
- name: Configure ccache
run: ccache --set-config="compiler_check=content"
# TODO: Remove if this becomes unneeded in the future
- uses: futureware-tech/simulator-action@v2
if: ${{ matrix.platform == 'ios' }}
with:
model: "iPhone 14"
# - name: Invoke the simulator (making subsequent "open -a Simulator" calls work)
# if: ${{ matrix.platform == 'ios' }}
# run: open -a /Applications/Xcode_${{ matrix.xcode }}/Contents/Developer/Applications/Simulator.app/Contents/MacOS/Simulator
- name: Install dependencies of the CLI
run: npm ci
- name: Initialize app
# Using "--skip-bundle-install" to let the setup-ruby action install the bundle
# Using "--skip-pod-install" to ensure it happens after setup-ruby has executed
run: npm run init -- --skip-bundle-install --skip-pod-install --realm-version ${{ matrix.realm-version }} --react-native-version ${{ matrix.react-native-version }} --engine ${{ matrix.engine }} --new-architecture ${{ matrix.new-architecture }}
# - uses: ruby/setup-ruby@v1
# if: ${{ matrix.platform == 'ios' }}
# with:
# ruby-version: '3.0'
# bundler-cache: true
# working-directory: install-tests/react-native/app
- if: ${{ matrix.platform == 'ios' }}
run: pod install
working-directory: install-tests/react-native/app/ios
- uses: actions/setup-java@v3
if: ${{ matrix.platform == 'android' }}
with:
distribution: 'zulu'
java-version: '17'
- name: Run test (iOS)
if: ${{ matrix.platform == 'ios' }}
run: npm test -- --platform ios
- name: Run test (Android)
if: ${{ matrix.platform == 'android' }}
uses: reactivecircus/android-emulator-runner@v2
timeout-minutes: 30
with:
api-level: 29
target: google_apis
script: npm test -- --platform android
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
working-directory: install-tests/react-native
slack-workflow-status:
if: always()
name: Post Workflow Status To Slack
needs: install
runs-on: ubuntu-latest
permissions:
actions: 'read'
steps:
- name: Slack Workflow Notification
uses: Gamesight/slack-workflow-status@master
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
# Post only to the #realm-js-team Slack channel in case of a scheduled run (realm-js-bot-tests otherwise)
slack_webhook_url: ${{ github.event.schedule && secrets.SLACK_TEAM_WEBHOOK || secrets.SLACK_TEST_WEBHOOK }}
include_jobs: true
include_commit_message: false