Skip to content

Commit

Permalink
add CI/CD setup and jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
zirgulis committed Oct 8, 2024
1 parent 8b7071f commit c75524e
Show file tree
Hide file tree
Showing 14 changed files with 452 additions and 21 deletions.
135 changes: 135 additions & 0 deletions .github/workflows/e2e-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
name: React Native E2E Tests

on:
pull_request:
branches: [ main, develop ]
push:
branches: [ main, develop ]
workflow_dispatch:

jobs:
android-e2e-tests:
name: Android E2E Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'

- 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 android && bundle install
- name: Update Fastlane
run: |
cd android
bundle update fastlane
- name: Verify Fastlane setup
run: |
cd android
bundle exec fastlane --version
bundle exec fastlane lanes
- name: Build and run Android app
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
arch: x86_64
profile: Nexus 6
script: |
cd android
bundle exec fastlane --verbose android build_and_install
cd ..
echo "Installing Maestro..."
curl -Ls "https://get.maestro.mobile.dev" | bash
export PATH="$PATH":"$HOME/.maestro/bin"
echo "Running Maestro tests..."
maestro --verbose test -e APP_ID=com.weatherApp.callstack e2e/main-flow-android.yaml
- name: Upload Maestro logs
if: always()
uses: actions/upload-artifact@v4
with:
name: maestro-android-logs
path: ~/.maestro/logs

ios-e2e-tests:
name: iOS E2E Tests
runs-on: macos-13
env:
DEVELOPER_DIR: /Applications/Xcode_15.0.app/Contents/Developer
steps:
- uses: actions/checkout@v4

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
bundler-cache: false

- 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: Update Fastlane
run: |
cd ios
bundle update fastlane
- name: Verify Fastlane setup
run: |
cd ios
bundle exec fastlane --version
bundle exec fastlane lanes
- name: Install CocoaPods
run: |
cd ios
pod install --repo-update
- name: Build and run iOS app
run: |
cd ios
bundle exec fastlane ios build_and_test --verbose
cd ..
echo "Installing Maestro..."
curl -Ls "https://get.maestro.mobile.dev" | bash
echo "$HOME/.maestro/bin" >> $GITHUB_PATH
- name: Run Maestro tests
run: |
set -x
xcrun simctl list
maestro --verbose test -e APP_ID=com.weatherApp.callstack e2e/main-flow-ios.yaml
- name: Upload Maestro logs
if: always()
uses: actions/upload-artifact@v4
with:
name: maestro-ios-logs
path: ~/.maestro/logs
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ ruby ">= 2.6.10"
# bound in the template on Cocoapods with next React Native release.
gem 'cocoapods', '>= 1.13', '< 1.15'
gem 'activesupport', '>= 6.1.7.5', '< 7.1.0'
gem "fastlane"
Loading

0 comments on commit c75524e

Please sign in to comment.