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

Remove use of actions/cache, which conflicts with caching done by actions/setup-go #36571

Merged
merged 1 commit into from
Feb 25, 2025

Conversation

SarahFrench
Copy link
Member

@SarahFrench SarahFrench commented Feb 24, 2025

Fixes the errors we see in GHAs like this:

Screenshot 2025-02-24 at 18 52 37

It looks like v4 of the actions/go-setup GHA enables caching by default, so when the action was updated to use a v4+ version of that action it started clashing with actions/cache.

This PR removes use of actions/cache and instead uses the caching features of go-setup. Internally this uses the same logic (actions/cache is used) but requires fewer inputs.

This matches what's already done in the equivalence test workflows, so a cache will be shared between more GHA workflows after this PR.

Target Release

N/A

CHANGELOG entry

  • This change is user-facing and I added a changelog entry.
  • This change is not user-facing.

@SarahFrench SarahFrench added the no-changelog-needed Add this to your PR if the change does not require a changelog entry label Feb 24, 2025
@SarahFrench SarahFrench force-pushed the fix-gha-go-cache-errors branch from e731004 to 62dc61a Compare February 24, 2025 19:00
@SarahFrench SarahFrench changed the title Stop actions/setup-go setting a cache, which conflicts with use of actions/cache Remove use of actions/cache, which conflicts with caching done by actions/setup-go Feb 24, 2025
@SarahFrench SarahFrench force-pushed the fix-gha-go-cache-errors branch from 62dc61a to 46132d8 Compare February 24, 2025 19:04
@SarahFrench SarahFrench marked this pull request as ready for review February 24, 2025 19:05
@SarahFrench SarahFrench requested a review from a team as a code owner February 24, 2025 19:05
@SarahFrench
Copy link
Member Author

I initially started with the opposite approach of disabling caching in actions/setup-go and leaning actions/cache in the workflow, but figured it was best to go with simplicity.

@SarahFrench
Copy link
Member Author

SarahFrench commented Feb 24, 2025

Looks like the test command step has a lot of go get...s happening - cache not being used?

Edit: I was wrong- the cache is used but for some reason there are some 'stragglers' that still need to be go get-ed when the step with the go test command runs. If you remove the cache entry and re-run the workflow the number of go gets increases massively.

tl;dr: This PR is ok for review again.

@SarahFrench SarahFrench marked this pull request as ready for review February 24, 2025 20:18
Copy link
Member

@dbanck dbanck left a comment

Choose a reason for hiding this comment

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

Thanks for looking into this! These errors have been bothering me since I joined the team

@SarahFrench SarahFrench merged commit a703cda into main Feb 25, 2025
24 checks passed
@SarahFrench SarahFrench deleted the fix-gha-go-cache-errors branch February 25, 2025 08:36
@SarahFrench SarahFrench added the 1.11-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged label Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.11-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged no-changelog-needed Add this to your PR if the change does not require a changelog entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants