|
17 | 17 | flake8: |
18 | 18 | name: Flake8 tests |
19 | 19 | runs-on: ubuntu-latest |
| 20 | + # TODO: temporarily disabled for debugging purpose |
| 21 | + if: false |
20 | 22 | steps: |
21 | 23 | - name: Checkout python-for-android |
22 | 24 | uses: actions/checkout@v4 |
|
34 | 36 | name: Pytest [Python ${{ matrix.python-version }} | ${{ matrix.os }}] |
35 | 37 | needs: flake8 |
36 | 38 | runs-on: ${{ matrix.os }} |
| 39 | + # TODO: temporarily disabled for debugging purpose |
| 40 | + if: false |
37 | 41 | strategy: |
38 | 42 | matrix: |
39 | 43 | python-version: ['3.8', '3.9', '3.10', '3.11'] |
@@ -111,6 +115,8 @@ jobs: |
111 | 115 | name: Build test APP [ ${{ matrix.runs_on }} | ${{ matrix.bootstrap.name }} ] |
112 | 116 | needs: [flake8] |
113 | 117 | runs-on: ${{ matrix.runs_on }} |
| 118 | + # TODO: temporarily disabled for debugging purpose |
| 119 | + if: false |
114 | 120 | continue-on-error: true |
115 | 121 | strategy: |
116 | 122 | matrix: |
@@ -162,10 +168,71 @@ jobs: |
162 | 168 | name: ${{ matrix.runs_on }}-${{ matrix.bootstrap.name }}-artifacts |
163 | 169 | path: dist |
164 | 170 |
|
| 171 | + test_on_emulator: |
| 172 | + name: Run App on Emulator |
| 173 | + # TODO: keep it simple and go with ubuntu_build for a start |
| 174 | + # needs: [ubuntu_build, macos_build] |
| 175 | + needs: [ubuntu_build] |
| 176 | + runs-on: ubuntu-latest |
| 177 | + |
| 178 | + steps: |
| 179 | + - name: Download Artifacts |
| 180 | + uses: actions/download-artifact@v5 |
| 181 | + with: |
| 182 | + # TODO: keep it simple for now, but we may iterate over more artifact in the future |
| 183 | + name: ubuntu-latest-sdl2-artifacts |
| 184 | + path: dist/ |
| 185 | + |
| 186 | + - name: Setup and Start Android Emulator |
| 187 | + # This is the key action to run the emulator |
| 188 | + uses: reactivecircus/android-emulator-runner@v2 |
| 189 | + with: |
| 190 | + api-level: 30 |
| 191 | + # TODO: maybe make it a dedicated `ci/` script |
| 192 | + script: | |
| 193 | + APK_FILE=$(find dist -name "*.apk" -print -quit) |
| 194 | +
|
| 195 | + if [ -z "$APK_FILE" ]; then |
| 196 | + echo "Error: No APK file found in dist/" |
| 197 | + exit 1 |
| 198 | + fi |
| 199 | +
|
| 200 | + echo "Installing $APK_FILE..." |
| 201 | + adb install "$APK_FILE" |
| 202 | +
|
| 203 | + APP_PACKAGE=$(aapt dump badging ${APK_FILE} | awk -F"'" '/package: name=/{print $2}' | tee /dev/tty) |
| 204 | + APP_ACTIVITY=$(aapt dump badging ${APK_FILE} | awk -F"'" '/launchable-activity/ {print $2}' | tee /dev/tty) |
| 205 | + adb shell am start -n ${APP_PACKAGE}/${APP_ACTIVITY} |
| 206 | +
|
| 207 | + echo "Launching $APP_PACKAGE/$APP_ACTIVITY..." |
| 208 | + adb shell am start -n "$APP_PACKAGE/$APP_ACTIVITY" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER |
| 209 | +
|
| 210 | + # Give the app time to start, run python, and log its status |
| 211 | + sleep 15 |
| 212 | +
|
| 213 | + # Dump the logs and search for a success string |
| 214 | + adb logcat -d -s python:I *:S > app_logs.txt |
| 215 | +
|
| 216 | + echo "Checking app logs..." |
| 217 | +
|
| 218 | + if grep --extended-regexp --quiet "I python[ ]+: Initialized python" app_logs.txt && \ |
| 219 | + grep --extended-regexp --quiet "I python[ ]+: Ran 14 tests in" app_logs.txt && \ |
| 220 | + grep --extended-regexp --quiet "I python[ ]+: OK" app_logs.txt; then |
| 221 | + echo "✅ SUCCESS: App launched and all unit tests passed." |
| 222 | + else |
| 223 | + echo "❌ Failure: Python runtime initialization not detected or app crashed." |
| 224 | + echo "--- Full Logs ---" |
| 225 | + cat app_logs.txt |
| 226 | + echo "-----------------" |
| 227 | + exit 1 |
| 228 | + fi |
| 229 | +
|
165 | 230 | ubuntu_rebuild_updated_recipes: |
166 | 231 | name: Test updated recipes for arch ${{ matrix.android_arch }} [ ubuntu-latest ] |
167 | 232 | needs: [flake8] |
168 | 233 | runs-on: ubuntu-latest |
| 234 | + # TODO: temporarily disabled for debugging purpose |
| 235 | + if: false |
169 | 236 | continue-on-error: true |
170 | 237 | strategy: |
171 | 238 | matrix: |
@@ -197,6 +264,8 @@ jobs: |
197 | 264 | name: Test updated recipes for arch ${{ matrix.android_arch }} [ ${{ matrix.runs_on }} ] |
198 | 265 | needs: [flake8] |
199 | 266 | runs-on: ${{ matrix.runs_on }} |
| 267 | + # TODO: temporarily disabled for debugging purpose |
| 268 | + if: false |
200 | 269 | continue-on-error: true |
201 | 270 | strategy: |
202 | 271 | matrix: |
|
0 commit comments