|
77 | 77 | path: | |
78 | 78 | appium.log |
79 | 79 | test/report/ |
| 80 | +
|
| 81 | + android_test: |
| 82 | + runs-on: ubuntu-latest |
| 83 | + timeout-minutes: 90 |
| 84 | + env: |
| 85 | + API_LEVEL: 35 |
| 86 | + ARCH: x86_64 |
| 87 | + |
| 88 | + steps: |
| 89 | + - uses: actions/checkout@v6 |
| 90 | + |
| 91 | + - name: Set up Java |
| 92 | + uses: actions/setup-java@v5 |
| 93 | + with: |
| 94 | + distribution: temurin |
| 95 | + java-version: '17' |
| 96 | + |
| 97 | + - name: Install Node.js |
| 98 | + uses: actions/setup-node@v6 |
| 99 | + with: |
| 100 | + node-version: 'lts/*' |
| 101 | + |
| 102 | + - name: Set up Ruby |
| 103 | + uses: ruby/setup-ruby@v1 |
| 104 | + with: |
| 105 | + ruby-version: 4.0 |
| 106 | + |
| 107 | + - name: Install appium |
| 108 | + run: | |
| 109 | + npm install -g appium |
| 110 | + npm install -g mjpeg-consumer |
| 111 | +
|
| 112 | + - name: Start appium |
| 113 | + run: | |
| 114 | + appium driver install uiautomator2 |
| 115 | + appium plugin install images |
| 116 | + appium plugin install execute-driver |
| 117 | + nohup appium --use-plugins=images,execute-driver --relaxed-security --log-timestamp --log-no-colors > appium.log & |
| 118 | +
|
| 119 | + - name: Enable KVM group perms |
| 120 | + run: | |
| 121 | + echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules |
| 122 | + sudo udevadm control --reload-rules |
| 123 | + sudo udevadm trigger --name-match=kvm |
| 124 | +
|
| 125 | + - name: AVD cache |
| 126 | + uses: actions/cache@v4 |
| 127 | + id: avd-cache |
| 128 | + with: |
| 129 | + path: | |
| 130 | + ~/.android/avd/* |
| 131 | + ~/.android/adb* |
| 132 | + key: avd-${{ env.API_LEVEL }} |
| 133 | + |
| 134 | + - name: Create AVD snapshot for cache |
| 135 | + if: steps.avd-cache.outputs.cache-hit != 'true' |
| 136 | + uses: reactivecircus/android-emulator-runner@v2 |
| 137 | + with: |
| 138 | + api-level: ${{ env.API_LEVEL }} |
| 139 | + arch: ${{ env.ARCH }} |
| 140 | + target: google_apis |
| 141 | + force-avd-creation: false |
| 142 | + emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none |
| 143 | + disable-animations: false |
| 144 | + disable-spellchecker: true |
| 145 | + script: | |
| 146 | + adb devices |
| 147 | + cd android_tests |
| 148 | + bundle install |
| 149 | + rake android |
| 150 | +
|
| 151 | + - name: Run Android tests |
| 152 | + uses: reactivecircus/android-emulator-runner@v2 |
| 153 | + with: |
| 154 | + api-level: ${{ env.API_LEVEL }} |
| 155 | + arch: ${{ env.ARCH }} |
| 156 | + target: google_apis |
| 157 | + profile: Nexus 5X |
| 158 | + disable-animations: true |
| 159 | + disable-spellchecker: true |
| 160 | + script: | |
| 161 | + adb devices |
| 162 | + cd android_tests |
| 163 | + bundle install |
| 164 | + rake android |
| 165 | +
|
| 166 | + - name: Save server output |
| 167 | + if: ${{ always() }} |
| 168 | + uses: actions/upload-artifact@master |
| 169 | + with: |
| 170 | + name: appium-android_test_with_other_deps.log |
| 171 | + path: | |
| 172 | + appium.log |
| 173 | + test/report/ |
0 commit comments