Repository navigation
ci: cache Gradle and run tests and lint in parallel - #12
Merged
Merged
Conversation
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.
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.
Summary
Speeds up Android checks:
gradle/actions/setup-gradlecaches the Gradle distribution, dependencies, and build cache between runs. The cache is written frommainand read on pull requests../gradlew testand./gradlew lintDebugrun 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
mainrun 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
./gradlew test lintDebugsucceeded.--dry-runbefore and after::app:lintAnalyzeDebugUnitTestand:app:lintAnalyzeDebugAndroidTestare gone.main.Known limits
sourceControldependency onopen-bot-avatar-ktis incompatible with it ("Configuration cache disabled because incompatible feature usage (source dependencies) was found").Risk and rollback
Reversibility: Reversible
Blast radius: CI only. Lint no longer reports issues in test sources.