add CI/CD setup #44
This file contains 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: React Native iOS E2E Tests | |
on: | |
pull_request: | |
branches: [ main, develop ] | |
push: | |
branches: [ main, develop ] | |
workflow_dispatch: | |
jobs: | |
test-ios: | |
name: e2e-ios-test | |
runs-on: macos-13 | |
env: | |
DEVELOPER_DIR: /Applications/Xcode_15.0.app/Contents/Developer | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.0' | |
bundler-cache: true | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18' | |
cache: 'yarn' | |
- name: Install dependencies | |
run: | | |
yarn install --frozen-lockfile | |
cd ios && bundle install | |
- name: Install CocoaPods | |
run: | | |
cd ios | |
pod install | |
cd .. | |
- name: Install Maestro CLI | |
run: | | |
curl -Ls "https://get.maestro.mobile.dev" | bash | |
brew tap facebook/fb | |
brew install facebook/fb/idb-companion | |
- name: Add Maestro to path | |
run: | | |
echo "${HOME}/.maestro/bin" >> $GITHUB_PATH | |
echo "Verifying Maestro installation..." | |
$HOME/.maestro/bin/maestro --version | |
- name: Build and Run iOS App | |
run: | | |
npx react-native run-ios --mode Release --simulator="iPhone 15" --active-arch-only --verbose & | |
echo "Waiting for the app to launch..." | |
sleep 60 # Adjust this value based on your app's launch time | |
- name: Run Maestro tests | |
run: | | |
echo "Running Maestro tests..." | |
$HOME/.maestro/bin/maestro test e2e/main-flow-ios.yaml | |
- name: Upload Maestro logs | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: maestro-ios-logs | |
path: ~/.maestro/logs | |
- name: Upload build logs and app | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ios-build-logs-and-app | |
path: ios/derived_data/Build/Products |