Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Maestro を GitHub Actions で動かす 〜Android編〜

Maestro を GitHub Actions で動かす 〜Android編〜

YUMEMI.grow Mobile #5 ( https://yumemi.connpass.com/event/288628/ ) の資料

Hiroyuki Kusu

July 12, 2023
Tweet

More Decks by Hiroyuki Kusu

Other Decks in Technology

Transcript

  1.  name: Maestro tes t on : push : branches:

    [main ] jobs : test : runs-on : group: your-ubuntu-larger-runners-grou p steps : - name: Enable KVM group perm s run: | echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/ udev/rules.d/99-kvm4all.rule s sudo udevadm control --reload-rule s sudo udevadm trigger --name-match=kv m - name: Check ou t uses: actions/checkout@v 3 - name: Set up JD K uses: actions/setup-java@v 3 with : distribution: 'zulu ' java-version: 11
  2.  - name: Build with Gradl e run: ./gradlew assembleDebu

    g - name: Set up Maestr o run: curl -Ls https://get.maestro.mobile.dev | bas h - name: Get apk pat h id: apk-pat h run: echo "path=$(find . -regex '^.*/build/outputs/apk/.*\.apk$' -type f | head -1)" >> $GITHUB_OUTPU T - name: Run Maestr o uses: reactivecircus/android-emulator-runner@v 2 with : api-level: 2 8 target: 'google_apis ' arch: 'x86 ' profile: 'pixel ' disable-animations: tru e script: | $ANDROID_HOME/platform-tools/adb install ${{ steps.apk-path.outputs.path } } ~/.maestro/bin/maestro test --format junit flow.yam l - name: Upload test resul t if: failure( ) uses: actions/upload-artifact@v 3 with : path: report.xml
  3.  ΄͔ݕ౼ࣄ߲ • GitHub Actions ͷ matrix ͰɺฒྻͰ֤ API level

    ͷ୺຤ͰςετΛͯ͠΋ ͍͍͔΋͠Εͳ͍ • ΞϓϦͷىಈ֬ೝ͚ͩͰ΋ CI Ͱ୲อ͓͚ͯ͠͹҆৺ʁ • Maestro Cloud ͰͷΑ͏ʹɺςετࣦഊ࣌ͷಈըΛݟΕΔΑ͏ʹ͍ͨ͠ • Maestro CLI Ͱ࿥ը͸Ͱ͖ͦ͏ͳͷͰɺγΣϧͰΰχϣΰχϣͯ͠ςετ ݁Ռಉ༷ʹ Artifacts ΁Ξοϓϩʔυ͢Ε͹Α͍͔΋