refactor: slim DeviceSpec to required fields + sparse serialization #2376
Workflow file for this run
This file contains hidden or 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: Test E2E | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| jobs: | |
| build: | |
| name: Build on Java ${{ matrix.java-version }} | |
| runs-on: macos-latest | |
| timeout-minutes: 20 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| java-version: [17] | |
| steps: | |
| - name: Clone repository | |
| uses: actions/checkout@v6 | |
| - name: Set up Java | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: zulu | |
| java-version: ${{ matrix.java-version }} | |
| cache: gradle | |
| - name: Build xctest-runner | |
| run: ./maestro-ios-xctest-runner/build-maestro-ios-runner.sh | xcbeautify | |
| - name: Build Maestro CLI | |
| run: ./gradlew :maestro-cli:distZip | |
| - name: Upload zipped Maestro CLI artifact | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: maestro-cli-jdk${{ matrix.java-version }}-run_id${{ github.run_id }} | |
| path: maestro-cli/build/distributions/maestro.zip | |
| retention-days: 1 | |
| - name: Upload build/Products to artifacts | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: build__Products-jdk${{ matrix.java-version }} | |
| path: build/Products | |
| retention-days: 1 | |
| test-web: | |
| name: Test on Web | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Clone repository (only needed for the e2e directory) | |
| uses: actions/checkout@v6 | |
| - name: Set up Java | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: zulu | |
| java-version: 17 | |
| - name: Set up Chrome | |
| uses: browser-actions/setup-chrome@v2 | |
| with: | |
| chrome-version: 142 | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v7 | |
| with: | |
| name: maestro-cli-jdk17-run_id${{ github.run_id }} | |
| - 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: Run tests | |
| working-directory: ${{ github.workspace }}/e2e | |
| timeout-minutes: 20 | |
| run: ./run_tests web | |
| - name: Upload ~/.maestro artifacts | |
| uses: actions/upload-artifact@v6 | |
| if: success() || failure() | |
| with: | |
| name: maestro-root-dir-web | |
| path: ~/.maestro | |
| retention-days: 7 | |
| include-hidden-files: true | |
| test-android: | |
| name: Test on Android | |
| runs-on: ubuntu-latest | |
| needs: build | |
| timeout-minutes: 60 | |
| env: | |
| ANDROID_HOME: /home/runner/androidsdk | |
| ANDROID_SDK_ROOT: /home/runner/androidsdk | |
| ANDROID_AVD_HOME: /home/runner/.config/.android/avd/ | |
| ANDROID_OS_IMAGE: system-images;android-32;google_apis;x86_64 | |
| ANDROID_PLATFORM: platforms;android-34 | |
| 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@v6 | |
| - name: Set up Java | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: zulu | |
| java-version: 17 | |
| - name: Set up mobile-dev-inc/bartek-scripts (for install_android_sdk script) | |
| run: | | |
| git clone https://github.com/mobile-dev-inc/bartek-scripts.git $HOME/scripts | |
| echo "$HOME/scripts/bin" >> $GITHUB_PATH | |
| - name: Set up Android Command-line Tools | |
| run: | | |
| # v13 - see https://stackoverflow.com/a/78890086/7009800 | |
| install_android_sdk https://dl.google.com/android/repository/commandlinetools-linux-12266719_latest.zip | |
| echo "$ANDROID_HOME/cmdline-tools/latest/bin:$PATH" >> $GITHUB_PATH | |
| - name: Set up Android SDK components | |
| run: | | |
| yes | sdkmanager --licenses | |
| sdkmanager --install emulator | |
| echo "$ANDROID_HOME/emulator" >> $GITHUB_PATH | |
| sdkmanager --install "platform-tools" | |
| echo "$ANDROID_HOME/platform-tools" >> $GITHUB_PATH | |
| sdkmanager --install "$ANDROID_PLATFORM" | |
| sdkmanager --install "$ANDROID_OS_IMAGE" | |
| - name: Cache pub | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.pub-cache | |
| e2e/demo_app/.dart_tool | |
| key: pub-${{ runner.os }}-${{ hashFiles('e2e/demo_app/pubspec.lock') }} | |
| restore-keys: | | |
| pub-${{ runner.os }}- | |
| - name: Cache Gradle | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| e2e/demo_app/android/.gradle | |
| key: gradle-${{ runner.os }}-${{ hashFiles('e2e/demo_app/android/**/*.gradle*', 'e2e/demo_app/android/gradle/wrapper/gradle-wrapper.properties') }} | |
| restore-keys: | | |
| gradle-${{ runner.os }}- | |
| - name: Set up Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| channel: stable | |
| flutter-version-file: e2e/demo_app/pubspec.yaml | |
| - name: Build demo_app APK | |
| working-directory: ${{ github.workspace }}/e2e/demo_app | |
| run: | | |
| flutter pub get | |
| flutter build apk | |
| mkdir -p ${{ github.workspace }}/e2e/apps | |
| cp build/app/outputs/flutter-apk/app-release.apk ${{ github.workspace }}/e2e/apps/demo_app.apk | |
| - name: Download Maestro build from previous job | |
| uses: actions/download-artifact@v7 | |
| with: | |
| name: maestro-cli-jdk17-run_id${{ github.run_id }} | |
| - 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: Create AVD | |
| run: | | |
| avdmanager -s create avd \ | |
| --package "$ANDROID_OS_IMAGE" \ | |
| --name "MyAVD" | |
| echo "DEBUG INFO" | |
| avdmanager list avd | |
| echo "ANDROID_PREFS_ROOT=$ANDROID_PREFS_ROOT" | |
| echo "ANDROID_SDK_ROOT=$ANDROID_SDK_ROOT" | |
| echo "ANDROID_HOME=$ANDROID_HOME" | |
| echo "ANDROID_SDK_HOME=$ANDROID_SDK_HOME" | |
| echo "ANDROID_AVD_HOME=$ANDROID_AVD_HOME" | |
| echo "ANDROID_EMULATOR_HOME=$ANDROID_EMULATOR_HOME" | |
| echo "HOME=$HOME" | |
| cat << EOF >> ~/.config/.android/avd/MyAVD.avd/config.ini | |
| hw.cpu.ncore=4 | |
| hw.gpu.enabled=yes | |
| hw.gpu.mode=swiftshader_indirect | |
| hw.ramSize=4192 | |
| disk.dataPartition.size=6442450944 | |
| vm.heapSize=112M | |
| hw.lcd.density=240 | |
| hw.lcd.height=1280 | |
| hw.lcd.width=606 | |
| EOF | |
| - name: Run AVD | |
| run: | | |
| emulator @MyAVD \ | |
| -verbose -no-snapshot -no-window -no-audio -no-boot-anim -accel on -no-metrics -camera-back emulated \ | |
| >~/emulator_stdout.log \ | |
| 2>~/emulator_stderr.log & | |
| - name: Wait for AVD to start up | |
| run: | | |
| adb wait-for-device && echo 'Emulator device online' | |
| adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done;' && echo 'Emulator booted' | |
| # This is also a prerequiste | |
| while true; do | |
| adb shell service list | grep 'package' && echo 'service "package" is active!' && break | |
| echo 'waiting for service "package" to start' | |
| sleep 1 | |
| done | |
| - name: Install apps | |
| working-directory: ${{ github.workspace }}/e2e | |
| run: ./install_apps android | |
| - name: Run tests | |
| working-directory: ${{ github.workspace }}/e2e | |
| timeout-minutes: 30 | |
| run: ./run_tests android | |
| - name: Upload ~/.maestro artifacts | |
| uses: actions/upload-artifact@v6 | |
| if: success() || failure() | |
| with: | |
| name: maestro-root-dir-android | |
| path: ~/.maestro | |
| retention-days: 7 | |
| include-hidden-files: true | |
| test-ios: | |
| name: Test on iOS | |
| runs-on: macos-26 | |
| needs: build | |
| timeout-minutes: 120 | |
| env: | |
| MAESTRO_DRIVER_STARTUP_TIMEOUT: 240000 # 240s | |
| MAESTRO_CLI_LOG_PATTERN_CONSOLE: '%d{HH:mm:ss.SSS} [%5level] %logger.%method: %msg%n' | |
| steps: | |
| - name: Clone repository (only needed for the e2e directory) | |
| uses: actions/checkout@v6 | |
| - name: Set up JDK | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: zulu | |
| java-version: 17 | |
| - name: Set up Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| channel: stable | |
| flutter-version-file: e2e/demo_app/pubspec.yaml | |
| - name: Build demo_app for iOS Simulator | |
| working-directory: ${{ github.workspace }}/e2e/demo_app | |
| run: | | |
| flutter pub get | |
| flutter build ios --simulator | |
| mkdir -p ${{ github.workspace }}/e2e/apps | |
| cp -r build/ios/iphonesimulator/Runner.app ${{ github.workspace }}/e2e/apps/demo_app.app | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v7 | |
| with: | |
| name: maestro-cli-jdk17-run_id${{ github.run_id }} | |
| - 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: Boot Simulator | |
| run: | | |
| xcrun simctl list runtimes | |
| export RUNTIME="iOS26.1" | |
| export DEVICE_TYPE="iPhone 17 Pro" | |
| ./.github/scripts/boot_simulator.sh | |
| - name: Download apps | |
| working-directory: ${{ github.workspace }}/e2e | |
| run: ./download_apps ios | |
| - name: Install apps | |
| working-directory: ${{ github.workspace }}/e2e | |
| run: ./install_apps ios | |
| - name: Start screen recording | |
| run: | | |
| xcrun simctl io booted recordVideo --codec h264 ~/screenrecord.mp4 & | |
| echo $! > ~/screenrecord.pid | |
| - name: Run tests | |
| working-directory: ${{ github.workspace }}/e2e | |
| timeout-minutes: 120 | |
| run: ./run_tests ios | |
| - name: Stop screen recording | |
| if: success() || failure() | |
| run: kill -SIGINT "$(cat ~/screenrecord.pid)" | |
| - name: Upload ~/.maestro artifacts | |
| uses: actions/upload-artifact@v6 | |
| if: success() || failure() | |
| with: | |
| name: maestro-root-dir-ios | |
| path: ~/.maestro | |
| retention-days: 7 | |
| include-hidden-files: true | |
| - name: Upload xctest runner logs | |
| uses: actions/upload-artifact@v6 | |
| if: success() || failure() | |
| with: | |
| name: xctest_runner_logs | |
| path: ~/Library/Logs/maestro/xctest_runner_logs | |
| retention-days: 7 | |
| include-hidden-files: true | |
| - name: Upload screen recording of Simulator | |
| uses: actions/upload-artifact@v6 | |
| if: success() || failure() | |
| with: | |
| name: maestro-screenrecord-ios.mp4 | |
| path: ~/screenrecord.mp4 | |
| retention-days: 7 | |
| test-ios-xctest-runner: | |
| name: Test on iOS (XCTest Runner only) | |
| if: false # Disabled: This needs be fixed, not working yet. | |
| runs-on: macos-latest | |
| needs: build | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Clone repository (only needed for the e2e directory) | |
| uses: actions/checkout@v6 | |
| - name: Set up JDK | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: zulu | |
| java-version: 17 | |
| - name: Download Maestro artifact | |
| uses: actions/download-artifact@v7 | |
| with: | |
| name: maestro-cli-jdk17-run_id${{ github.run_id }} | |
| - name: Download build/Products artifact | |
| uses: actions/download-artifact@v7 | |
| with: | |
| name: build__Products-jdk17 | |
| path: build/Products | |
| - 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: Boot Simulator | |
| run: ./.github/scripts/boot_simulator.sh | |
| - name: Run tests | |
| timeout-minutes: 15 | |
| run: ./maestro-ios-xctest-runner/test-maestro-ios-runner.sh | |
| - name: Upload xc test runner logs | |
| uses: actions/upload-artifact@v6 | |
| if: success() || failure() | |
| with: | |
| name: test-ios-xctest-runner__xctest_runner_logs | |
| path: ~/Library/Logs/maestro/xctest_runner_logs | |
| retention-days: 7 | |
| include-hidden-files: true |