|
1 | | -name: Run Maestro Tests on Android |
| 1 | +name: Maestro Tests on Android |
2 | 2 |
|
3 | 3 | on: |
4 | | - pull_request: |
5 | | - branches: |
6 | | - - '*' |
| 4 | + workflow_run: |
| 5 | + workflows: [Build Android Experimental APK] |
| 6 | + types: |
| 7 | + - completed |
7 | 8 |
|
8 | 9 | jobs: |
9 | 10 | android-maestro-test: |
10 | 11 | runs-on: ubuntu-latest |
11 | 12 |
|
12 | 13 | steps: |
13 | | - - name: Checkout Repository |
14 | | - uses: actions/checkout@v4 |
15 | | - |
16 | | - - name: Set up Node.js |
17 | | - uses: actions/setup-node@v4 |
18 | | - with: |
19 | | - node-version: 22 |
20 | | - cache: 'yarn' |
21 | | - |
22 | | - - name: Cache node_modules |
23 | | - id: cache-node-modules |
24 | | - uses: actions/cache@v4 |
| 14 | + - name: Download APK |
| 15 | + uses: actions/download-artifact@v3 |
25 | 16 | with: |
26 | | - path: node_modules |
27 | | - key: ${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }} |
28 | | - restore-keys: | |
29 | | - ${{ runner.os }}-node_modules- |
| 17 | + name: Android Experimental APK |
30 | 18 |
|
31 | 19 | - name: Install Maestro |
32 | 20 | run: | |
33 | 21 | curl -fsSL "https://get.maestro.mobile.dev" | bash |
34 | 22 | echo "$HOME/.maestro/bin" >> $GITHUB_PATH |
35 | 23 |
|
36 | | - - name: Decode Keystore |
37 | | - run: | |
38 | | - echo "${{ secrets.EXPERIMENTAL_KEYSTORE_BASE64 }}" | base64 -d > android/app/release.keystore |
39 | | -
|
40 | | - - name: Set gradle.properties |
41 | | - run: | |
42 | | - echo " " >> android/gradle.properties |
43 | | - echo "KEYSTORE=release.keystore" >> android/gradle.properties |
44 | | - echo "KEYSTORE_PASSWORD=${{ secrets.EXPERIMENTAL_KEYSTORE_PASSWORD }}" >> android/gradle.properties |
45 | | - echo "KEY_ALIAS=${{ secrets.EXPERIMENTAL_KEY_ALIAS }}" >> android/gradle.properties |
46 | | - echo "KEY_PASSWORD=${{ secrets.EXPERIMENTAL_KEY_PASSWORD }}" >> android/gradle.properties |
47 | | - |
48 | | - - name: Install Dependencies |
49 | | - run: yarn install |
50 | | - |
51 | | - - name: Enable KVM group permissions |
52 | | - run: | |
53 | | - echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules |
54 | | - sudo udevadm control --reload-rules |
55 | | - sudo udevadm trigger --name-match=kvm |
56 | | -
|
57 | | - - name: Set up Gradle |
58 | | - uses: gradle/actions/setup-gradle@v4 |
59 | | - |
60 | | - - name: Cache Gradle Caches |
61 | | - uses: actions/cache@v4 |
62 | | - with: |
63 | | - path: | |
64 | | - ~/.gradle/caches |
65 | | - ~/.gradle/wrapper |
66 | | - key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} |
67 | | - restore-keys: | |
68 | | - gradle-${{ runner.os }}- |
69 | | -
|
70 | | - - name: Build Android Release APK |
71 | | - run: | |
72 | | - cd android |
73 | | - ./gradlew assembleExperimentalRelease --no-daemon --build-cache --parallel --max-workers=4 |
74 | | -
|
75 | | - - name: Free Space Before Cleanup |
76 | | - run: | |
77 | | - echo "Free space before cleanup:" |
78 | | - df -h |
79 | | -
|
80 | | - - name: Maximize build space |
81 | | - uses: AdityaGarg8/remove-unwanted-software@v5 |
82 | | - with: |
83 | | - remove-dotnet: 'true' |
84 | | - remove-haskell: 'true' |
85 | | - remove-swapfile: 'true' |
86 | | - |
87 | | - - name: Free Space After Cleanup |
88 | | - run: | |
89 | | - echo "Free space:" |
90 | | - df -h |
91 | | -
|
92 | 24 | - name: Start Android Emulator and Run Maestro Tests |
93 | 25 | uses: reactivecircus/android-emulator-runner@v2 |
94 | 26 | with: |
|
101 | 33 | script: | |
102 | 34 | avdmanager list device |
103 | 35 | mkdir recording |
104 | | - adb install android/app/build/outputs/apk/experimental/release/app-experimental-release.apk |
| 36 | + adb install app-experimental-release.apk |
105 | 37 | maestro test .maestro/login.yml --format junit --output maestro-report.xml |
106 | 38 |
|
107 | 39 | - name: Upload Recordings |
|
0 commit comments