feat: add reusable Android bridge client #8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ci-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| name: Android build gate | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 45 | |
| steps: | |
| - name: Check out source | |
| uses: actions/checkout@v7 | |
| with: | |
| persist-credentials: false | |
| - name: Install Linux native dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install --no-install-recommends --yes \ | |
| libc6-dev \ | |
| libasound2-dev \ | |
| libgl1-mesa-dev \ | |
| libx11-dev \ | |
| libxcursor-dev \ | |
| libxi-dev \ | |
| libxinerama-dev \ | |
| libxrandr-dev \ | |
| libxxf86vm-dev \ | |
| pkg-config | |
| - name: Set up Go | |
| uses: actions/setup-go@v7 | |
| with: | |
| go-version-file: tests/fixtures/go.mod | |
| # The bridge is a separate local Go module tested by make test. | |
| # Include its module definition so cache inputs describe every Go | |
| # module exercised by this workflow. | |
| cache-dependency-path: | | |
| go.mod | |
| tests/fixtures/go.mod | |
| tests/fixtures/go.sum | |
| - name: Set up JDK | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: temurin | |
| java-version: '17' | |
| cache: gradle | |
| cache-dependency-path: | | |
| android/*.gradle | |
| android/app/*.gradle | |
| android/gradle.properties | |
| android/gradle/libs.versions.toml | |
| android/gradle/wrapper/gradle-wrapper.properties | |
| - name: Restore Android SDK cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/Android/Sdk | |
| key: android-sdk-${{ runner.os }}-${{ hashFiles('Dependencies.mk') }} | |
| - name: Install project dependencies | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| android_sdk_root="${HOME}/Android/Sdk" | |
| ebitenmobile_version="$(cd tests/fixtures && go list -m -f '{{.Version}}' github.com/hajimehoshi/ebiten/v2)" | |
| make --no-print-directory -f Dependencies.mk install_dependencies \ | |
| ANDROID_SDK_ROOT="${android_sdk_root}" \ | |
| EBITENMOBILE_VERSION="${ebitenmobile_version}" \ | |
| NO_COLOR=1 | |
| { | |
| echo "ANDROID_SDK_ROOT=${android_sdk_root}" | |
| echo "ANDROID_HOME=${android_sdk_root}" | |
| } >> "$GITHUB_ENV" | |
| { | |
| echo "${android_sdk_root}/cmdline-tools/latest/bin" | |
| echo "${android_sdk_root}/platform-tools" | |
| echo "$(go env GOPATH)/bin" | |
| } >> "$GITHUB_PATH" | |
| - name: Run test suite | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| export ANDROID_SDK_ROOT="${ANDROID_SDK_ROOT:?ANDROID_SDK_ROOT is not set}" | |
| export ANDROID_HOME="${ANDROID_SDK_ROOT}" | |
| make test-android |