♻️ [CI] Improved Kapua CI workflow artifacts and dependency caching #4179
+246
−135
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.
Improved the way and what gets cached as dependencies and built artifacts in used GitHub Actions workflows
Related Issue
None
Description of the solution adopted
Instead of having a cache per-build, which means that for each run we are downloading all dependencies for a job (unless restarting the same job), we switched to have 2 caches:
Cache for external dependencies
Named
Linux-maven-{branchName}-dependencies
, which will cache all.m2/repository
but the artifacts under.m2/repository/org/eclipse/kapua
.This cache will be per release branch/develop and can be reused by all workflows and for all branches that start from a release branch or develop.
A TODO is to have this cache have a time reference, like
{year}-{month}
, appended to it to make it rebuilt from time to time with updated dependencies.Since filtering with exclude paths for
action/cache
is not working properly (see actions/toolkit#713), exclusion is made by moving the folder outside of the maven repository.Cache for built artifacts
Named
Linux-maven-{github_action_run_id}-kapua-artifacts
, which will cache Kapua artifacts built during the run. This cache will be reused by all job from the same run test and other tasksThis cache is restored and then moved to
.m2/repository/org/eclipse/kapua
directory so it can be detected and reused by MavenBenefit of this are:
Screenshots
None
Any side note on the changes made
Some clean up and optimization of jobs and action has been done to simplify management and avoid duplication of common parts