Skip to content

Build & test

Prerequisites

  • JDK 17 (Gradle's embedded Kotlin DSL crashes on newer JVMs — see README).
  • Android SDK with platforms;android-35 and build-tools;34.0.0.
  • The Gradle wrapper (never use a system Gradle).

A concrete JDK export that works:

export JAVA_HOME="$HOME/.jdks/temurin-17"

If the SDK isn't wired through local.properties, export it for the session:

export ANDROID_HOME=/path/to/android-sdk

Commands

All commands run via the wrapper (./gradlew):

Task Command
Debug APK ./gradlew assembleDebug
Release APK ./gradlew assembleRelease
Play-Store bundle ./gradlew bundleRelease
Lint (primary check) ./gradlew lint
Kotlin style ./gradlew ktlintCheck
Static analysis ./gradlew detekt
Unit tests ./gradlew testDebugUnitTest
Single test ./gradlew testDebugUnitTest --tests "com.spooty.app.SomeTest"
Auto-format ./gradlew ktlintFormat

The local verification sweep

Before opening a PR, run the full sweep and wait for it to pass:

./gradlew ktlintCheck detekt lint testDebugUnitTest assembleDebug

Get the APK

You can sideload the app straight from CI — no local Android Studio needed:

  1. Open the Actions tab on GitHub.
  2. Run the CI workflow (or reuse the latest green run from main).
  3. Download the spooty-debug-apk artifact from the build job.
  4. Install on your phone with adb install --no-streaming app-debug.apk or by tapping the file once your device allows unknown sources.

On-demand builds

The CI workflow supports workflow_dispatch, so you can Run workflow → ⚙️ → Branch: main anytime to build a fresh APK without committing.

Release & signing

  • Signing is optional and driven by keystore.properties (gitignored). CI injects it from repository secrets when present; otherwise the release build is unsigned (debug-key) — fine for sideloading a personal app.
  • Tagging vX.Y.Z triggers the release job: assembleRelease + bundleRelease and a GitHub Release with both artifacts attached.

CI overview

  • CI (.github/workflows/ci.yml) — on push to main, on PRs, and on demand: lint, ktlint, detekt, unit tests, assembleDebug, upload debug APK.
  • Cloudflare Pages (.github/workflows/cloudflare-pages.yml) — on pushes touching docs/ or mkdocs.yml: builds the MkDocs site and direct-uploads it with Wrangler to https://spooty.pages.dev.
  • The release job runs on v* tags and publishes APK + AAB from a GitHub Release.