-
Notifications
You must be signed in to change notification settings - Fork 223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Dependency Cache] Enable Dependency Cache on CI #3463
Merged
Merged
Conversation
This file contains 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
Release Notes: https://github.com/Automattic/ a8c-ci-toolkit-buildkite-plugin/releases/tag/3.9.1 FYI: This change points to that version of the 'A8C CI Toolkit' where both, the #135 and #138 PRs, are merged into 'trunk', and, the new dependency cache mechanism, per project, without 'GRADLE_RO_DEP_CACHE', is fully operational. A8C CI Toolkit #135 PR: [Dependency Cache] Dependency Cache on CI per Project [without GRADLE_RO_DEP_CACHE] #135 - Automattic/a8c-ci-toolkit-buildkite-plugin#135 A8C CI Toolkit #138 PR: [Dependency Cache] Fix Dependency Cache #138 - Automattic/a8c-ci-toolkit-buildkite-plugin#138
ParaskP7
added
[Type] Tooling
Related to the Gradle build scripts and the setup or maintenance of the project build process.
[Type] Core
labels
Jan 20, 2025
📲 You can test the changes from this Pull Request in 📱 Mobile by scanning the QR code below to install the corresponding build.
📲 You can test the changes from this Pull Request in 🚗 Automotive by scanning the QR code below to install the corresponding build.
📲 You can test the changes from this Pull Request in ⌚ Wear by scanning the QR code below to install the corresponding build.
|
FYI: This job will be then used by 'buildkite-ci' and configured as a 'buildkite_pipeline_schedule' with a weekly frequency. PS: The targeted 'pipeline' related jobs are: - App - Lint - Unit Tests - Android tests
FYI: The targeted 'pipeline' related jobs are: - App - Lint - Unit Tests - Android Tests
Otherwise, running 'lintDebug', which triggers Lint on all modules will fail. This is due to the fact that a corresponding 'lint-baseline.xml' file only exists on these 'app', 'automotive' and 'wear' app related modules.
Having 'testDebugUnitTest' instead of 'assembleDebugUnitTest' was actually a copy-pasting oversight. There is no need to run any tests for the unit tests dependencies to be downloaded.
…o ci/enable-dependency-cache-on-ci
ParaskP7
requested review from
geekygecko,
wzieba and
a team
and removed request for
a team
January 21, 2025 15:38
wzieba
approved these changes
Jan 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
…o ci/enable-dependency-cache-on-ci
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
[Area] Gradle
[Type] Core
[Type] Tooling
Related to the Gradle build scripts and the setup or maintenance of the project build process.
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.
Project Thread: paaHJt-7CE-p2 (Stretch Goal)
Related: WCAndroid#133303 + JP/WPAndroid#21584
Depends On: a8c-ci-toolkit#135 -> a8c-ci-toolkit#138
Required By: buildkite-ci#581
Description
This PR enables dependency cache on CI for this project. 💾
The dependency cache mechanism is split between:
assembleDebug
):app:lintDebug :automotive:lintDebug :wear:lintDebug
)assembleDebugUnitTest
)assembleDebugAndroidTest
)prototype-build.sh
)lint.sh
)run-unit-tests.sh
)run-instrumented-tests.sh
)PS: Dependency cache isn't enabled on the release-builds.yml pipeline just yet, but just temporarily, and until we become comfortable with running this new process on the main pipeline.yml pipeline.
Future Improvement
Me and @wzieba has been discussing on DMs about some possible future improvement, which are including but are not limited to the below list:
assemble android test
task, which depends onassemble
task anyway, and would most likely resolve most of the dependencies, for all other tasks to benefit from. However, this needs further testing to make sure that running other tasks such uslint
andassemble unit test
are providing little to no help.init.d
). Using the init script, go through all available modules for a project, and then, using that custom Gradle task, resolve all dependencies for all tasks that are available per module. We could take some inspiration from plugins such as this.dependency cache
build to run weekly (buildkite-ci#581), make it run more often, possibly scheduling it to even run daily. However, since dependencies are not being updated too often, and, even when they do on that specific week, it would only be for a few of them. This will indeed cause some extra network requests, but most of the dependencies cached would still benefit from the existing and weekly refreshed dependency cache.Testing Instructions
Save Cache
:dependency cache
job to complete: 17m 9s#android-core-notifs
):The dependency cache has been updated.
(p1737386018597179-slack-C0787KRDYDC)Failure to update the dependency cache.
(p1737382895136969-slack-C0787KRDYDC)Restore Cache
:-2m 2s
0s
50s
-2m 5s
0s
54s
-1m 37s
0s
47s
-1m 21s
0s
50s
-21s
0s
56s
Note
Without
: Without Dependency CacheWith
: With Dependency CacheBT
: Build TimeNR
: Network RequestsRC
: Restore CacheWin
: NR (Without) - RC (With)Warning
(*): The
BT (Diff)
presented above is relative, so don't read too much into it, it might not match with theWIN
, which is a much more solid number. But still, it is nice to have and compare those two number together. To to be clear about that, although I tried to pick the most representative builds, without and with the dependency cache mechanism in place, there are other factors that can make any build faster, or slower for that matter (likebuild cache
,firebase test lab
, etc), so again, don't read too much into it.Checklist
N/A
I have tested any UI changes...
N/A