This project uses three GitHub Actions workflows for continuous integration and delivery.
File: .github/workflows/run-tests.yml
Triggers:
pushtomain(skips.mdchanges)pull_requesttargetingmain(skips.mdchanges)- Manual trigger via
workflow_dispatch
Purpose: Runs all Android unit tests on every PR and push to main.
Steps:
| Step | Action | Description |
|---|---|---|
| Checkout | actions/checkout@v6 |
Fetches the branch code |
| Setup Gradle | gradle/actions/setup-gradle@v6 |
Validates wrapper, sets up Gradle |
| Setup JDK 17 | actions/setup-java@v5 |
Temurin JDK 17, caches Gradle |
| Run tests | ./gradlew testDebugUnitTest |
Executes all debug unit tests |
File: .github/workflows/gen-android-apk.yml
Triggers:
pushof a tag matchingv*(e.g.,v1.2.3)
Purpose: Builds a debug APK and creates a GitHub Release when a version tag is pushed.
Steps:
| Step | Action | Description |
|---|---|---|
| Checkout | actions/checkout@v6 |
Fetches the tagged commit |
| Setup Gradle | gradle/actions/setup-gradle@v6 |
Validates wrapper |
| Setup JDK 17 | actions/setup-java@v5 |
Temurin JDK 17, caches Gradle |
| Build APK + tests | ./gradlew test assembleDebug |
Runs tests and builds debug APK |
| Create Release | gh release create |
Creates a GitHub Release for the tag |
| Upload APK | gh release upload |
Attaches app-debug.apk to the release |
File: .github/workflows/maestro-tests.yml
Triggers:
- Manual via
workflow_dispatch(triggered from the Actions tab in GitHub)
Purpose: Starts the Go API server (HTTPS), builds the app with a local API URL, boots an Android emulator, installs the APK, and runs Maestro UI tests.
Steps:
| Step | Action | Description |
|---|---|---|
| Checkout | actions/checkout@v6 |
Fetches the PR branch |
| Setup Gradle | gradle/actions/setup-gradle@v6 |
Validates wrapper |
| Setup JDK 17 | actions/setup-java@v5 |
Temurin JDK 17, caches Gradle |
| Cache Maestro | actions/cache@v5 |
Caches Maestro CLI at ~/.maestro |
| Setup Go | actions/setup-go@v5 |
Installs Go 1.22, caches modules |
| Build + start API server | go build + ./spacex-api-server & |
Builds and starts the Go server in background; waits for /healthz (up to 15s). Server uses certs from certs/ and serves HTTPS on :8443 |
| Build debug APK | ./gradlew assembleDebug -PAPI_BASE_URL=https://localhost:8443/ |
Builds APK pointing at the Go server (via adb reverse) |
| Enable KVM | udev rules | Grants KVM access for the emulator |
| Start emulator + run tests | reactivecircus/android-emulator-runner@v2 |
Boots API 30 x86_64 emulator (Pixel 6 Pro), runs setup_maestro.sh, install_app.sh, run_maestro.sh |
| Comment PR | actions/github-script@v9 |
Posts test results on the PR (if applicable) |
- The Go API server (
api-server/) is built withgo buildand started in the background - It binds to
:8443on the GitHub runner (HTTPS via pre-generated self-signed certs incerts/) - The Android APK is compiled with
-PAPI_BASE_URL=https://localhost:8443/ adb reverse tcp:8443 tcp:8443forwards emulator connections to the host's Go server- The emulator boots and the app makes API calls to
localhost:8443, which reaches the Go server on the runner - After tests complete, the server process is automatically cleaned up when the runner terminates