Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ on:
pull_request:
branches: ['**']

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

Expand All @@ -20,7 +24,7 @@ jobs:
- name: 'Checkout Repository'
uses: actions/checkout@v3
- name: 'Dependency Review'
uses: actions/dependency-review-action@v3
uses: actions/dependency-review-action@v4
with:
# Possible values: "critical", "high", "moderate", "low"
fail-on-severity: moderate
192 changes: 126 additions & 66 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,132 +8,192 @@ on:
pull_request:
branches: ['**']

jobs:
android-e2e:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
android-e2e:
runs-on: ubuntu-latest
timeout-minutes: 120 # <-- was unbounded (default 360 = your "hours")
strategy:
matrix:
api-level: [33]

steps:
# checkout FIRST so setup-node can use `cache: npm`
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js env
uses: actions/setup-node@v2.1.5
uses: actions/setup-node@v4
with:
node-version: 18.0.0

- name: Checkout code
uses: actions/checkout@v3

- name: Install React Native CLI
run: npm install react-native-cli
node-version: 24
cache: npm # <-- Android had no npm cache at all

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

- name: Install Maestro CLI
run: curl -Ls "https://get.maestro.mobile.dev" | bash
- name: Gradle cache
uses: gradle/actions/setup-gradle@v4

- name: Add Maestro to path
run: echo "${HOME}/.maestro/bin" >> $GITHUB_PATH
- name: Install Maestro CLI
run: |
curl -Ls "https://get.maestro.mobile.dev" | bash
echo "${HOME}/.maestro/bin" >> $GITHUB_PATH

- name: Install Dependencies and build android
- name: Install dependencies
run: |
npm run prepack
npm run install:no-pods
npm run prepack

- name: Build release APK
working-directory: example/android
run: |
chmod +x ./gradlew
./gradlew assembleRelease --no-daemon
env:
GITHUB_PACKAGES_USER: ${{ github.actor }}
GITHUB_PACKAGES_TOKEN: ${{ secrets.PACKAGE_READ_PAT }}

- name: Enable KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm

- name: Gradle cache
uses: gradle/actions/setup-gradle@v3

- name: Run Android Emulator and app
- name: AVD cache
uses: actions/cache@v4
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{ matrix.api-level }}-atd-v1

- name: Create AVD and generate snapshot
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
arch: x86_64
target: google_apis
target: google_atd # stripped-down test image, boots faster than google_apis
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
disk-size: 4096M
script: echo "AVD snapshot generated"

- name: Run Android E2E tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
arch: x86_64
target: google_atd
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -dns-server 8.8.8.8
disable-animations: true
disk-size: 4096M
script: |
npm run android:release
npm run test:e2e:android
mkdir -p "$GITHUB_WORKSPACE/maestro-debug"
# VERIFY THIS PATH - adjust if your APK lands elsewhere
adb install -r example/android/app/build/outputs/apk/release/app-release.apk || { echo "Install failed"; exit 1; }
adb shell settings put global window_animation_scale 0
adb shell settings put global transition_animation_scale 0
adb shell settings put global animator_duration_scale 0
npm run test:e2e:android || TEST_EXIT=$?
adb logcat -d > "$GITHUB_WORKSPACE/maestro-debug/logcat.txt" || true
exit ${TEST_EXIT:-0}
env:
GITHUB_PACKAGES_USER: ${{ github.actor }}
GITHUB_PACKAGES_TOKEN: ${{ secrets.PACKAGE_READ_PAT }}
MAESTRO_DRIVER_STARTUP_TIMEOUT: 30000

ios-e2e:
runs-on: macos-latest

steps:

- name: Setup Node.js env
uses: actions/setup-node@v2.1.5
with:
node-version: 18.0.0

- name: setup-cocoapods
uses: maxim-lobanov/setup-cocoapods@v1
- name: Upload debug output
if: always()
uses: actions/upload-artifact@v4
with:
version: 1.14.3
name: maestro-debug-android
path: |
maestro-debug/
~/.maestro/tests/
retention-days: 7
if-no-files-found: warn

