Skip to content

ci: run unit tests and a debug build on pull requests - #111

Merged
Sanuu7 merged 1 commit into
Sanuu7:mainfrom
jstzy:ci/pr-build
Nov 17, 2026
Merged

Sanuu7 merged 1 commit into
Sanuu7:mainfrom
jstzy:ci/pr-build

Conversation

@jstzy

@jstzy jstzy commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Why

Today a pull request gets no automated checks: the only build workflows are nightly.yml (schedule + push to main) and gpu-runtime.yml (manual). A change that fails to compile or breaks a unit test is first caught by the next nightly build, after it has already been merged.

This adds a pull_request workflow that runs the unit tests and builds the debug APK on the PR itself, so reviewers get a green/red signal before merging.

What it does

  • Runs ./gradlew :app:testDebugUnitTest and ./gradlew :app:assembleDebug on ubuntu-latest.
  • Reuses the toolchain the nightly "Debug build" already proves out: JDK 21 (Temurin), the pinned NDK 27.2.12479018, glslc, and gradle/actions/setup-gradle caching.
  • Uploads the unit-test report as an artifact when the tests fail.
  • permissions: contents: read and no secrets, so a fork PR only ever gets a read-only token.
  • Only runs on PRs that touch build inputs (app/**, gradle/**, *.gradle.kts, gradle.properties, the workflow itself); docs-only PRs skip it.
  • concurrency cancels superseded runs when a PR gets a new push.

Cost

About 15-20 minutes per run, close to the nightly build. If that is too much, the easy knobs are: drop :app:assembleDebug and keep tests only, or skip the NDK/glslc steps for changes that cannot affect native code. Tell me which you prefer and I will adjust.

Notes

Verification

  • The YAML parses and validates against the GitHub workflow schema locally.
  • It is a trimmed copy of the steps in nightly.yml, which already runs green on main (run 683, 2026-11-15), so the commands and toolchain are proven in this repo.
  • First run of this workflow on its own PR: all steps passed (unit tests + assembleDebug, 13 minutes): https://github.com/Sanuu7/AndroidHarness/actions/runs/43715751516

Adds a pull_request workflow so a broken change is caught during review
instead of by the next nightly build. It reuses the nightly "Debug build"
toolchain: JDK 21, the pinned NDK 27.2.12479018, glslc, then
:app:testDebugUnitTest and :app:assembleDebug.

Runs are limited to build inputs (app/, gradle/, *.gradle.kts,
gradle.properties, this workflow) so docs-only PRs do not spend a build, and
superseded runs are cancelled when a PR gets a new push. The job token is
read-only and no secrets are used.
@jstzy

jstzy commented Nov 15, 2026

Copy link
Copy Markdown
Contributor Author

The workflow's first run is on this PR and it passed: https://github.com/Sanuu7/AndroidHarness/actions/runs/43715751516

All steps green (unit tests + assembleDebug), about 13 minutes on ubuntu-latest. From here on, every PR touching app/**, gradle/**, *.gradle.kts, gradle.properties or this workflow gets the same signal.

If you would rather keep it cheaper, I can drop the assembleDebug step or the NDK/glslc setup; just say which.

@Sanuu7
Sanuu7 merged commit 212c61e into Sanuu7:main Nov 17, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants