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

Cache Go dependencies when building CLI #1573

Merged
merged 2 commits into from
Jun 11, 2024

Conversation

sikha-root
Copy link
Contributor

@sikha-root sikha-root commented Jun 10, 2024

Enables dependency caching of the Digger CLI binary being built in a deploy when not using version tags (I'm using hashes for immutability). Since it seems I can't use hashFiles for files outside of the workspace of the Terraform code repo running the action we copy that file to one that shouldn't collide with any source files so that we can ensure the cache key is sufficiently unique (maybe not unique enough? not sure).

I'm reusing the cache-dependencies input here because of the name and the description provided indicating that it should probably cover this instead of just Terraform providers, and people turning that on likely want this too.

Also pins the go version used by setup-go to the one in cli's dependency file.

@sikha-root sikha-root marked this pull request as draft June 10, 2024 17:26
@sikha-root sikha-root force-pushed the feature/fix-go-build-caching branch 5 times, most recently from 08e7ddd to 2ae9ae2 Compare June 10, 2024 21:30
also pin setup-go version to cli's dependency file
@sikha-root sikha-root force-pushed the feature/fix-go-build-caching branch from 2ae9ae2 to eee9e7b Compare June 10, 2024 22:40
@sikha-root sikha-root changed the title [actions] enable caching of golang builds Cache Go dependencies when building CLI Jun 10, 2024
@sikha-root sikha-root marked this pull request as ready for review June 10, 2024 22:55
@sikha-root
Copy link
Contributor Author

Finally working at least in a way that's usable. This should close #1535 unless something different is desired.

@sikha-root
Copy link
Contributor Author

I'm assuming the CI failure here and in my other PR are just a result of external PRs not having access to a repository secret or something. Should be resolved separately I guess.

Copy link
Contributor

@motatoes motatoes left a comment

Choose a reason for hiding this comment

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

Thanks so much for this!! Going to give it a test drive

@motatoes motatoes merged commit 4f0ae71 into diggerhq:develop Jun 11, 2024
5 of 6 checks passed
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.

None yet

2 participants