Repository navigation
ci: run unit tests and a debug build on pull requests - #111
Merged
Merged
Conversation
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.
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 + If you would rather keep it cheaper, I can drop the |
This was referenced Nov 15, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Today a pull request gets no automated checks: the only build workflows are
nightly.yml(schedule + push tomain) andgpu-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_requestworkflow 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
./gradlew :app:testDebugUnitTestand./gradlew :app:assembleDebugonubuntu-latest.27.2.12479018,glslc, andgradle/actions/setup-gradlecaching.permissions: contents: readand no secrets, so a fork PR only ever gets a read-only token.app/**,gradle/**,*.gradle.kts,gradle.properties, the workflow itself); docs-only PRs skip it.concurrencycancels 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:assembleDebugand 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
nightly.yml, which already runs green onmain(run 683, 2026-11-15), so the commands and toolchain are proven in this repo.assembleDebug, 13 minutes): https://github.com/Sanuu7/AndroidHarness/actions/runs/43715751516