I'm working on a React Native app and I want to have a GitHub Action that starts the app on CI.
If the app runs without crash, it will call an API endpoint to say that the app is healthy. The purpose of this is to ensure that my app won't crash when users open it.
The GitHub Action looks like this
jobs:
run-real-app:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16'
cache: yarn
- run: yarn
- run: pod install
working-directory: ./ios
- name: use pm2 to run Node in background
run: npm install pm2 -g
- name: start Metro bundler
run: pm2 start "react-native start" --name start-metro
- name: build iOS
run: |
npx react-native run-ios
I've tested the app on my local and everything is fine, which means the API will be called.
In contrast, although this workflow runs successfully, the API is not called.
Commands that I use to run the app are the same:
react-native start
react-native run-ios
My question is: How to start and run a React Native app on GH Action?
Notes: I've searched many sites and their answers are all about build and deploy app, not run the app on CI.