-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
fanch
committed
Sep 30, 2024
1 parent
1eeb78e
commit 021bf13
Showing
6 changed files
with
532 additions
and
36 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
--- | ||
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: ubuntu-latest | ||
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-28-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: 576 | ||
api-level: 28 | ||
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: | ||
api-level: 28 | ||
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: | | ||
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 | ||
- 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-28-${{ runner.os }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
--- | ||
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: ubuntu-latest | ||
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-35-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: 35 | ||
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: 35 | ||
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-35-wiki-${{ runner.os }} | ||
|
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
Oops, something went wrong.