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