-
Notifications
You must be signed in to change notification settings - Fork 5
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 cache on lint action #1332
Use cache on lint action #1332
Conversation
943d15a
to
952b9da
Compare
952b9da
to
485e91a
Compare
i am curious, if i rerun the ci action w/o changing the code how well the linting is cached? or is it just for the deps? |
Run 1: No go cache, no lint cache, 12m40s Most of the time in the last run was spent restoring the mod cache. |
@@ -24,3 +24,9 @@ jobs: | |||
|
|||
- name: Build | |||
run: go build ./... | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Think I'm confusd with how this works and maybe a chat at standup to explain it to me would help, just so I'm clear how the caching works... I'll have a read too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can discuss it further in the standup but i give you a primer.
With go-setup you have a setup and a teardown step in your workflow.
The first is at the start and searches for a go cache in github cache and retrieves it, the second is done at the end of the workflow and stores go cache folders into github cache.
Go build step populates the cache with artifacts and deps and the linting step adds linting artifacts to the cache as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An important read to fully understand things is here https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/caching-dependencies-to-speed-up-workflows
|
Description
This PR adds linting to the cache.yaml action so that a lint cache is available on the default branch for PRs to have a hot cache.
It also enables caching on the go-setup action in linting workflow, although this could cause a similar issue to #1307, a cache is not created if an existing cache exists so this shouldn't cause any issues.