Skip to content

Android e2e workflow improvements #38

Android e2e workflow improvements

Android e2e workflow improvements #38

Workflow file for this run

name: Test E2E
on:
workflow_dispatch:
pull_request:
jobs:
build:
runs-on: macos-latest
if: github.repository == 'mobile-dev-inc/maestro'
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Set up JDK 8
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 8
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v3
- name: Build xctest-runner
run: ./maestro-ios-xctest-runner/build-maestro-ios-runner.sh
- name: Build Maestro CLI
run: ./gradlew :maestro-cli:distZip
- uses: actions/upload-artifact@v4
with:
name: maestro-cli
path: maestro-cli/build/distributions/maestro.zip
retention-days: 1
test-local:
runs-on: ubuntu-latest
if: github.repository == 'mobile-dev-inc/maestro'
needs: build
env:
EMULATOR_API_LEVEL: 33
EMULATOR_TARGET: google_apis
EMULATOR_ARCH: x86_64
steps:
- name: Enable KVM group perms
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: Clone repository (only needed for the e2e directory)
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 8
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: maestro-cli
- name: Add Maestro CLI executable to PATH
run: |
unzip maestro.zip -d maestro_extracted
echo "$PWD/maestro_extracted/maestro/bin" >> $GITHUB_PATH
- name: Check if Maestro CLI executable starts up
run: |
maestro --help
maestro --version
- name: Set up Android SDK
uses: malinskiy/action-android/install-sdk@release/cmdlinetoolsversion
with:
url: https://dl.google.com/android/repository/commandlinetools-linux-9123335_latest.zip
# url: https://dl.google.com/android/repository/commandlinetools-linux-9123335_latest.zip # classFile version 61 (java17)
# url: https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip
# Above URL points to Command Line Tools v8.0 - the last version compatible with Java 8
# Found via https://stackoverflow.com/a/75763391/7009800
# Another useful website: https://androidsdkmanager.azurewebsites.net/cmdline-tools.html
- uses: malinskiy/action-android/emulator-run-cmd@release/cmdlinetoolsversion
with:
api: ${{ env.EMULATOR_API_LEVEL }}
tag: ${{ env.EMULATOR_TARGET }}
abi: ${{ env.EMULATOR_ARCH }}
cmd: all_e2e
- name: Upload ~/.maestro artifacts
uses: actions/upload-artifact@v4
if: failure()
with:
name: maestro-e2e-output
path: ~/.maestro
retention-days: 3
test-cloud:
runs-on: ubuntu-latest
if: github.repository == 'mobile-dev-inc/maestro'
needs: build
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: maestro-cli
- name: Set up JDK 8
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 8
- name: Add Maestro CLI executable to PATH
run: |
unzip maestro.zip -d maestro_extracted
echo "$PWD/maestro_extracted/maestro/bin" >> $GITHUB_PATH
- name: Check if Maestro CLI executable starts up
run: |
maestro --help
maestro --version
- name: maestro download-samples
run: maestro download-samples
- name: Run iOS test
run: |
maestro cloud \
--apiKey ${{ secrets.E2E_MOBILE_DEV_API_KEY }} \
--timeout 180 \
--fail-on-cancellation \
--include-tags advanced \
samples/sample.zip \
samples
- name: Run Android test
run: |
maestro cloud \
--apiKey ${{ secrets.E2E_MOBILE_DEV_API_KEY }} \
--fail-on-cancellation \
--include-tags advanced \
samples/sample.apk \
samples