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

GitHub Actions cache fixes #3723

Merged
merged 3 commits into from
Nov 11, 2021
Merged

GitHub Actions cache fixes #3723

merged 3 commits into from
Nov 11, 2021

Conversation

3flex
Copy link
Member

@3flex 3flex commented Apr 30, 2021

Summary of changes:

  • Runs Gradle tasks with gradle-build-action@v2. This handles running Gradle tasks and caching various outputs. v2 is in beta, but once it's stable it will be supported by Gradle and recommended as the canonical way to run Gradle tasks on GitHub Actions.
  • Enable Gradle's configuration cache for jobs that support it, which will reduce the job's execution time

Blocked until gradle-build-action v2 goes into production release as the configuration syntax could potentially change.

@codecov
Copy link

codecov bot commented Apr 30, 2021

Codecov Report

Merging #3723 (8a66d34) into main (7479bda) will decrease coverage by 0.16%.
The diff coverage is n/a.

❗ Current head 8a66d34 differs from pull request most recent head d489a49. Consider uploading reports for the commit d489a49 to get more accurate results
Impacted file tree graph

@@             Coverage Diff              @@
##               main    #3723      +/-   ##
============================================
- Coverage     84.27%   84.10%   -0.17%     
+ Complexity     3249     3197      -52     
============================================
  Files           471      466       -5     
  Lines         10261    10089     -172     
  Branches       1805     1773      -32     
============================================
- Hits           8647     8485     -162     
- Misses          664      673       +9     
+ Partials        950      931      -19     
Impacted Files Coverage Δ
...tekt/rules/exceptions/TooGenericExceptionThrown.kt 50.00% <0.00%> (-45.84%) ⬇️
...gitlab/arturbosch/detekt/rules/KtCallExpression.kt 0.00% <0.00%> (-33.34%) ⬇️
...osch/detekt/rules/style/CollapsibleIfStatements.kt 81.25% <0.00%> (-11.61%) ⬇️
...itlab/arturbosch/detekt/api/internal/Signatures.kt 77.55% <0.00%> (-8.17%) ⬇️
...s/performance/UnnecessaryTemporaryInstantiation.kt 78.57% <0.00%> (-6.05%) ⬇️
...gitlab/arturbosch/detekt/cli/ArgumentConverters.kt 69.23% <0.00%> (-5.77%) ⬇️
...rbosch/detekt/rules/style/UntilInsteadOfRangeTo.kt 77.77% <0.00%> (-3.18%) ⬇️
...itlab/arturbosch/detekt/rules/style/MagicNumber.kt 88.17% <0.00%> (-3.04%) ⬇️
...h/detekt/rules/naming/InvalidPackageDeclaration.kt 93.75% <0.00%> (-2.68%) ⬇️
...sch/detekt/rules/style/UnnecessaryAbstractClass.kt 82.60% <0.00%> (-2.18%) ⬇️
... and 49 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7479bda...d489a49. Read the comment docs.

@3flex 3flex force-pushed the cache-fixes branch 2 times, most recently from abb37cf to 46539b2 Compare April 30, 2021 13:11
@3flex 3flex force-pushed the cache-fixes branch 10 times, most recently from 14b671d to e599991 Compare May 2, 2021 10:12
@3flex

This comment has been minimized.

@3flex 3flex closed this May 3, 2021
@BraisGabin BraisGabin deleted the cache-fixes branch May 4, 2021 07:10
@BraisGabin

This comment has been minimized.

@3flex 3flex restored the cache-fixes branch May 4, 2021 12:19
@3flex 3flex reopened this Oct 1, 2021
@3flex 3flex force-pushed the cache-fixes branch 5 times, most recently from 4f1046b to 690b98a Compare October 2, 2021 00:21
@3flex 3flex added housekeeping Marker for housekeeping tasks and refactorings blocked ci labels Oct 2, 2021
@3flex 3flex marked this pull request as ready for review October 2, 2021 02:20
@3flex
Copy link
Member Author

3flex commented Oct 21, 2021

Till we wait for that, could we bump actions/setup-java only?

Created #4194 with the changes that aren't blocked by gradle-build-action@v2.

I still suggest not merging this one until gradle-build-action@v2 stable version is released (they're at beta 6 now so you'd think they're close - I'm subscribed to release notifications on that repo so I'll update here once it's good to go).

Copy link
Member

@cortinico cortinico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Waiting for gradle/gradle-build-action@2.0. Just saw that RC1 got released one hour ago.

This action handles caching of:
- Wrapper distribution
- Downloaded dependencies
- Build cache
- Configuration cache

https://github.com/gradle/gradle-build-action/blob/v2.0.0/README.md#caching
gradle-build-action runs Gradle tasks with --no-daemon flag already
@3flex
Copy link
Member Author

3flex commented Nov 10, 2021

🎉

https://github.com/gradle/gradle-build-action/releases/tag/v2.0.0

@3flex 3flex merged commit c6f796a into main Nov 11, 2021
@3flex 3flex deleted the cache-fixes branch November 11, 2021 00:35
@3flex 3flex added this to the 1.19.0 milestone Nov 11, 2021
@3flex
Copy link
Member Author

3flex commented Nov 14, 2021

An issue I've experienced with this implementation: gradle/gradle-build-action#120

Hopefully this is caught by the action in future. I don't think it's worth rolling back; it's not typical to have several jobs running concurrently. We might also try only caching on main branch: https://github.com/gradle/gradle-build-action/blob/v2.0.0/README.md#only-write-to-the-cache-from-the-default-branch

This would avoid many uploads occurring at once thanks to multiple PRs being opened quickly one after the other, but it would still occur when multiple PRs are merged quickly one after the other on main branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci housekeeping Marker for housekeeping tasks and refactorings
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants