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

Cache sbt files in CI, update versions of CI actions #560

Merged
merged 2 commits into from
Aug 29, 2024

Conversation

jiribenes
Copy link
Contributor

Investigating #428 since I noticed that setup-java allows simple sbt caching when playing with #538 :)

Comment on lines 48 to 54
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
java-version: 11
distribution: 'zulu'
cache: 'sbt'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The newer setup-java action requires an explicit JDK distribution. I set it to zulu since that's what it used implicitly, but I'm open to using a different distribution. (I honestly have no idea which distribution is the best here.)

Here's the list of supported distributions https://github.com/actions/setup-java?tab=readme-ov-file#supported-distributions

@jiribenes
Copy link
Contributor Author

jiribenes commented Aug 29, 2024

It's very difficult to measure if this helps at all, I'm guesstimating based on only 5 runs.
On a cache hit, this PR makes the CI go from around ~11m40-12m55 to ~11m20-12m15. On a cache miss, it takes much longer (15m00), but we shouldn't have a cache miss too often (our sbt dependencies, Java/Scala versions are stable)

Regarding what could be done next:

  • Caching MLton makes very little sense (it takes only 1s already)
  • similarly for apt dependencies (takes about 10s; what we could do there is to put them into a single command...)

@jiribenes
Copy link
Contributor Author

jiribenes commented Aug 29, 2024

I think it's worth merging this, even if the speed-up isn't too huge, but I'll leave #428 open as yet unresolved.
I'll also back-port these changes into #538 :)

@jiribenes jiribenes changed the title Experiment: CI caching Cache sbt files in CI, update versions of CI actions Aug 29, 2024
Copy link
Collaborator

@b-studios b-studios left a comment

Choose a reason for hiding this comment

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

Great, thanks!

@b-studios b-studios merged commit 0441059 into master Aug 29, 2024
2 checks passed
@b-studios b-studios deleted the feature/java-sbt-cache branch August 29, 2024 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants