Skip to content
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

Documentation: provide information about parallel cache usage using matrix-based Gradle builds #608

Closed
hiddewie opened this issue Feb 23, 2023 · 2 comments · Fixed by #850
Assignees
Labels
documentation Improvements or additions to documentation
Milestone

Comments

@hiddewie
Copy link

hiddewie commented Feb 23, 2023

I have the following Gradle projects:

- root
  - A
  - B
  - C

The tests for A, B and C are run in parallel, by using a Github Actions matrix strategy.

For Gradle tests, these situations are interesting, because the gradle home directory is populated with the dependencies / gradle cache just for A, B or C within it's specific tests, while the project and source files (and especially the Gradle configuration) is equal for all builds.

Can this be added to the documentation, how parallel builds influence the caching behaviour in parallel tests. How are the keys and context built up for each of the subproject builds?

I noticed https://github.com/gradle/gradle-build-action/blob/main/src/cache-utils.ts#L128-L130 which takes the matrix context into account for building the cache key. This suits my purposes just fine.

It seems the cache keys are overridable as well by environment variables, https://github.com/gradle/gradle-build-action/blob/main/src/cache-utils.ts#L22-L26, which is undocumented.

@bigdaz bigdaz added the documentation Improvements or additions to documentation label Mar 30, 2023
@bigdaz bigdaz self-assigned this Aug 15, 2023
@bigdaz bigdaz added this to the 2.7.1 milestone Aug 15, 2023
bigdaz added a commit that referenced this issue Aug 17, 2023
- Describe the limitations/properties of the GitHub Actions cache
- Document the algorithm for generating a cache key, and the way that cache entries are matched
- Describe in more detail how entries are de-duplicated
- Explain how cache entries can be optimized in Job pipelines

Fixes #831
Fixes #608
bigdaz added a commit that referenced this issue Aug 17, 2023
- Describe the limitations/properties of the GitHub Actions cache
- Document the algorithm for generating a cache key, and the way that cache entries are matched
- Describe in more detail how entries are de-duplicated
- Explain how cache entries can be optimized in Job pipelines

Fixes #831
Fixes #608
bigdaz added a commit that referenced this issue Aug 17, 2023
- Describe the limitations/properties of the GitHub Actions cache
- Document the algorithm for generating a cache key, and the way that cache entries are matched
- Describe in more detail how entries are de-duplicated
- Explain how cache entries can be optimized in Job pipelines

Fixes #831
Fixes #608
@bigdaz
Copy link
Member

bigdaz commented Aug 17, 2023

@hiddewie I added a "How caching works" section to the README, which I think addresses the issue you raised here.

It would be great if you could take a look and see if it clarifies things for you. The content needs some restructuring/editing, but for now I was just wanted to get the information in there.

@hiddewie
Copy link
Author

Thank you for expanding the documentation. The content is extensive and answers some of my questions. The section Select which jobs should write to the cache in particular answers some of the questions for running Gradle tasks in Github actions in parallel with effective dependency caching 👍🏻.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants