add CI/CD setup #1
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: Maestro E2E Tests | |
on: | |
pull_request: | |
branches: [ main, develop ] | |
push: | |
branches: [ main, develop ] | |
workflow_dispatch: | |
jobs: | |
e2e-android: | |
name: E2E Tests (Android) | |
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 | |
- name: Install Fastlane | |
run: | | |
cd android | |
bundle install | |
- 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 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 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 | |
e2e-ios: | |
name: E2E Tests (iOS) | |
runs-on: macos-13 | |
steps: | |
- 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 | |
- name: Install Fastlane | |
run: | | |
cd ios | |
bundle install | |
- name: Build and run iOS app | |
run: | | |
cd ios | |
bundle exec fastlane ios build_and_test | |
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 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 |