|
| 1 | +name: Android Platform Integration |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - main |
| 8 | + |
| 9 | +permissions: |
| 10 | + contents: read |
| 11 | + |
| 12 | +concurrency: |
| 13 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 14 | + cancel-in-progress: true |
| 15 | + |
| 16 | +jobs: |
| 17 | + android: |
| 18 | + name: Android |
| 19 | + runs-on: ubuntu-latest |
| 20 | + env: |
| 21 | + MISE_EXEC_AUTO_INSTALL: "false" |
| 22 | + MISE_NOT_FOUND_AUTO_INSTALL: "false" |
| 23 | + |
| 24 | + steps: |
| 25 | + - name: Checkout |
| 26 | + uses: actions/checkout@v6 |
| 27 | + |
| 28 | + - name: Install Node and Java |
| 29 | + uses: jdx/mise-action@v3 |
| 30 | + with: |
| 31 | + install: true |
| 32 | + install_args: node java |
| 33 | + cache: true |
| 34 | + |
| 35 | + - name: Setup Godot |
| 36 | + uses: chickensoft-games/setup-godot@v2 |
| 37 | + with: |
| 38 | + version: 4.6.2 |
| 39 | + use-dotnet: true |
| 40 | + include-templates: true |
| 41 | + |
| 42 | + - name: Enable Corepack |
| 43 | + run: mise x -- corepack enable pnpm |
| 44 | + |
| 45 | + - name: Get pnpm store path |
| 46 | + id: pnpm-store |
| 47 | + run: echo "path=$(mise x -- corepack pnpm store path --silent)" >> "$GITHUB_OUTPUT" |
| 48 | + |
| 49 | + - name: Cache pnpm store |
| 50 | + uses: actions/cache@v5 |
| 51 | + with: |
| 52 | + path: ${{ steps.pnpm-store.outputs.path }} |
| 53 | + key: ${{ runner.os }}-${{ runner.arch }}-pnpm-store-${{ hashFiles('pnpm-lock.yaml') }} |
| 54 | + restore-keys: | |
| 55 | + ${{ runner.os }}-${{ runner.arch }}-pnpm-store- |
| 56 | +
|
| 57 | + - name: Install pnpm dependencies |
| 58 | + run: mise x -- corepack pnpm install --frozen-lockfile |
| 59 | + |
| 60 | + - name: Install Android SDK platforms |
| 61 | + run: | |
| 62 | + yes | sdkmanager --licenses >/dev/null |
| 63 | + sdkmanager "platforms;android-35" "platforms;android-36" "build-tools;36.0.0" "platform-tools" |
| 64 | +
|
| 65 | + - name: Build integration APK |
| 66 | + run: mise x -- bash -c 'GODOT_BIN="${GODOT:-godot}" scripts/build_integration_android.sh' |
| 67 | + |
| 68 | + - name: Enable KVM |
| 69 | + run: | |
| 70 | + echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules |
| 71 | + sudo udevadm control --reload-rules |
| 72 | + sudo udevadm trigger --name-match=kvm |
| 73 | +
|
| 74 | + - name: Run integration tests |
| 75 | + uses: reactivecircus/android-emulator-runner@v2 |
| 76 | + with: |
| 77 | + api-level: 35 |
| 78 | + target: google_apis |
| 79 | + arch: x86_64 |
| 80 | + profile: pixel_7 |
| 81 | + script: | |
| 82 | + adb install -r dist/integration/android_debug.apk |
| 83 | + scripts/run_integration_android_test.sh ipc_round_trip_probe |
| 84 | + scripts/run_integration_android_test.sh webview_lifecycle_probe |
| 85 | + scripts/run_integration_android_test.sh res_asset_loading_probe |
0 commit comments