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

Use @actions/tool-cache #196

Merged
merged 6 commits into from
May 8, 2023
Merged

Use @actions/tool-cache #196

merged 6 commits into from
May 8, 2023

Conversation

ericmj
Copy link
Collaborator

@ericmj ericmj commented May 1, 2023

No description provided.

@ericmj ericmj force-pushed the ericmj/actions-tool-cache branch 9 times, most recently from 91ded92 to 46db17b Compare May 1, 2023 23:50
@ericmj
Copy link
Collaborator Author

ericmj commented May 7, 2023

@paulo-ferraz-oliveira I think this is ready for review.

Gleam and Rebar3 are still not using the tool-cache but I don't use them and don't want to deal with more merge conflicts so I am only doing Elixir and OTP in this PR. If someone wants to use to contribute the tool-cache for Gleam and Rebar3 that would be great.

I also learnt tool-cache is only caching between usages in a single workflow, it doesn't cache between different CI runs. So if we actually want proper caching we need to use @actions/cache. But tool-cache is still an improvement because it adds retries and removes the shell files and much of the different handling between linux and windows.

@ericmj ericmj marked this pull request as ready for review May 7, 2023 16:06
@starbelly
Copy link
Member

Gleam and Rebar3 are still not using the tool-cache but I don't use them and don't want to deal with more merge conflicts so I am only doing Elixir and OTP in this PR. If someone wants to use to contribute the tool-cache for Gleam and Rebar3 that would be great.

This is great. I think the main rub was OTP anyway.

@starbelly
Copy link
Member

We have a failing job, I'd be in favor of removing it or altering the job so it doesn't test with rebar. I believe that version of rebar isn't supported anymore, at the very least that version of OTP supported isn't supported by rebar itself. If we really want to test OTP 20 with rebar, we should probably bump the rebar version in there, thoughts?

@paulo-ferraz-oliveira
Copy link
Collaborator

If someone wants to use to contribute the tool-cache for Gleam and Rebar3 that would be great.

I created an issue to track this: #204. If somebody wants to give it a go, it's there.

@paulo-ferraz-oliveira
Copy link
Collaborator

We have a failing job

Which one? It's probably one of those I recently fixed, but wanna be in sync with this comment.

src/installer.js Outdated
cachedPath = await tc.cacheDir(extractPath, 'otp', fullVersion)
}

// TODO: Can we cache install?
Copy link
Collaborator

Choose a reason for hiding this comment

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

If this is not to be solved in the context of this pull request, could you create a task to track it, and delete the comment? I think there's a similar one below. What's the measurable improvement in caching the installation too?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There's no improvement unless you do multiple installations in one workflow run. I don't think anyone is doing that.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Perfect!

Copy link
Collaborator

@paulo-ferraz-oliveira paulo-ferraz-oliveira left a comment

Choose a reason for hiding this comment

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

Approved with minor comments:

  • needs a rebase
  • there's a comment-related comment you might want to look at, otherwise we can do it in the future too

@ericmj ericmj force-pushed the ericmj/actions-tool-cache branch from 791b665 to 3f2a75e Compare May 8, 2023 10:36
@ericmj ericmj merged commit 51905b8 into main May 8, 2023
59 checks passed
@ericmj ericmj deleted the ericmj/actions-tool-cache branch May 8, 2023 10:40
@paulo-ferraz-oliveira
Copy link
Collaborator

@ericmj, if/when you have time do you think you could summarise "I also learnt tool-cache is only caching between usages in a single workflow, it doesn't cache between different CI runs. So if we actually want proper caching we need to use @actions/cache. But tool-cache is still an improvement because it adds retries and removes the shell files and much of the different handling between linux and windows." in a new issue, for later tackling? Thanks much.

@ericmj
Copy link
Collaborator Author

ericmj commented May 8, 2023

I don't know yet if it's a good idea to do that, still looking into it. I can't find other actions using @actions/cache to cache installations.

@starbelly
Copy link
Member

I don't know yet if it's a good idea to do that, still looking into it. I can't find other actions using @actions/cache to cache installations.

Late to the party here, but I do think that kind of caching should be left up to the user.

@paulo-ferraz-oliveira
Copy link
Collaborator

Released in v1.16.0 / v1.16. Tag v1 moved up...

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.

None yet

3 participants