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

Implement caching #17

Merged
merged 11 commits into from
Feb 16, 2021
Merged

Implement caching #17

merged 11 commits into from
Feb 16, 2021

Conversation

dapetcu21
Copy link
Contributor

This greatly reduces our CI costs, especially with macOS runners.

This uses the tool cache on self-hosted runners and Github's cross-job cache for cross-job, cross-action caching.

@leafo
Copy link
Owner

leafo commented Feb 9, 2021

Thanks for the contribution, do you mind rebasing the pull request so CI can run. (it looks like it wasn't enable for pull requests but it now is)

@dapetcu21
Copy link
Contributor Author

Hmm... It seems like it fails if two instances happen to be running at the same time with the same lua version on the same OS+arch.

@dapetcu21
Copy link
Contributor Author

I guess I'll try to figure this out tomorrow :)

@dapetcu21
Copy link
Contributor Author

This should work fine now. In case of race condition it's safe to just ignore the error since the other thread will upload pretty much the same thing if the cache key is the same.

The CI was a bit misleading since it used the cache from the previous run, so I added an ignoreCache input and used it in the tests.

@dapetcu21
Copy link
Contributor Author

@leafo small ping?

with:
luaVersion: ${{ matrix.luaVersion }}
ignoreCache: true
Copy link
Owner

@leafo leafo Feb 16, 2021

Choose a reason for hiding this comment

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

instead of a 'negative' boolean here can we have it called buildCache, set to true by default to have it do the cache

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@leafo leafo merged commit d99da2d into leafo:master Feb 16, 2021
@leafo
Copy link
Owner

leafo commented Feb 16, 2021

Awesome, looks good. Thanks for contributing. I'll push out a new major version after I verify it on my projects that use the action

@leafo leafo mentioned this pull request Feb 16, 2021
@dapetcu21
Copy link
Contributor Author

Hi @leafo! Sorry if I'm bothering you. It would be nice to have a released version with this so that I can reference it in my actions :)

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