feat: add main branch version of maestro #43
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: CI | |
on: [push, workflow_dispatch] | |
# If CI is already running for a branch when that branch is updated, cancel the older jobs. | |
concurrency: | |
group: ci-${{ github.ref }}-${{ github.head_ref }} | |
cancel-in-progress: true | |
jobs: | |
flutter_job: | |
runs-on: macos-latest | |
strategy: | |
matrix: | |
api-level: [31] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Java 11 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: 11 | |
- name: Setup Flutter 3.10.3 | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: '3.10.3' | |
channel: 'stable' | |
- name: Gradle cache | |
uses: gradle/gradle-build-action@v2 | |
- name: Clone Maestro repository | |
run: git clone https://github.com/mobile-dev-inc/maestro.git | |
- name: Build maestro-cli | |
run: ./gradlew :maestro-cli:installDist -q | |
working-directory: ./maestro | |
- name: AVD cache | |
uses: actions/cache@v3 | |
id: avd-cache | |
with: | |
path: | | |
~/.android/avd/* | |
~/.android/adb* | |
key: avd-${{ matrix.api-level }} | |
- name: Run setup script | |
run: ./setup_flutter_as_app.sh | |
- name: Create AVD and generate snapshot for caching | |
if: steps.avd-cache.outputs.cache-hit != 'true' | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: ${{ matrix.api-level }} | |
target: android-tv | |
profile: tv_1080p | |
arch: x86 | |
force-avd-creation: false | |
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | |
disable-animations: false | |
avd-name: macos-ci-avd | |
script: echo "Generated AVD snapshot for caching." | |
- name: Run Flutter tests | |
run: flutter test | |
- name: Run integration tests | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: ${{ matrix.api-level }} | |
target: android-tv | |
arch: x86 | |
profile: tv_1080p | |
force-avd-creation: false | |
avd-name: macos-ci-avd | |
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | |
disable-animations: true | |
script: | | |
flutter build apk --debug --target-platform=android-x86 | |
flutter install --debug | |
export MAESTRO_DRIVER_STARTUP_TIMEOUT=60000 | |
./maestro/maestro-cli/build/install/maestro/bin/maestro test ./integration_test/run-test.yml | |
- name : Upload results | |
if : ${{ always() }} | |
uses : actions/upload-artifact@v3 | |
with : | |
name : integration_testing_results-flutter-${{ matrix.api-level }} | |
path : ~/.maestro/tests/** | |
android_native_job: | |
needs: flutter_job | |
runs-on: macos-latest | |
strategy: | |
matrix: | |
api-level: [31] | |
steps: | |
- name: Run setup script | |
run: ./setup_flutter_as_app.sh | |
- name: Build Android App | |
run: | | |
cd ./android_native_app | |
./gradlew assembleDebug | |
- name: Run tests | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: ${{ matrix.api-level }} | |
target: android-tv | |
arch: x86 | |
profile: tv_1080p | |
force-avd-creation: false | |
avd-name: macos-ci-avd | |
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | |
disable-animations: true | |
script: | | |
adb uninstall com.android.app.example | |
adb install ./android_native_app/app/build/outputs/apk/release/app-debug.apk | |
export MAESTRO_DRIVER_STARTUP_TIMEOUT=60000 | |
./maestro/maestro-cli/build/install/maestro/bin/maestro test ./integration_test/run-test.yml | |
- name : Upload results | |
if : ${{ always() }} | |
uses : actions/upload-artifact@v3 | |
with : | |
name : integration_testing_results-native-${{ matrix.api-level }} | |
path : ~/.maestro/tests/** |