Sitelet https://github.com/leafo/gh-actions-lua/pull/17
Skip to content

Implement caching - #17

Merged
leafo merged 11 commits into
leafo:masterfrom
dapetcu21:master
Feb 16, 2021
Merged

leafo merged 11 commits into
leafo:masterfrom
dapetcu21:master

Conversation

@dapetcu21

Copy link
Copy Markdown
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

leafo commented Feb 9, 2021

Copy link
Copy Markdown
Owner

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
Copy Markdown
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
Copy Markdown
Contributor Author

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

@dapetcu21

Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

@leafo small ping?

Comment thread .github/workflows/test.yml Outdated
uses: './'
with:
luaVersion: ${{ matrix.luaVersion }}
ignoreCache: true

@leafo leafo Feb 16, 2021 •

Copy link
Copy Markdown
Owner

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
Copy Markdown
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

leafo commented Feb 16, 2021

Copy link
Copy Markdown
Owner

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
Copy Markdown
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