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 cache on lint action #1332

Merged
merged 2 commits into from
Aug 30, 2024
Merged

Use cache on lint action #1332

merged 2 commits into from
Aug 30, 2024

Conversation

kian99
Copy link
Contributor

@kian99 kian99 commented Aug 28, 2024

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.

@kian99 kian99 requested a review from a team as a code owner August 28, 2024 15:08
@SimoneDutto
Copy link
Contributor

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?

@kian99
Copy link
Contributor Author

kian99 commented Aug 29, 2024

@SimoneDutto

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
Run 2: Go mod cache, no lint cache, 4m29s
Run 3: Go mod cache, lint cache, 1m14s

Most of the time in the last run was spent restoring the mod cache.

@@ -24,3 +24,9 @@ jobs:

- name: Build
run: go build ./...

Copy link
Contributor

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

Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@SimoneDutto
Copy link
Contributor

@SimoneDutto >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 Run 2: Go mod cache, no lint cache, 4m29s Run 3: Go mod cache, lint cache, 1m14s

Most of the time in the last run was spent restoring the mod cache.
nice!

@kian99 kian99 merged commit 4663c93 into canonical:v3 Aug 30, 2024
4 checks passed
kian99 added a commit to kian99/jimm that referenced this pull request Sep 3, 2024
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.

3 participants