Skip to content

ci: cache Gradle and run tests and lint in parallel - #12

Merged
cheetahbyte merged 2 commits into
mainfrom
ci/faster-checks
Nov 9, 2026
Merged

cheetahbyte merged 2 commits into
mainfrom
ci/faster-checks

Conversation

@cheetahbyte

Copy link
Copy Markdown
Contributor

Summary

Speeds up Android checks:

  • gradle/actions/setup-gradle caches the Gradle distribution, dependencies, and build cache between runs. The cache is written from main and read on pull requests.
  • ./gradlew test and ./gradlew lintDebug run as separate parallel jobs instead of one sequential step.
  • lint { ignoreTestSources = true; checkDependencies = false } stops linting the app's unit-test and androidTest sources.

Why

The main run 42493339044 took about 6 minutes, over the two-minute limit for unit-test CI. Each run started with an empty Gradle home (about 1.5 minutes of configuration) and ran lint after tests, with app lint alone taking about 2 minutes.

Evidence

  • Locally: ./gradlew test lintDebug succeeded.
  • --dry-run before and after: :app:lintAnalyzeDebugUnitTest and :app:lintAnalyzeDebugAndroidTest are gone.
  • CI timing: see this PR's run. The first PR run gets no cache benefit, because the cache is only written from main.

Known limits

  • The configuration cache stays disabled: the sourceControl dependency on open-bot-avatar-kt is incompatible with it ("Configuration cache disabled because incompatible feature usage (source dependencies) was found").
  • The avatar library is an included build, so it is still compiled and linted on every run (about 1 minute). Publishing or vendoring it would remove both costs.

Risk and rollback

Reversibility: Reversible

Blast radius: CI only. Lint no longer reports issues in test sources.

cheetahbyte and others added 2 commits November 9, 2026 19:01
Add gradle/actions/setup-gradle so dependencies and build outputs carry
over between runs, split ./gradlew test and lintDebug into separate
jobs, and stop linting test sources.
@cheetahbyte
cheetahbyte merged commit d8ca522 into main Nov 9, 2026
2 checks 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.

1 participant