ios-e2e:
runs-on: macos-15 # 3 cores / 7 GB - tight, nothing you can do on a standard runner
timeout-minutes: 60
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Get npm cache directory
id: npm-cache-dir
shell: bash
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}
- name: Setup Node.js env
uses: actions/setup-node@v4
with:
node-version: 24
cache: npm

- uses: actions/cache@v3
id: npm-cache
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
ruby-version: '.ruby-version'
bundler-cache: true

- uses: actions/cache@v3
- name: Cache Pods
uses: actions/cache@v4
with:
path: example/ios/Pods
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-


- name: Install React Native CLI
run: npm install react-native-cli

- name: Install Maestro CLI
run: |
curl -Ls "https://get.maestro.mobile.dev" | bash
echo "${HOME}/.maestro/bin" >> $GITHUB_PATH
brew tap facebook/fb
brew install facebook/fb/idb-companion

- name: Add Maestro to path
run: echo "${HOME}/.maestro/bin" >> $GITHUB_PATH
- name: Install example Ruby dependencies
working-directory: example
run: bundle install

- name: Install Dependencies
run: npm run install:all
- name: Install dependencies
run: |
npm run install:no-pods
npm run prepack
cd example/ios && pod install

- name: Run iOS app
- name: Prepare iOS Simulator
run: |
npm run ios:release
xcrun simctl shutdown all || true
UDID=$(xcrun simctl create "e2e-sim" "iPhone 16 Pro")
echo "SIM_UDID=$UDID" >> $GITHUB_ENV
xcrun simctl boot "$UDID"
xcrun simctl list devices booted

- name: Build and launch iOS app
working-directory: example
run: npx react-native run-ios --mode Release --udid "$SIM_UDID"

- name: Run iOS E2E tests
run: |
mkdir -p "$GITHUB_WORKSPACE/maestro-debug"
npm run test:e2e:ios
env:
MAESTRO_DRIVER_STARTUP_TIMEOUT: 240000
MAESTRO_DRIVER_STARTUP_TIMEOUT: 120000

- name: Stop Emulator
run: killall "Simulator"
- name: Upload debug output
if: always()
uses: actions/upload-artifact@v4
with:
name: maestro-debug-ios
path: |
maestro-debug/
~/.maestro/tests/
retention-days: 7
if-no-files-found: warn

- name: Shutdown simulator
if: always()
run: xcrun simctl shutdown all || true
8 changes: 7 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,15 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18.0.0
node-version: 24
registry-url: 'https://npm.pkg.github.com'

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

- name: Install dependencies, lint and jest test
run: |
chmod +x ./.ci_steps/test.sh
Expand Down
36 changes: 28 additions & 8 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
pull_request:
branches: ['**']

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
react-unit:
runs-on: macos-latest
Expand All @@ -18,6 +22,12 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3

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

- name: Cache Tyro Pay API React Native
uses: actions/cache@v3
with:
Expand All @@ -30,29 +40,30 @@ jobs:

- name: Pod clear cache
run: |
pod cache clean --all
bundle exec pod cache clean --all

- name: Install dependencies, lint and jest test
run: |
chmod +x ./.ci_steps/test.sh
./.ci_steps/test.sh

ios-unit:
runs-on: macos-14
runs-on: macos-15

steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."

- name: setup-cocoapods
uses: maxim-lobanov/setup-cocoapods@v1
with:
version: 1.15.2

- name: Checkout code
uses: actions/checkout@v3

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

- name: Cache Tyro Pay API React Native
uses: actions/cache@v3
with:
Expand All @@ -65,15 +76,24 @@ jobs:

- name: Pod clear cache
run: |
pod cache clean --all
bundle exec pod cache clean --all

- name: Install React Native CLI
run: npm install react-native-cli

- name: Install example Ruby dependencies
working-directory: example
run: bundle install

- name: Install dependencies
run: |
npm run install:all

- name: Prepare iOS Simulator
run: |
xcrun simctl list devices | grep "iPhone 16 Pro" | grep -oE '[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}' | xargs -r xcrun simctl delete 2>/dev/null || true
xcrun simctl create "iPhone 16 Pro" "iPhone 16 Pro"

- name: Run iOS tests
run: npm run test:unit:ios

Expand Down
Loading
Loading