fix: trigger workflow #8
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: Run Maestro with reactivecircus GHA | |
on: | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
run-with-video-recording: | |
runs-on: macos-13 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
# - name: Cache Maestro | |
# id: maestro-cache | |
# uses: actions/cache@v4 | |
# with: | |
# path: ~/.maestro/bin/maestro | |
# key: maestro-${{ runner.os }}-toto-${{ hashFiles('**/maestro') }} | |
- name: Install Maestro | |
run: | | |
curl -Ls "https://get.maestro.mobile.dev" | bash | |
echo "${HOME}/.maestro/bin" >> $GITHUB_PATH | |
# - name: Enable KVM | |
# 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: Setup Android SDK | |
if: steps.avd-cache.outputs.cache-hit != 'true' | |
uses: android-actions/setup-android@v3 | |
- name: Gradle cache | |
uses: gradle/actions/setup-gradle@v3 | |
# - name: AVD cache | |
# uses: actions/cache/restore@v4 | |
# id: avd-cache | |
# with: | |
# path: | | |
# ~/.android/avd/* | |
# ~/.android/adb* | |
# key: avd-34-wiki-${{ runner.os }} | |
- name: create AVD and generate snapshot for caching | |
if: steps.avd-cache.outputs.cache-hit != 'true' | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
cores: 4 | |
ram-size: 4096M | |
heap-size: 2000 | |
api-level: 27 | |
target: google_apis | |
arch: x86_64 | |
force-avd-creation: false | |
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | |
disable-animations: false | |
script: | | |
adb install wikipedia.apk | |
echo "install done" | |
echo "Generated AVD snapshot for caching." | |
- name: run tests | |
uses: reactivecircus/android-emulator-runner@v2 | |
env: | |
MAESTRO_CLI_NO_ANALYTICS: 1 | |
with: | |
cores: 4 | |
ram-size: 4096M | |
heap-size: 2000 | |
api-level: 34 | |
target: google_apis | |
arch: x86_64 | |
force-avd-creation: false | |
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | |
profile: pixel_6 | |
disable-animations: true | |
script: | | |
adb logcat -c | |
adb logcat > adb_logs.txt & | |
maestro test samples/android-advanced-flow.yaml | |
# https://github.com/actions/upload-artifact/issues/333#issuecomment-1227464293 | |
# The -j option in the zip command is used to junk (strip) the directory paths and store just | |
# the names of the files. This means that when you create a zip archive, the files will be | |
# stored in the root of the archive without any directory structure. | |
- name: Zip the test result folder | |
if: always() | |
run: | | |
zip -r testResult.zip -j ${HOME}/.maestro/tests/* emulator.log adb_logs.txt | |
- name: Upload test result | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Test result | |
path: testResult.zip | |
# - uses: actions/cache/save@v4 | |
# if: always() | |
# with: | |
# path: | | |
# ~/.android/avd/* | |
# ~/.android/adb* | |
# key: avd-34-wiki-${{ runner.os }} |