$30 off During Our Annual Pro Sale. View Details »

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. Maestro Λ GitHub Actions


    Ͱಈ͔͢ ʙAndroidฤʙ
    2023.7.12 YUMEMI.grow Mobile #5


    Hiroyuki Kusu ( @hkusu_ )


    View Slide

  2. About me

    View Slide


  3. What is Maestro?
    https://maestro.mobile.dev/

    View Slide


  4. Maestro Studio

    View Slide


  5. Maestro Cloud

    View Slide

  6. Maestro Cloud Λ࢖Θͣʹ GitHub Actions


    ্ͷΤϛϡϨʔλʔͰಈ͔ͯ͠ΈΔ

    View Slide


  7. 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

    View Slide


  8. - 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

    View Slide


  9. ࣮ߦ݁Ռͷը໘

    View Slide



  10. https://github.blog/changelog/2023-02-23-hardware-accelerated-android-virtualization-on-actions-
    windows-and-linux-larger-hosted-runners/
    larger runners ͷར༻

    View Slide


  11. https://speakerdeck.com/hkusu/android-no-ci-github-actions-nogai-shan-de-zui-jin-yatutakoto
    larger runners ʹ͍ͭͯ͸ɺͪ͜ΒͷεϥΠυ΋

    View Slide


  12. https://github.com/marketplace/actions/android-emulator-runner

    Gradle ΍ ADV ͷΩϟογϡΛಋೖ͍ͨ͠৔߹͸ͪ͜Βͷ README Λ֬ೝ

    View Slide


  13. ΄͔ݕ౼ࣄ߲
    • GitHub Actions ͷ matrix ͰɺฒྻͰ֤ API level ͷ୺຤ͰςετΛͯ͠΋
    ͍͍͔΋͠Εͳ͍


    • ΞϓϦͷىಈ֬ೝ͚ͩͰ΋ CI Ͱ୲อ͓͚ͯ͠͹҆৺ʁ


    • Maestro Cloud ͰͷΑ͏ʹɺςετࣦഊ࣌ͷಈըΛݟΕΔΑ͏ʹ͍ͨ͠


    • Maestro CLI Ͱ࿥ը͸Ͱ͖ͦ͏ͳͷͰɺγΣϧͰΰχϣΰχϣͯ͠ςετ
    ݁Ռಉ༷ʹ Artifacts ΁Ξοϓϩʔυ͢Ε͹Α͍͔΋

    View Slide


  14. ࢀߟʹͤͯ͞௖͍ͨεϥΠυ
    https://speakerdeck.com/kgmyshin/uitesutohamoumaestrodeiinokamosirenaihua

    View Slide

  15. Thank you !


    @hkusu_
    ฐࣾ͸ Android ΤϯδχΞΛ ઈࢍืूத Ͱ͢ʂ

    View Slide